更新时间:2023-01-27 09:19:10
使用seaborn库,您可以执行以下操作:
Using seaborn library you can do something like this:
import seaborn
import pandas as pd
csvfile = "C:/Users/Simon/Desktop/test.csv"
data = pd.read_csv(csvfile)
fg = seaborn.factorplot(x='ID', y='Values', hue='GroupName', kind='bar', data=data)
那会给你这样的东西:
在我的示例中,数据是通过读取csv文件创建的数据帧,但是无论您如何获取数据,只要它是数据帧,此数据帧都将起作用
In my example data is a dataframe created by reading a csv file, but this will work regardless of how you got your data in, as long as its a dataframe