0

Thanks everyone for the advice! editing my original question here:

Say that I have a dataset and my column 'operator has 4 different values. Then, I want to create 4 different scatterplots visualizing the distribution of each of those values (one scatterplot for AB, other for BC and so on):

data = {'Operator':['AB','BC','DE','FG','AB','AB','DE','BC','BC','BC','BC'], 
'delay': [22000,25000,27000,35000, 4567, 1893,15373,987,354,1,15]}

data = pd.DataFrame(data)

I've trying to run a for loop based on some examples online because the idea is to iterate through the column. But I am not able to make it work, an example of what I did:

op = data[['Operator', 'delay']]

plt.figure(figsize=(15,10))
for i in op: 
   plt.subplot(2,2,i[0]+1)
   sns.histplot(i[1], hue = 'Operator', data = op)

Thanks for your help! please let me know if this is not clear.

limona
  • 1
  • 2
  • Just to put you on the right path here so you don't get downvoted, you should be including your code or what research you've done. Code should be a Minimum. Reproducible. Example. This should help (https://stackoverflow.com/help/minimal-reproducible-example) – hrokr Jun 11 '22 at 03:11
  • Welcome to SO! Rather than simply sharing an image of your Jupyter notebook, could you provide us with more context and, preferably, a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the problem you are stuck with, so that it is easier for the community to help you? – Sati Jun 11 '22 at 03:11
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 11 '22 at 03:12

0 Answers0