成功解决sys:1: DtypeWarning: Columns (39,41,42,217) have mixed types.Specify dtype option on import or s

简介: 成功解决sys:1: DtypeWarning: Columns (39,41,42,217) have mixed types.Specify dtype option on import or s


目录

解决问题

解决思路

解决方法


 

 

 

 

 

解决问题

sys:1: DtypeWarning: Columns (39,41,42,217) have mixed types.Specify dtype option on import or set low_memory=False.

 

 

解决思路

sys:1: Dtype警告:列(39、41、42,217)有混合类型

 

 

解决方法

因为pandas库读取csv文件的时候,因为涉及到不同电脑硬件内存的差异,默认按块读取的,并非一次性全部读取完。那么,pandas在读取不同块的时候,如果某字段下的数据类型不尽一致,则会出现该警告。

 

pd.read_csv(test001.csv')

改为

pd.read_csv(test001.csv', low_memory=False)

 

 

哈哈,大功告成!

 

相关文章
|
9月前
【echarts报错】line series not exists,should be same with series name or data name
【echarts报错】line series not exists,should be same with series name or data name
350 0
|
9月前
|
编解码 算法 Python
ImportError: cannot import name ‘_update_worker_pids’ from ‘torch._C’
ImportError: cannot import name ‘_update_worker_pids’ from ‘torch._C’
106 0
|
9月前
|
Scala
【已解决】Specifying keys via field positions is only valid for tuple data types. Type: GenericType<scala
【已解决】Specifying keys via field positions is only valid for tuple data types. Type: GenericType<scala
83 0
pd.set_option()参数详解
pd.set_option()参数详解
226 0
|
TensorFlow 算法框架/工具
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
299 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
|
编解码 搜索推荐 算法
Data-Data Objects and Attribute Types| 学习笔记
快速学习 Data-Data Objects and Attribute Types。
Data-Data Objects and Attribute Types| 学习笔记
|
Python
解决办法:RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96
解决办法:RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96
610 0
TypeError: ufunc subtract cannot use operands with types dtype('O') and dtype('M8[ns]')
TypeError: ufunc subtract cannot use operands with types dtype('O') and dtype('M8[ns]')
|
算法框架/工具 Windows
SAP WM 为Storage Type 004激活SUM报错 - Storage types without pick-point stor.type require partial pallet
SAP WM 为Storage Type 004激活SUM报错 - Storage types without pick-point stor.type require partial pallet
SAP WM 为Storage Type 004激活SUM报错 - Storage types without pick-point stor.type require partial pallet