Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data_country1 = {'Country': [np.NaN, 'India', 'Brazil'],'Capital': [np.NaN, 'New Delhi', 'Brasília'],'Population': [np.NaN, 1303171035, 207847528]}
- df_country1 = pd.DataFrame(data_country1, columns=['Country', 'Capital', 'Population'])
- #df_country1 = df_country1.fillna(value=0)
- print(df_country1)
- data_country2= {'Country': ['Belgium', 'India', 'Brazil'],'Capital': ['Brussels', 'New Delhi', 'Brasília'],'Population': [102283932, 1303171035, 207847528]}
- df_country2 = pd.DataFrame(data_country2, columns=['Country', 'Capital', 'Population'])
- print(df_country2)
- Country Capital Population
- 0 NaN NaN NaN
- 1 India New Delhi 1.303171e+09
- 2 Brazil Brasília 2.078475e+08
- Country Capital Population
- 0 Belgium Brussels 102283932
- 1 India New Delhi 1303171035
- 2 Brazil Brasília 207847528
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement