0

I have a data frame which is already binned in 200 bins. How can I plot it with sns.swarmplot()

I read this but it doesn't work for me. For example:

bins    number
1   202
2   10863
3   857
4   10544
5   5642
6   348
7   26
8   20
9   1
10  1

I don't know how can I un-binned the data frame by pandas or Numpy. The plot's shape should be like below. Total number of items is 6M in 200 bins so generating them in pandas or Numpy may cause memory problems.

enter image description here

Marcus Campbell
  • 2,746
  • 4
  • 22
  • 36
Reza energy
  • 135
  • 7
  • You cannot produce a swarmplot with already binned data, simply because there is no way of knowing the position of the dots in that case. – ImportanceOfBeingErnest Mar 08 '19 at 10:24
  • @ImportanceOfBeingErnest swarmplot is symbolic and doesn't care about the position of data it only needs to know how many points are in each bin? – Reza energy Mar 08 '19 at 18:16
  • No, the y-position is the position of the data. The x values are symbolic, indeed. But here you do not have any y-positions available, so it cannot work. (Of course you could invent some, if you want) – ImportanceOfBeingErnest Mar 08 '19 at 18:29

0 Answers0