简体   繁体   English

绘制具有重复值的两列的数据框

[英]Plotting of Dataframe with two columns having repetitive values

I have a dataframe with repetitive data and I want to plot it (may be using seaborn).我有一个包含重复数据的数据框,我想绘制它(可能正在使用 seaborn)。 column1 has 4 different strings which repeat 6 times each. column1 有 4 个不同的字符串,每个字符串重复 6 次。 column2 has their corresponding values in decimals(float). column2 在小数点(浮点数)中有相应的值。 I have to boxplot it with the 4 distinct names on the x-axis and their corresponding values on the y-axis我必须用 x 轴上的 4 个不同名称和它们在 y 轴上的相应值对其进行箱线图

mydata = np.normal(What to write in this!)

sns.boxplot(data=mydata);  

sns.plt.show()

Data is of the form:数据格式如下:

     col_A       col_B     col_C
2    CareNigr     1       593.662
11   JuncEffu     1      1739.839
27   HolcLana    23      3255.829
28   CareNigr     5      2960.367
49   JuncEffu    19      1137.202
66   HolcLana    19      3389.649
67   CareNigr     7      1478.291
68   HolcLana    13      2898.826
84   LychFlos    23      2897.199
87   LychFlos     8      3227.606
90   JuncEffu     1       937.697
98   HolcLana    14      2577.221
108  LychFlos    20      1814.692
127  CareNigr     4      1617.430
139  LychFlos     9       583.174
144  JuncEffu    17      1461.574
148  CareNigr     3      1387.861
156  HolcLana     7      2447.608
167  JuncEffu     1      1566.370
168  HolcLana    20      1759.717
175  JuncEffu    24      1845.036
179  LychFlos     1       598.637
193  LychFlos     1      2673.134
194  CareNigr    19      2037.673

您可能想尝试df.boxplot(by='col_A', column="col_C",)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM