简体   繁体   中英

How to read CSV data in one column?

Input: csv file that has data present in a single column of the csv file.

Ex:

"ftre1   ftre2"
"123     145"

when I use:

pandas.read_csv(file)

I get:

ftre1/ftre2
123/145

Expected would be the usual DF format.

df = pd.read_csv('C:/d1', sep=' ', header=None)
print(df)

尝试这个:

pandas.read_csv(path, delim_whitespace=True)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM