I’m looking at sensor data with pandas dataframes. The text file I have does not have an index field.
enter image description here
It starts with time data, but when I use this code to load data from a file into a pandas data frame,
dfSensordata = pd.read_csv(fileFolder + filename + ext, header=1, sep=',', index_col=False)
the first column, which was time data, changes to index data.
enter image description here
In brief,
I expeced dfSensordata to be like this:
Time | 1A [V] |
---|---|
time1 | data 1 |
time2 | data 1 |
but result was like this:
Index | Time | 1A [V] |
---|---|---|
time1 | data 1 | |
time2 | data 1 |
I also tried these codes, but they didn’t change anything.
pd.read_csv(column_index =0)
pd.read_csv(column_index =None)
pd.read_csv(column_index =False)
Could you help me figure out what to do?
Thank you,
Bokyung Seo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.