成功解决:The default dtype for empty Series will be ‘object‘ instead of ‘float64‘ in a future version.

在学习 pandas 时,想根据chunksize对文件进行逐块迭代,但是报错了:

成功解决:The default dtype for empty Series will be ‘object‘ instead of ‘float64‘ in a future version._第1张图片

 可以在创建 Series 时,加上如下的代码:

原代码:

tot = pd.Series([])

改为;

tot = pd.Series([], dtype='float64')

问题解决:

成功解决:The default dtype for empty Series will be ‘object‘ instead of ‘float64‘ in a future version._第2张图片

 

你可能感兴趣的:(python,开发语言,后端)