You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version 0.7.5, when reading in a CSV file that has numerical column names assigned by pandas, dask.dataframe.read_csv misinterprets the column names that have been assigned by pandas.
In particular, the column names (in the code sample ",0,1,2") given on the first row are interpreted as the first row of data by dask.dataframe.read_csv whereas they are correctly identified as column names by the pandas.read_csv method.
See the attached file for a minimal code sample that reproduces the error.
Sorry for leaving this for so long. It slipped down my e-mail.
I don't see an attached file.
The following is my experience:
In [1]: importpandasaspddfIn [2]: importnumpyasnpIn [3]: pd.DataFrame(np.random.random((10, 4))).to_csv('foo.csv')
In [4]: !catfoo.csv
,0,1,2,30,0.13431684284337342,0.28371864338584785,0.09408808481184705,0.45090637141368451,0.3628017386057968,0.5130729393279804,0.2575872885550655,0.030265209064559762,0.6613515196180496,0.04368417377557987,0.02645654556785726,0.07767081202319673,0.7957849970368974,0.9167022276900998,0.5903091867964598,0.74325888338063144,0.18098615421662856,0.9643215759266229,0.6904862552351742,0.57214087772188445,0.6010285891123545,0.3999564088456772,0.22616548958242277,0.83481763773385156,0.7634511108227137,0.3390152599050831,0.8113770724433769,0.246876327202349987,0.7449335432579999,0.18933549591859888,0.4551595642930776,0.70677602311106088,0.6667867411131122,0.42469493786906454,0.13576929024782391,0.253206114700114459,0.9611310794078418,0.968875650472187,0.712468515165838,0.1267005359114427In [5]: importdask.dataframeasddIn [6]: df=dd.read_csv('foo.csv', header=True)
/home/mrocklin/Software/anaconda/lib/python3.4/site-packages/pandas-0.17.0rc1+303.geb66bcc-py3.4-linux-x86_64.egg/pandas/io/common.pyin_validate_header_arg(header)
214def_validate_header_arg(header):
215ifisinstance(header, bool):
-->216raiseTypeError("Passing a bool to header is invalid. "217"Use header=None for no header or "218"header=int or list-like of ints to specify "TypeError: Passingabooltoheaderisinvalid. Useheader=Nonefornoheaderorheader=intorlist-likeofintstospecifytherow(s) makingupthecolumnnamesIn [7]: df=dd.read_csv('foo.csv', header=0)
In [8]: df.head()
Out[8]:
Unnamed: 00123000.1343170.2837190.0940880.450906110.3628020.5130730.2575870.030265220.6613520.0436840.0264570.077671330.7957850.9167020.5903090.743259440.1809860.9643220.6904860.572141
Activity
mrocklin commentedon Jan 22, 2016
Sorry for leaving this for so long. It slipped down my e-mail.
I don't see an attached file.
The following is my experience:
Does this workflow work for you?
mrocklin commentedon Apr 26, 2016
Closing until more information arrives.
Fix divisions for head (dask#878)