我有 DataFrame df:
Run Code Online (Sandbox Code Playgroud)Timestamp-start datetime64[ns] Timestamp-end datetime64[ns] M object S object Type object description_x object description_y object Date datetime64[ns] number_col float64 dtype: object
number_col :
51 0.0
0 1.0
1 2.0
2 3.0
52 5.0
...
47 148.0
48 148.0
43 148.0
49 149.0
50 149.0
Name: number_col, Length: 132, dtype: float64
Run Code Online (Sandbox Code Playgroud)
我想使用seaborn和列number_col绘制直方图
> import seaborn as sns
>
> sns.distplot(df, x='number_col')
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
ValueError: could not convert string to float: 'number_col'
Run Code Online (Sandbox Code Playgroud)
我不知道为什么会发生这种情况,“number_col”已经是一个浮点列。