目前,我有以下代码 import matplotlib.pyplot as plt
import pandas as pd
from pandas.plotting import scatter_matrix
df= pd.read_csv(file, sep=',')
colors = list('r' if i==1 else 'b' for i in df['class']) #
尝试使用sqrt方法生成bin大小的直方图。我究竟做错了什么?我的代码如下给我错误。谢谢。 TypeError: 'float' object cannot be interpreted as an integer values = [1,5,2,8,5,11,24,30,50]
x = len(values)
binsizes = math.sqrt(x)
plt.hist(values,