0
I want to create dictionary data set but getting error
please solve this eeeor
3 Answers
+ 1
data={ "GOOGLE" : {"COMPANY" , "SHAREPRICE" : 276.38}
} ^
The program is getting hung up on the colon after "SHAREPRICE". It almost looks like data is trying to have a dictionary within a dictionary.
I believe what you're trying to do is this:
data={ "COMPANY" : "GOOGLE" , "SHAREPRICE" : 276.38}
I'm also not sure why you want your index to be the columns, but we live in a free country, so you do you.
0
import pandas as pd
data={ "GOOGLE" : {"COMPANY" , "SHAREPRICE" : 276.38}
}
columns=('COMPANY' , 'SHAREPRICE') df=pd.DataFrame(data , index=columns)
df
0
I'm getting syntax error