About 232 results: "import pandas repo:pydata/pandas"
Page 1 of 12
Filter Results
Sources
Languages
Filter Results
Try Search On













test_wb.py in pandas git://github.com/pydata/pandas.git | 56 lines | Python
  1. import nose
  2. 
                        
  3. import pandas
  4. from pandas.compat import u
  5. from pandas.util.testing import network
  6. from pandas.util.testing import assert_frame_equal
  7. from numpy.testing.decorators import slow
  8. from pandas.io.wb import search, download, get_countries
  9. import pandas.util.testing as tm
  10. 
                        
  11.         result = search('gdp.*capita.*constant').ix[:, :2]
  12.         expected = pandas.DataFrame(expected)
  13.         expected = {'GDPPCKN': {(u('United States'), u('2003')): u('40800.0735367688'), (u('Canada'), u('2004')): u('37857.1261134552'), (u('United States'), u('2005')): u('42714.8594790102'), (u('Canada'), u('2003')): u('37081.4575704003'), (u('United States'), u('2004')): u('41826.1728310667'), (u('Mexico'), u('2003')): u('72720.0691255285'), (u('Mexico'), u('2004')): u('74751.6003347038'), (u('Mexico'), u('2005')): u('76200.2154469437'), (u('Canada'), u('2005')): u('38617.4563629611')}, 'GDPPCKD': {(u('United States'), u('2003')): u('40800.0735367688'), (u('Canada'), u('2004')): u('34397.055116118'), (u('United States'), u('2005')): u('42714.8594790102'), (u('Canada'), u('2003')): u('33692.2812368928'), (u('United States'), u('2004')): u('41826.1728310667'), (u('Mexico'), u('2003')): u('7608.43848670658'), (u('Mexico'), u('2004')): u('7820.99026814334'), (u('Mexico'), u('2005')): u('7972.55364129367'), (u('Canada'), u('2005')): u('35087.8925933298')}}
  14.         expected = pandas.DataFrame(expected)
  15.         expected.index = result.index
  16.         assert_frame_equal(result, pandas.DataFrame(expected))







Back to Top