Using genfromtxt to import csv data with missing values in numpy

夙愿已清 提交于 2019-11-27 08:59:17

if you can ignore the 16 at the end of the file try using the

invalid_raise (bool, optional) parameter if set to False it ignores all incomplete lines without throwing an exception

see here (its the last parameter before the examples) http://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html

The command filling_values also helped me. I set it to zero. Thus each empty value is set to zero. It probably doesn't always make sense, but maybe it will help you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!