Df = pd.DataFrame({'mass': mass,'daimeter': diameter})

I am facing problem , in week 10 , video 2 , we were shown by Pratyush sir , on how to create DataFrame using
two Series Object , below is the Series object i have not shown mass here but i have defined as shown in video
but on creating the data frame i am getting error on collab as name error , even though i have defined diameter
please guide me.

daimeter = pd.Series([4879,12104,12756,3475,6792,142984,120536,51118,49528,2370],

            index = ['Mercury','Venus','Earth','Moon','Mars','Jupiter','Saturn','Uranus','Neptune','Pluto'])

df = pd.DataFrame({‘mass’: mass,‘daimeter’: diameter})

NameError Traceback (most recent call last)
in ()
----> 1 df = pd.DataFrame({‘mass’: mass,‘daimeter’: diameter})

NameError: name ‘diameter’ is not defined

Spelling mistake:
daimeter -> diameter

1 Like

Thanks Sir, now it’s working