成功解决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)

 

 

哈哈,大功告成!

 

相关文章
|
5月前
【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
140 0
|
5月前
Transparent Data Encryption Data Dynamic and Data Dictionary Views You can query a set of dynamic and data dictionary views to find more information about Transparent Data Encryption (TDE) data.
Transparent Data Encryption Data Dynamic and Data Dictionary Views You can query a set of dynamic and data dictionary views to find more information about Transparent Data Encryption (TDE) data.
45 2
|
5月前
|
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
54 0
|
11月前
pd.set_option()参数详解
pd.set_option()参数详解
129 0
|
TensorFlow 算法框架/工具
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
260 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
|
编解码 搜索推荐 算法
Data-Data Objects and Attribute Types| 学习笔记
快速学习 Data-Data Objects and Attribute Types。
174 0
Data-Data Objects and Attribute Types| 学习笔记
TestRange.cs error CS0104: `Range' is an ambiguous reference between `System.Range' and Gtk.Range
TestRange.cs error CS0104: `Range' is an ambiguous reference between `System.Range' and Gtk.Range
175 0
Could not find an NgModule. Use the skip-import option to skip importing in
该错误消息意思是创建Component时未指定其属于哪一个module,因此先用命令行ng g m parent创建一个名为parent的module:
Could not find an NgModule. Use the skip-import option to skip importing in
成功解决h5py\_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to
成功解决h5py\_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to
成功解决h5py\_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to