Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Trying to combine two data frames

I’m trying to combine two dataframes. This is my code:

x = df.loc[df['continent'] == 'South America']
y = df.loc[df['continent'] == 'North America']
Americas  =x + y
Americas

When this prints, it just gives back NaN values

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

By combining, if you meant appending; then try this… means daya y below data x;

Americas = pd.concat([x,y])
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading