我讀一個CSV文件和取值,numpy的
numpy.genfromtxt(csv_name, delimiter=',')
,但我不能這樣做,因爲我的CSV包含不同沒有對每行的列。
O/P:
ValueError: Some errors were detected
Line #2 (got 8 columns instead of 7)
Line #3 (got 8 columns instead of 7)
Line #4 (got 8 columns instead of 7)
Line #6 (got 8 columns instead of 7)
Line #7 (got 5 columns instead of 7)
Line #8 (got 5 columns instead of 7)
Line #9 (got 5 columns instead of 7)
Line #10 (got 5 columns instead of 7)
是否是可能的numpy的呢?
[導入CSV具有不同的每使用熊貓排列(可能的重複http://stackoverflow.com/questions/27020216/import-csv-with - 不同列數的每行使用熊貓) – elcombato
[可變重複的Python中的genfromtxt()中的列的變量?](http://stackoverflow.com/questions/19152432/variable-number -of-columns-in-genfromtxt-in-python) –