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