I have a csv file that looks like this:
-0.08150654489363679, 0.3262445628643036, -0.1983973830938339, 0.04597456371557881
and I read the file as follows:
import pandas as pd
df=pd.read_csv(r'F:\Sheyenne\Statistics\IDL_stats\Basic_Stats\NDII\NDII_1984137_A_Annex.csv')
print df
which returns this:
Empty DataFrame
Columns: [-0.08150654489363679, 0.3262445628643036, -0.1983973830938339, 0.04597456371557881]
Index: []
I want to add column names to columns as follows:
df=pd.read_csv(r'F:\Sheyenne\Statistics\IDL_stats\Basic_Stats\NDII\NDII_1984137_A_Annex.csv')
df.columns=['Mean', 'Max', 'Min', 'Stdev']
print df
but when I do this, I get the following:
Empty DataFrame
Columns: [Mean, Max, Min, Stdev]
Index: []
My desired result:
Mean Max Min Stdev
-0.08150654489363679 0.3262445628643036 -0.1983973830938339 0.04597456371557881
Something funny happens when a dataframe is read, but I'm not sure what.
source
share