Home > database >  Syntax Error when I enter a dictionary with multiple values as a DataFrame in Jupyter
Syntax Error when I enter a dictionary with multiple values as a DataFrame in Jupyter

Time:11-20

I'm getting a syntax error when I run this code in Jupyter. I've double and triple checked.

songs = {'Album':' ['thriller','Back','Moon'],
         'Released': [1998, 1976, 12000]}
         
songs_frame = pd.DataFrame(songs)

CodePudding user response:

You have an extra '. Change your code to this:

songs = {'Album': ['thriller', 'Back', 'Moon'], 'Released': [1998, 1976, 12000]}

songs_frame = pd.DataFrame(songs)
  • Related