Dropping less frequently used categorical data?
The most straightforward approach would be to consider these small categories as single 'unknown' category - if they're really small, your model shouldn't change drastically.


  Another approach would be to replace all categories to dummie where
  the mean is close to the total mean of target column? then I would
  ditch code_189 (the most frequent) because its varies barely from
  0.072?


This idea seems to be close to mean encoding approach. Mean encoding consists of creating a column where categories are encoded by mean of target for this category. This can incorporate knowledge of small categories naturally - you can just replace their means with global mean, or use smoothing. I encourage you to see this segment on mean encodings (the next video is on regularization).