Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. data_country1 = {'Country': [np.NaN, 'India', 'Brazil'],'Capital': [np.NaN, 'New Delhi', 'Brasília'],'Population': [np.NaN, 1303171035, 207847528]}
  2. df_country1 = pd.DataFrame(data_country1, columns=['Country', 'Capital', 'Population'])
  3. #df_country1 = df_country1.fillna(value=0)
  4. print(df_country1)
  5.  
  6. data_country2= {'Country': ['Belgium', 'India', 'Brazil'],'Capital': ['Brussels', 'New Delhi', 'Brasília'],'Population': [102283932, 1303171035, 207847528]}
  7. df_country2 = pd.DataFrame(data_country2, columns=['Country', 'Capital', 'Population'])
  8. print(df_country2)
  9.  
  10. Country Capital Population
  11. 0 NaN NaN NaN
  12. 1 India New Delhi 1.303171e+09
  13. 2 Brazil Brasília 2.078475e+08
  14.  
  15. Country Capital Population
  16. 0 Belgium Brussels 102283932
  17. 1 India New Delhi 1303171035
  18. 2 Brazil Brasília 207847528
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement