My dataset CSV file is row-wise:
1,2,3,4
1000,2000,3000,4000
I want to read this file and get a dataframe output of two columns, 'index and value'.
Output:
index value
1 1000
2 2000
3 3000
If I want to get only the 'value' column, I should be able to retrieve them by doing df['value']
I tried going about it like this:
series = pd.read_csv('file.csv',index_col=0, header=0)
df= series.T
Frame=pd.DataFrame([df], columns = ["index","value"])
But this yields an error:
> ValueError: Shape of passed values is (1, 1), indices imply (2, 1)