私信  •  关注

usher

usher 最近创建的主题
usher 最近回复了
5 年前
回复了 usher 创建的主题 » 来自csv熊猫的python计数行

假设你有

color_df # dataframe object

你可以这样做:

result_df = color_df.groupby('is_trans').count()
print(result_df) # should give you what you ask for.
5 年前
回复了 usher 创建的主题 » 如何使用python创建非计数值的直方图?
import matplotlib.pyplot as plt 


vector_of_values = [1,2,3,4,5,6,7,8,9]
plt.hist(vector_of_values)

plt.show()

如果你想要更多的箱子,你可以更换

plt.hist(vector_of_values)

具有

plt.hist(vector_of_values, bins=100) # or any number of bins you can have