In [ ]:
!pip3 install matplotlib

In [62]:
import pandas as pd

In [63]:
!pip3 install xlrd


Requirement already satisfied (use --upgrade to upgrade): xlrd in /Users/mercybenzaquen/.virtualenvs/Homework7/lib/python3.5/site-packages

In [64]:
df = pd.read_excel("richpeople.xlsx")

1)What country are most billionaires from? For the top ones, how many billionaires per billion people?


In [65]:
df.head(3)


Out[65]:
year name rank citizenship countrycode networthusbillion selfmade typeofwealth gender age ... relationshiptocompany foundingdate gdpcurrentus sourceofwealth notes notes2 source source_2 source_3 source_4
0 2001 A Jerrold Perenchio 151 United States USA 3.0 self-made executive male 70.0 ... former chairman and CEO 1955.0 1.062180e+13 NaN represented Marlon Brando and Elizabeth Taylor NaN http://en.wikipedia.org/wiki/Jerry_Perenchio http://www.forbes.com/profile/a-jerrold-perenc... COLUMN ONE; A Hollywood Player Who Owns the Ga... NaN
1 2014 A. Jerrold Perenchio 663 United States USA 2.6 self-made executive male 83.0 ... former chairman and CEO 1955.0 NaN television, Univision represented Marlon Brando and Elizabeth Taylor NaN http://en.wikipedia.org/wiki/Jerry_Perenchio http://www.forbes.com/profile/a-jerrold-perenc... COLUMN ONE; A Hollywood Player Who Owns the Ga... NaN
2 2001 Abdul Al Rahman Al Jeraisy 336 Saudi Arabia SAU 1.5 self-made founder non-finance male NaN ... founder 1956.0 1.830120e+11 NaN NaN NaN http://www.jeraisy.com.sa/index.php/pages/rend... NaN NaN NaN

3 rows × 30 columns


In [66]:
df.columns


Out[66]:
Index(['year', 'name', 'rank', 'citizenship', 'countrycode',
       'networthusbillion', 'selfmade', 'typeofwealth', 'gender', 'age',
       'industry', 'IndustryAggregates', 'region', 'north',
       'politicalconnection', 'founder', 'generationofinheritance', 'sector',
       'company', 'companytype', 'relationshiptocompany', 'foundingdate',
       'gdpcurrentus', 'sourceofwealth', 'notes', 'notes2', 'source',
       'source_2', 'source_3', 'source_4'],
      dtype='object')

In [67]:
recent = df[df['year']==2014]
recent.head()


Out[67]:
year name rank citizenship countrycode networthusbillion selfmade typeofwealth gender age ... relationshiptocompany foundingdate gdpcurrentus sourceofwealth notes notes2 source source_2 source_3 source_4
1 2014 A. Jerrold Perenchio 663 United States USA 2.6 self-made executive male 83.0 ... former chairman and CEO 1955.0 NaN television, Univision represented Marlon Brando and Elizabeth Taylor NaN http://en.wikipedia.org/wiki/Jerry_Perenchio http://www.forbes.com/profile/a-jerrold-perenc... COLUMN ONE; A Hollywood Player Who Owns the Ga... NaN
5 2014 Abdulla Al Futtaim 687 United Arab Emirates ARE 2.5 inherited inherited male NaN ... relation 1930.0 NaN auto dealers, investments company split between him and cousin in 2000 NaN http://en.wikipedia.org/wiki/Al-Futtaim_Group http://www.al-futtaim.ae/content/groupProfile.asp NaN NaN
6 2014 Abdulla bin Ahmad Al Ghurair 305 United Arab Emirates ARE 4.8 inherited inherited male NaN ... relation 1960.0 NaN diversified inherited from father NaN http://en.wikipedia.org/wiki/Al-Ghurair_Group http://www.alghurair.com/about-us/our-history NaN NaN
8 2014 Abdullah Al Rajhi 731 Saudi Arabia SAU 2.4 self-made self-made finance male NaN ... founder 1957.0 NaN banking NaN NaN http://en.wikipedia.org/wiki/Al-Rajhi_Bank http://www.alrajhibank.com.sa/ar/investor-rela... http://www.alrajhibank.com.sa/ar/about-us/page... NaN
9 2014 Abdulsamad Rabiu 1372 Nigeria NGA 1.2 self-made founder non-finance male 54.0 ... founder 1988.0 NaN sugar, flour, cement NaN NaN http://www.forbes.com/profile/abdulsamad-rabiu/ http://www.bloomberg.com/research/stocks/priva... NaN NaN

5 rows × 30 columns


In [68]:
df['citizenship'].value_counts().head(5)
#I am going to skip the second part of the question
#because we would have to create a new column with the number of people per country. Easier joining tables?


Out[68]:
United States    903
Germany          160
China            153
Russia           119
Japan             96
Name: citizenship, dtype: int64

2)Who are the top 10 richest billionaires?


In [69]:
recent.sort_values(by='rank').head(10)


Out[69]:
year name rank citizenship countrycode networthusbillion selfmade typeofwealth gender age ... relationshiptocompany foundingdate gdpcurrentus sourceofwealth notes notes2 source source_2 source_3 source_4
284 2014 Bill Gates 1 United States USA 76.0 self-made founder non-finance male 58.0 ... founder 1975.0 NaN Microsoft NaN NaN http://www.forbes.com/profile/bill-gates/ NaN NaN NaN
348 2014 Carlos Slim Helu 2 Mexico MEX 72.0 self-made privatized and resources male 74.0 ... founder 1990.0 NaN telecom NaN NaN http://www.ozy.com/provocateurs/carlos-slims-w... NaN NaN NaN
124 2014 Amancio Ortega 3 Spain ESP 64.0 self-made founder non-finance male 77.0 ... founder 1975.0 NaN retail NaN NaN http://www.forbes.com/profile/amancio-ortega/ NaN NaN NaN
2491 2014 Warren Buffett 4 United States USA 58.2 self-made founder non-finance male 83.0 ... founder 1839.0 NaN Berkshire Hathaway NaN NaN http://www.forbes.com/lists/2009/10/billionair... http://www.forbes.com/companies/berkshire-hath... NaN NaN
1377 2014 Larry Ellison 5 United States USA 48.0 self-made founder non-finance male 69.0 ... founder 1977.0 NaN Oracle NaN NaN http://www.forbes.com/profile/larry-ellison/ http://www.businessinsider.com/how-larry-ellis... NaN NaN
509 2014 David Koch 6 United States USA 40.0 inherited inherited male 73.0 ... relation 1940.0 NaN diversified inherited from father NaN http://www.kochind.com/About_Koch/History_Time... NaN NaN NaN
381 2014 Charles Koch 6 United States USA 40.0 inherited inherited male 78.0 ... relation 1940.0 NaN diversified inherited from father NaN http://www.kochind.com/About_Koch/History_Time... NaN NaN NaN
2185 2014 Sheldon Adelson 8 United States USA 38.0 self-made self-made finance male 80.0 ... founder 1952.0 NaN casinos NaN NaN http://www.forbes.com/profile/sheldon-adelson/ http://lasvegassun.com/news/1996/nov/26/rat-pa... NaN NaN
429 2014 Christy Walton 9 United States USA 36.7 inherited inherited female 59.0 ... relation 1962.0 NaN Wal-Mart widow NaN http://www.forbes.com/profile/christy-walton/ NaN NaN NaN
1128 2014 Jim Walton 10 United States USA 34.7 inherited inherited male 66.0 ... relation 1962.0 NaN Wal-Mart inherited from father NaN http://www.forbes.com/profile/jim-walton/ NaN NaN NaN

10 rows × 30 columns

3)What's the average wealth of a billionaire? Male? Female?


In [70]:
recent['networthusbillion'].describe()


Out[70]:
count    1653.000000
mean        3.904658
std         5.748520
min         1.000000
25%         1.400000
50%         2.100000
75%         3.700000
max        76.000000
Name: networthusbillion, dtype: float64

In [71]:
females = recent[recent['gender'] == 'female']
males = recent[recent['gender'] == 'male']

females['networthusbillion'].describe()


Out[71]:
count    180.000000
mean       3.920556
std        5.312604
min        1.000000
25%        1.400000
50%        2.300000
75%        3.700000
max       36.700000
Name: networthusbillion, dtype: float64

In [72]:
males['networthusbillion'].describe()


Out[72]:
count    1473.000000
mean        3.902716
std         5.801227
min         1.000000
25%         1.400000
50%         2.100000
75%         3.700000
max        76.000000
Name: networthusbillion, dtype: float64

4)Who is the poorest billionaire? Who are the top 10 poorest billionaires?


In [73]:
recent.sort_values(by='rank').tail(1)


Out[73]:
year name rank citizenship countrycode networthusbillion selfmade typeofwealth gender age ... relationshiptocompany foundingdate gdpcurrentus sourceofwealth notes notes2 source source_2 source_3 source_4
2203 2014 Shoji Uehara 1565 Japan JPN 1.0 inherited inherited male 86.0 ... relation 1912.0 NaN pharmaceuticals inherited from father NaN http://www.forbes.com/profile/shoji-uehara/# http://en.wikipedia.org/wiki/Taisho_Pharmaceut... NaN NaN

1 rows × 30 columns


In [74]:
recent.sort_values(by='rank').tail(10)


Out[74]:
year name rank citizenship countrycode networthusbillion selfmade typeofwealth gender age ... relationshiptocompany foundingdate gdpcurrentus sourceofwealth notes notes2 source source_2 source_3 source_4
748 2014 Fu Kwan 1565 China CHN 1.0 self-made self-made finance male 56.0 ... chairman 1990.0 NaN diversified NaN NaN http://www.forbes.com/profile/fu-kwan/ http://www.macrolink.com.cn/en/AboutBig.aspx NaN NaN
1755 2014 Nerijus Numavicius 1565 Lithuania LTU 1.0 self-made founder non-finance male 46.0 ... founder 1992.0 NaN retail, pharmacy NaN NaN http://en.wikipedia.org/wiki/VP_Group Shankill site hits a snag The Irish Times Marc... NaN NaN
2174 2014 Serhiy Tihipko 1565 Ukraine UKR 1.0 self-made self-made finance male 54.0 ... founder 1992.0 NaN banking, agriculture NaN NaN http://www.forbes.com/profile/serhiy-tihipko/ http://en.wikipedia.org/wiki/PrivatBank http://www.kyivpost.com/content/business/priva... NaN
1783 2014 O. Francis Biondi 1565 United States USA 1.0 self-made self-made finance male 49.0 ... founder 1995.0 NaN hedge fund NaN NaN http://www.forbes.com/profile/o-francis-biondi/ http://www.forbes.com/sites/nathanvardi/2014/0... NaN NaN
559 2014 Ding Shijia 1565 China CHN 1.0 self-made executive male 50.0 ... deputy chairman 1994.0 NaN shoes NaN NaN http://en.wikipedia.org/wiki/Anta_Sports http://en.wikipedia.org/wiki/Ding_Shijia http://www.bloomberg.com/research/stocks/peopl... NaN
560 2014 Ding Shizhong 1565 China CHN 1.0 self-made executive male 43.0 ... director 1966.0 NaN retail NaN NaN http://www.sce-re.com/en/about.asp http://www.forbes.com/profile/ding-shizhong/ NaN NaN
886 2014 Harindarpal Banga 1565 India IND 1.0 self-made privatized and resources male 63.0 ... Vice Chairman 1986.0 NaN commodities NaN NaN http://en.wikipedia.org/wiki/Noble_Group_Limited http://www.forbes.com/profile/harindarpal-banga/ NaN NaN
660 2014 Enrique Banuelos 1565 Spain ESP 1.0 self-made self-made finance male 48.0 ... founder 1982.0 NaN real estate NaN NaN http://en.wikipedia.org/wiki/Enrique_Ba%C3%B1u... http://www.forbes.com/lists/2010/10/billionair... NaN NaN
1720 2014 Monika Schoeller 1565 Germany DEU 1.0 inherited inherited female 75.0 ... relation 1948.0 NaN publishing inherited from father NaN http://www.forbes.com/profile/monika-schoeller/ NaN NaN NaN
2203 2014 Shoji Uehara 1565 Japan JPN 1.0 inherited inherited male 86.0 ... relation 1912.0 NaN pharmaceuticals inherited from father NaN http://www.forbes.com/profile/shoji-uehara/# http://en.wikipedia.org/wiki/Taisho_Pharmaceut... NaN NaN

10 rows × 30 columns

5)'What is relationship to company'? And what are the most common relationships?


In [75]:
recent['relationshiptocompany'].value_counts().head(10)


Out[75]:
founder                                 818
relation                                515
owner                                    79
chairman                                 64
investor                                 30
Chairman and Chief Executive Officer     15
ceo                                       8
CEO                                       8
president                                 8
Chairman                                  8
Name: relationshiptocompany, dtype: int64

6)Most common source of wealth? Male vs. female?


In [76]:
recent['sourceofwealth'].value_counts().head(10)


Out[76]:
real estate        107
diversified         69
retail              63
investments         60
pharmaceuticals     42
hedge funds         34
banking             33
construction        32
media               24
consumer goods      19
Name: sourceofwealth, dtype: int64

In [118]:
females = recent[recent['gender'] == 'female']
males = recent[recent['gender'] == 'male']

females['sourceofwealth'].value_counts().head(10)


Out[118]:
diversified            9
real estate            7
media                  6
hotels, investments    5
consumer goods         5
construction           5
chemicals              4
cleaning products      4
Wal-Mart               4
casinos                4
Name: sourceofwealth, dtype: int64

In [119]:
males['sourceofwealth'].value_counts().head(10)


Out[119]:
real estate        100
retail              60
diversified         60
investments         58
pharmaceuticals     40
hedge funds         34
banking             30
construction        27
software            18
media               18
Name: sourceofwealth, dtype: int64

9)What are the most common industries for billionaires to come from? What's the total amount of billionaire money from each industry?


In [77]:
recent['industry'].value_counts().head(10)


Out[77]:
Consumer                   291
Real Estate                190
Retail, Restaurant         174
Diversified financial      132
Technology-Computer        131
Money Management           122
Media                      104
Energy                      87
Non-consumer industrial     83
Technology-Medical          78
Name: industry, dtype: int64

In [78]:
recent.groupby('industry')['networthusbillion'].sum()


Out[78]:
industry
0                                     7.6
Constrution                         175.4
Consumer                           1177.8
Diversified financial               614.4
Energy                              340.5
Hedge funds                         167.2
Media                               490.5
Mining and metals                   240.6
Money Management                    381.3
Non-consumer industrial             298.4
Other                               179.3
Private equity/leveraged buyout      71.9
Real Estate                         573.8
Retail, Restaurant                  820.9
Technology-Computer                 684.6
Technology-Medical                  218.0
Venture Capital                      11.1
Name: networthusbillion, dtype: float64

10)How many self made billionaires vs. others?


In [79]:
recent['selfmade'].value_counts()


Out[79]:
self-made    1146
inherited     505
Name: selfmade, dtype: int64

11)How old are billionaires? How old are billionaires self made vs. non self made? or different industries?


In [80]:
billionaires_age = ['name', 'age']
recent[billionaires_age]


Out[80]:
name age
1 A. Jerrold Perenchio 83.0
5 Abdulla Al Futtaim NaN
6 Abdulla bin Ahmad Al Ghurair NaN
8 Abdullah Al Rajhi NaN
9 Abdulsamad Rabiu 54.0
12 Abigail Johnson 52.0
15 Abilio dos Santos Diniz 77.0
17 Achmad Hamami 83.0
18 Adi Godrej 71.0
23 Aerin Lauder Zinterhofer 44.0
25 Ahmet Calik 56.0
26 Ahmet Nazif Zorlu 69.0
27 Ahsen Ozokur 63.0
28 Airat Shaimiev 51.0
29 Ajay Kalsi 53.0
30 Ajay Piramal 58.0
34 Akio Nitori 70.0
37 Akira Mori 77.0
38 Alain Bouchard 64.0
39 Alain Merieux 76.0
40 Alain Taravella 66.0
43 Alain Wertheimer 65.0
45 Alan Gerry 84.0
46 Alan Howard 50.0
47 Alan Rydge 61.0
48 Albert Blokker 68.0
50 Albert Frere 88.0
51 Albert Shigaboutdinov 59.0
54 Albert von Thurn und Taxis 30.0
55 Albert Yeung 70.0
... ... ...
2584 Yuri Milner 52.0
2585 Yuriy Kosiuk 45.0
2586 Yusaku Maezawa 38.0
2587 Yusuf Hamied 77.0
2588 Yvonne Bauer 36.0
2589 Zadik Bino 70.0
2590 Zarakh Iliev 47.0
2591 Zdenek Bakala 53.0
2592 Zelimkhan Mutsoev 54.0
2593 Zhang Changhong 55.0
2594 Zhang Guiping 62.0
2595 Zhang Hongwei 59.0
2596 Zhang Jindong 50.0
2597 Zhang Li 61.0
2598 Zhang Shiping 67.0
2599 Zhang Xin 48.0
2600 Zhang Zhidong 42.0
2601 Zhang Zhirong 45.0
2602 Zhang Zhongneng 50.0
2603 Zhong Sheng Jian 56.0
2604 Zhou Chengjian 48.0
2605 Zhou Hongyi 43.0
2606 Zhu Gongshan 56.0
2607 Zhu Wenchen 48.0
2608 Zhu Xingliang 54.0
2609 Zhu Yicai 49.0
2610 Ziyad Manasir 48.0
2611 Ziyaudin Magomedov 45.0
2612 Zong Qinghou 68.0
2613 Zygmunt Solorz-Zak 57.0

1653 rows × 2 columns


In [81]:
recent.groupby('selfmade')['age'].describe()


/Users/mercybenzaquen/.virtualenvs/Homework7/lib/python3.5/site-packages/numpy/lib/function_base.py:3823: RuntimeWarning: Invalid value encountered in percentile
  RuntimeWarning)
Out[81]:
selfmade        
inherited  count     476.000000
           mean       64.962185
           std        13.174403
           min        24.000000
           25%              NaN
           50%              NaN
           75%              NaN
           max        98.000000
self-made  count    1112.000000
           mean       62.625899
           std        13.054631
           min        29.000000
           25%              NaN
           50%              NaN
           75%              NaN
           max        96.000000
Name: age, dtype: float64

In [82]:
recent.groupby('industry')['age'].describe()


/Users/mercybenzaquen/.virtualenvs/Homework7/lib/python3.5/site-packages/numpy/lib/function_base.py:3823: RuntimeWarning: Invalid value encountered in percentile
  RuntimeWarning)
Out[82]:
industry                    
0                      count      5.000000
                       mean      63.600000
                       std       14.170392
                       min       49.000000
                       25%             NaN
                       50%             NaN
                       75%             NaN
                       max       85.000000
Constrution            count     58.000000
                       mean      64.965517
                       std       14.234829
                       min       33.000000
                       25%             NaN
                       50%             NaN
                       75%             NaN
                       max       92.000000
Consumer               count    276.000000
                       mean      64.735507
                       std       12.952177
                       min       29.000000
                       25%             NaN
                       50%             NaN
                       75%             NaN
                       max       95.000000
Diversified financial  count    125.000000
                       mean      66.344000
                       std       13.209908
                       min       30.000000
                       25%             NaN
                       50%             NaN
                                   ...    
Retail, Restaurant     std       12.899621
                       min       41.000000
                       25%             NaN
                       50%             NaN
                       75%             NaN
                       max       96.000000
Technology-Computer    count    131.000000
                       mean      54.496183
                       std       12.777007
                       min       29.000000
                       25%       45.000000
                       50%       52.000000
                       75%       64.000000
                       max       85.000000
Technology-Medical     count     77.000000
                       mean      63.870130
                       std       11.134761
                       min       44.000000
                       25%             NaN
                       50%             NaN
                       75%             NaN
                       max       92.000000
Venture Capital        count      5.000000
                       mean      58.200000
                       std        2.949576
                       min       54.000000
                       25%       57.000000
                       50%       59.000000
                       75%       59.000000
                       max       62.000000
Name: age, dtype: float64

12)Who are the youngest billionaires? The oldest? Age distribution - maybe make a graph about it?


In [83]:
recent.sort_values('age', ascending=True).head(10)


Out[83]:
year name rank citizenship countrycode networthusbillion selfmade typeofwealth gender age ... relationshiptocompany foundingdate gdpcurrentus sourceofwealth notes notes2 source source_2 source_3 source_4
1838 2014 Perenna Kei 1284 Hong Kong HKG 1.3 inherited inherited female 24.0 ... relation 1996.0 NaN real estate inherited from father NaN http://en.wikipedia.org/wiki/Perenna_Kei http://www.loganestate.com/en/about.aspx?ftid=294 NaN NaN
605 2014 Dustin Moskovitz 202 United States USA 6.8 self-made founder non-finance male 29.0 ... founder 2004.0 NaN Facebook NaN NaN http://en.wikipedia.org/wiki/Dustin_Moskovitz http://www.forbes.com/profile/dustin-moskovitz/ https://www.facebook.com/facebook/info?tab=pag... NaN
1586 2014 Mark Zuckerberg 21 United States USA 28.5 self-made founder non-finance male 29.0 ... founder 2004.0 NaN Facebook NaN NaN http://www.forbes.com/profile/mark-zuckerberg/ NaN NaN NaN
189 2014 Anton Kathrein, Jr. 1270 Germany DEU 1.4 inherited inherited male 29.0 ... relation 1919.0 NaN antennas 3rd generation NaN http://www.forbes.com/profile/anton-kathrein-jr/# NaN NaN NaN
602 2014 Drew Houston 1372 United States USA 1.2 self-made founder non-finance male 30.0 ... founder 2007.0 NaN Dropbox NaN NaN http://en.wikipedia.org/wiki/Drew_Houston http://en.wikipedia.org/wiki/Dropbox_(service) http://www.forbes.com/profile/drew-houston/ NaN
54 2014 Albert von Thurn und Taxis 1092 Germany DEU 1.6 inherited inherited male 30.0 ... relation 1615.0 NaN diversified monopoly on postal service in germany, nationa... two older sisters, did not inherit title becau... http://en.wikipedia.org/wiki/Thurn_und_Taxis http://en.wikipedia.org/wiki/Albert,_12th_Prin... NaN NaN
618 2014 Eduardo Saverin 367 Brazil BRA 4.1 self-made founder non-finance male 31.0 ... founder 2004.0 NaN Facebook NaN NaN http://en.wikipedia.org/wiki/Eduardo_Saverin http://www.bloomberg.com/news/articles/2012-05... NaN NaN
2151 2014 Scott Duncan 215 United States USA 6.3 inherited inherited male 31.0 ... relation 1968.0 NaN pipelines inherited from father NaN http://en.wikipedia.org/wiki/Scott_Duncan_(bus... http://www.forbes.com/profile/dannine-avara/ NaN NaN
2559 2014 Yang Huiyan 196 China CHN 6.9 inherited inherited female 32.0 ... relation 1997.0 NaN real estate inherited from father NaN http://en.wikipedia.org/wiki/Yang_Huiyan NaN NaN NaN
1569 2014 Marie Besnier Beauvalot 642 France FRA 2.7 inherited inherited female 33.0 ... relation 1933.0 NaN cheese inherited from father oldest brother is CEO http://www.forbes.com/profile/emmanuel-besnier/ http://en.wikipedia.org/wiki/Lactalis NaN NaN

10 rows × 30 columns


In [84]:
df.sort_values('age', ascending=False).head(10)


Out[84]:
year name rank citizenship countrycode networthusbillion selfmade typeofwealth gender age ... relationshiptocompany foundingdate gdpcurrentus sourceofwealth notes notes2 source source_2 source_3 source_4
516 2014 David Rockefeller, Sr. 580 United States USA 2.9 inherited inherited male 98.0 ... relation 1870.0 NaN oil, banking family made most of fortune in the late 19th a... NaN http://en.wikipedia.org/wiki/David_Rockefeller http://en.wikipedia.org/wiki/Standard_Oil http://en.wikipedia.org/wiki/Rockefeller_family NaN
1277 2014 Karl Wlaschek 305 Austria AUT 4.8 self-made founder non-finance male 96.0 ... founder 1953.0 NaN retail NaN NaN http://en.wikipedia.org/wiki/BILLA http://en.wikipedia.org/wiki/Karl_Wlaschek https://www.billa.at/Footer_Nav_Seiten/Geschic... NaN
1328 2014 Kirk Kerkorian 328 United States USA 4.5 self-made self-made finance male 96.0 ... investor 1924.0 NaN casinos, investments purchased in 1969 NaN http://en.wikipedia.org/wiki/Kirk_Kerkorian http://www.forbes.com/profile/kirk-kerkorian/ PROFILE: Las Vegas billionaire amassed his wea... NaN
921 2014 Henry Hillman 687 United States USA 2.5 inherited inherited male 95.0 ... relation 1942.0 NaN investments inherited from father NaN http://www.forbes.com/profile/henry-hillman/ http://en.wikipedia.org/wiki/Calgon_Carbon NaN NaN
666 2014 Erika Pohl-Stroher 1154 Germany DEU 1.5 inherited inherited female 95.0 ... relation 1880.0 NaN hair products 3rd generation 23% stake in the company http://www.forbes.com/profile/erika-pohl-stroher/ http://en.wikipedia.org/wiki/Wella NaN NaN
1275 2014 Karl Albrecht 23 Germany DEU 25.0 self-made executive male 94.0 ... relation 1914.0 NaN retail (split from Aldi Nord in 1966, but both branch... took over mother's single grocerty store http://en.wikipedia.org/wiki/Karl_Albrecht http://www.bloomberg.com/news/articles/2014-07... http://aldiuscareers.com/about-aldi/history NaN
181 2014 Anne Cox Chambers 58 United States USA 15.5 inherited inherited female 94.0 ... relation 1898.0 NaN media inherited from brother NaN http://en.wikipedia.org/wiki/Anne_Cox_Chambers http://www.forbes.com/lists/2010/10/billionair... http://www.nytimes.com/2007/05/30/business/med... NaN
2292 2014 Sulaiman Al Rajhi 931 Saudi Arabia SAU 1.9 self-made self-made finance male 94.0 ... founder 1957.0 NaN banking NaN NaN http://en.wikipedia.org/wiki/Al-Rajhi_Bank http://www.alrajhibank.com.sa/ar/investor-rela... http://www.alrajhibank.com.sa/ar/about-us/page... NaN
2530 2014 William Moncrief, Jr. 1565 United States USA 1.0 inherited inherited male 93.0 ... relation 1929.0 NaN oil joined father's business following WWII NaN http://en.wikipedia.org/wiki/William_Moncrief http://www.moncriefoil.com/history.htm NaN NaN
119 2014 Aloysio de Andrade Faria 483 Brazil BRA 3.3 inherited inherited male 93.0 ... relation 1925.0 NaN banking inherited from father NaN http://en.wikipedia.org/wiki/Aloysio_de_Andrad... http://en.wikipedia.org/wiki/Banco_da_Lavoura_... http://www.forbes.com/profile/aloysio-de-andra... NaN

10 rows × 30 columns


In [85]:
import matplotlib.pyplot as plt

In [86]:
%matplotlib inline

In [47]:
import matplotlib.pyplot as plt
plt.style.available


Out[47]:
['seaborn-whitegrid',
 'seaborn-colorblind',
 'seaborn-bright',
 'grayscale',
 'ggplot',
 'seaborn-pastel',
 'seaborn-poster',
 'seaborn-muted',
 'seaborn-talk',
 'seaborn-deep',
 'seaborn-ticks',
 'dark_background',
 'seaborn-notebook',
 'bmh',
 'seaborn-white',
 'seaborn-dark',
 'seaborn-paper',
 'classic',
 'fivethirtyeight',
 'seaborn-dark-palette',
 'seaborn-darkgrid']

In [68]:
plt.style.use('dark_background')
young_age_ordered = recent.sort_values('age', ascending=True).head(10)
young_age_ordered.plot(kind='scatter', x='age', y='networthusbillion')
#oops misread instructions


Out[68]:
<matplotlib.axes._subplots.AxesSubplot at 0x1193185c0>

In [69]:
old_age_ordered = recent.sort_values('age', ascending=False).head(10)
old_age_ordered.plot(kind='scatter', x='age', y='networthusbillion')

#oops misread instructions


Out[69]:
<matplotlib.axes._subplots.AxesSubplot at 0x11ac2fe10>

In [70]:
plt.style.use('seaborn-bright')
age_distribution = recent['age'].value_counts()
age_distribution.describe()
age_distribution.head(30).plot(kind='bar', x='', y='') #i am not sure how to comple x,y fields in this case


Out[70]:
<matplotlib.axes._subplots.AxesSubplot at 0x1197a5cf8>

Maybe just made a graph about how wealthy they are in general?


In [72]:
recent.plot(kind='bar', x='name', y='networthusbillion')
#I know this is awful but looks cool lol


Out[72]:
<matplotlib.axes._subplots.AxesSubplot at 0x11b042b38>

In [65]:
ordered_by_wealth = recent.sort_values('networthusbillion', ascending=False)
ordered_by_wealth.head(30).plot(kind='bar', x='rank', y='networthusbillion', color=['g'])


Out[65]:
<matplotlib.axes._subplots.AxesSubplot at 0x1181fae80>

Maybe plot their net worth vs age (scatterplot)


In [66]:
recent.plot(kind='scatter', x='age', y='networthusbillion')


Out[66]:
<matplotlib.axes._subplots.AxesSubplot at 0x118c26da0>

Make a bar graph of the top 10 or 20 richest


In [67]:
top_10 = recent.sort_values(by='networthusbillion', ascending=False).head(10)

top_10.plot(kind='barh', x='name', y='networthusbillion', color="r")


Out[67]:
<matplotlib.axes._subplots.AxesSubplot at 0x1190c6588>

In [ ]:


In [ ]: