小编Jee*_* NH的帖子

类型错误:在绘制 seaborn.regplot 时,无法根据规则“安全”将数组数据从 dtype('int64') 转换为 dtype('int32')

我正在尝试使用 seaborn 绘制 regplot 并且我无法绘制它并面临TypeError: Cannot cast array data from dtype('int64') to dtype('int32') 根据规则 'safe'

我的数据有 731 行和 16 列 -

>>> bike_df.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 731 entries, 0 to 730
Data columns (total 16 columns):
 #   Column      Non-Null Count  Dtype  
---  ------      --------------  -----  
 0   instant     731 non-null    int64  
 1   dteday      731 non-null    object 
 2   season      731 non-null    int64  
 3   yr          731 non-null    int64  
 4   mnth        731 non-null    int64  
 5   holiday     731 non-null    int64  
 6   weekday     731 …
Run Code Online (Sandbox Code Playgroud)

python data-visualization typeerror pandas seaborn

10
推荐指数
2
解决办法
4757
查看次数

标签 统计

data-visualization ×1

pandas ×1

python ×1

seaborn ×1

typeerror ×1