0

For the following line of code:

Distance1= pd.Dataframe(columns=['Lat','Lon','PSC','SC_Avg_EcNo','SC_Avg_RSCP','MaxRSCP','MaxEcNo','count','PilotPollutionFlag'])

I got the error :

AttributeError: module 'pandas' has no attribute 'Dataframe'

I've seen similar questions like this and most of the answers were that either a file called 'pandas.py' is in the same directory as script, or that another variable called 'pd' is used in the program but that doesn't happen in my program so what is the problem ?

1
  • 3
    The attribute is actually pd.DataFrame! that's all Commented Feb 14, 2020 at 18:45

2 Answers 2

6

Typo, it should be DataFrame

                  ^

Note the letter 'F' has to be capitalized.

Sign up to request clarification or add additional context in comments.

Comments

0

import pandas as pd

df1= {
'Country':['india','USA','RUSSIA'], 'population':[140,30,15] }

df1 =pd.DataFrame(df1)

df2= {'Country':['india','USA','RUSSIA'], 'Capital':['Dlehi','London','Moscoe'] }

df1 =pd.DataFrame(df1)

df2=pd.DataFrame(df2)

pd.merge(df1,df2,how='left',on='Country')

Kindly take small example. Dataframe should properly written in capital.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.