“With data collection, ‘the sooner the better’ is always the best answer.” — Marissa Mayer |
Video:
Code:
taudata Analytics
EDA-00: Import/Loading Data
https://taudata.blogspot.com/2022/05/eda-00.html
Video Penjelasan: https://www.youtube.com/c/taudataAnalytics
Import-Loading Data CSV / Excel Data via Pandas ¶
In [2]:
import pandas as pd
In [4]:
file_ = 'data/price.csv'
try: # Running Locally, yakinkan "file_" berada di folder "data"
price = pd.read_csv(file_, low_memory = False, encoding='utf8')
except: # Running in Google Colab
!mkdir data
!wget -P data/ https://raw.githubusercontent.com/taudata-indonesia/eLearning/master/data/price.csv
price = pd.read_csv(file_, low_memory = False, encoding='utf8')
N, P = price.shape # Ukuran Data
print('baris = ', N, ', Kolom (jumlah variabel) = ', P)
print("Tipe Variabe df = ", type(price))
price
baris = 936 , Kolom (jumlah variabel) = 10 Tipe Variabe df = <class 'pandas.core.frame.DataFrame'>
Out[4]:
Observation | Dist_Taxi | Dist_Market | Dist_Hospital | Carpet | Builtup | Parking | City_Category | Rainfall | House_Price | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 9796.0 | 5250.0 | 10703.0 | 1659.0 | 1961.0 | Open | CAT B | 530 | 6649000 |
1 | 2 | 8294.0 | 8186.0 | 12694.0 | 1461.0 | 1752.0 | Not Provided | CAT B | 210 | 3982000 |
2 | 3 | 11001.0 | 14399.0 | 16991.0 | 1340.0 | 1609.0 | Not Provided | CAT A | 720 | 5401000 |
3 | 4 | 8301.0 | 11188.0 | 12289.0 | 1451.0 | 1748.0 | Covered | CAT B | 620 | 5373000 |
4 | 5 | 10510.0 | 12629.0 | 13921.0 | 1770.0 | 2111.0 | Not Provided | CAT B | 450 | 4662000 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
931 | 932 | 9297.0 | 12537.0 | 14418.0 | 1174.0 | 1429.0 | Covered | CAT C | 1110 | 5434000 |
932 | 933 | 10915.0 | 17486.0 | 15964.0 | 1549.0 | 1851.0 | Not Provided | CAT C | 1220 | 7062000 |
933 | 934 | 9205.0 | 10418.0 | 14496.0 | 1118.0 | 1337.0 | Open | CAT A | 560 | 7227000 |
934 | 935 | 10915.0 | 17486.0 | 15964.0 | 1549.0 | 1851.0 | Not Provided | CAT C | 1220 | 7062000 |
935 | 936 | 10915.0 | 17486.0 | 15964.0 | 1549.0 | 1851.0 | Not Provided | CAT C | 1220 | 7062000 |
936 rows × 10 columns
Bagaimana dengan File Excel? ¶
Karena deprecated support, maka harus install module "openpyxl" terlebih dahulu¶
- Importing Excel file https://pandas.pydata.org/docs/reference/api/pandas.read_excel.html
- openpyxl https://openpyxl.readthedocs.io/en/stable/
In [ ]:
# Ingat module 02, jika anda menjalankan Jupyter notebook ini secara lokal, maka perlu penyesuaian
!pip install openpyxl
In [5]:
file_ = 'data/price.xlsx'
try: # Running Locally
xl = pd.ExcelFile(file_, engine = 'openpyxl')
except: # Running in Google Colab
!mkdir data
!wget -P data/ https://raw.githubusercontent.com/taudata-indonesia/eLearning/master/{file_}
xl = pd.ExcelFile(file_, engine = 'openpyxl')
sheets_ = xl.sheet_names
print(sheets_)
price = xl.parse(sheets_[0], header=0) #biasakan tidak menulis nama sheet secara langsung
N, P = price.shape # Ukuran Data
print('baris = ', N, ', Kolom (jumlah variabel) = ', P)
print("Tipe Variabe df = ", type(price))
price
['price1', 'price2'] baris = 936 , Kolom (jumlah variabel) = 10 Tipe Variabe df = <class 'pandas.core.frame.DataFrame'>
Out[5]:
Observation | Dist_Taxi | Dist_Market | Dist_Hospital | Carpet | Builtup | Parking | City_Category | Rainfall | House_Price | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 9796.0 | 5250.0 | 10703.0 | 1659.0 | 1961.0 | Open | CAT B | 530 | 6649000 |
1 | 2 | 8294.0 | 8186.0 | 12694.0 | 1461.0 | 1752.0 | Not Provided | CAT B | 210 | 3982000 |
2 | 3 | 11001.0 | 14399.0 | 16991.0 | 1340.0 | 1609.0 | Not Provided | CAT A | 720 | 5401000 |
3 | 4 | 8301.0 | 11188.0 | 12289.0 | 1451.0 | 1748.0 | Covered | CAT B | 620 | 5373000 |
4 | 5 | 10510.0 | 12629.0 | 13921.0 | 1770.0 | 2111.0 | Not Provided | CAT B | 450 | 4662000 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
931 | 932 | 9297.0 | 12537.0 | 14418.0 | 1174.0 | 1429.0 | Covered | CAT C | 1110 | 5434000 |
932 | 933 | 10915.0 | 17486.0 | 15964.0 | 1549.0 | 1851.0 | Not Provided | CAT C | 1220 | 7062000 |
933 | 934 | 9205.0 | 10418.0 | 14496.0 | 1118.0 | 1337.0 | Open | CAT A | 560 | 7227000 |
934 | 935 | 10915.0 | 17486.0 | 15964.0 | 1549.0 | 1851.0 | Not Provided | CAT C | 1220 | 7062000 |
935 | 936 | 10915.0 | 17486.0 | 15964.0 | 1549.0 | 1851.0 | Not Provided | CAT C | 1220 | 7062000 |
936 rows × 10 columns
Import-Loading Data MySQL via Pandas ¶
MySQL XAMPP ¶
- https://www.apachefriends.org/download.html
- http://localhost/phpmyadmin/index.php (setelah menjalankan PHP & MySQL dari XAMPP)
- https://taudata.blogspot.com/2020/04/dfds-01.html
In [6]:
import mysql.connector as sql
In [23]:
db = 'taudataid'
user = 'root'
paswd = ''
host = 'localhost'
In [24]:
conn = sql.connect(db=db,user=user,host=host,password=paswd,use_unicode=True, charset= "utf8", auth_plugin= "mysql_native_password")
In [25]:
df = pd.read_sql('SELECT * FROM kodepos', con=conn)
print(df.shape)
df.head()
(81267, 8)
Out[25]:
id_ | province | city | district | urban | postal_code | lat | lon | |
---|---|---|---|---|---|---|---|---|
0 | 1 | province | city | district | urban | 0 | 0.0 | 0.0 |
1 | 2 | Bali | Badung | Kuta Selatan | Ungasan | 80361 | 0.0 | 0.0 |
2 | 3 | Bali | Badung | Kuta | Tuban | 80361 | 0.0 | 0.0 |
3 | 4 | Bali | Badung | Kuta Utara | Tibubeneng | 80361 | 0.0 | 0.0 |
4 | 5 | Bali | Badung | Kuta Selatan | Tanjung Benoa | 80361 | 0.0 | 0.0 |
In [16]:
url = 'https://en.wikipedia.org/wiki/The_World%27s_Billionaires'
df_list = pd.read_html(url) # Hati-hati ini List!
print(len(df_list))
df_list
44
Out[16]:
[ 0 \ 0 List of the world's billionaires, ranked in or... 1 The net worth of the world's billionaires incr... 2 Publication details 3 Publisher 4 Publication 5 First published 6 Latest publication 7 Current list details (2021)[2] 8 Wealthiest 9 Net worth (1st) 10 Number of billionaires 11 Total list net worth value 12 New members to the list 13 Forbes: The World's Billionaires website 1 0 List of the world's billionaires, ranked in or... 1 The net worth of the world's billionaires incr... 2 Publication details 3 Whale Media InvestmentsForbes family 4 Forbes 5 March 1987[1] 6 April 6, 2021 7 Current list details (2021)[2] 8 Elon Musk 9 US$201 billion 10 2755 11 US$13.1 trillion 12 493 13 Forbes: The World's Billionaires website , Icon Description 0 NaN Has not changed from the previous ranking. 1 NaN Has increased from the previous ranking. 2 NaN Has decreased from the previous ranking., No. Name Net worth (USD) Age Nationality \ 0 1 Jeff Bezos $177 billion 57 United States 1 2 Elon Musk $151 billion 49 United States 2 3 Bernard Arnault & family $150 billion 72 France 3 4 Bill Gates $124 billion 65 United States 4 5 Mark Zuckerberg $97 billion 36 United States 5 6 Warren Buffett $96 billion 90 United States 6 7 Larry Ellison $93 billion 76 United States 7 8 Larry Page $91.5 billion 48 United States 8 9 Sergey Brin $89 billion 47 United States 9 10 Mukesh Ambani $84.5 billion 63 India Source(s) of wealth 0 Amazon 1 Tesla, SpaceX 2 LVMH 3 Microsoft 4 Facebook, Inc. 5 Berkshire Hathaway 6 Oracle Corporation 7 Alphabet Inc. 8 Alphabet Inc. 9 Reliance Industries , No. Name Net worth (USD) Age Nationality \ 0 1 Jeff Bezos $113 billion 56 United States 1 2 Bill Gates $98 billion 64 United States 2 3 Bernard Arnault & family $76 billion 71 France 3 4 Warren Buffett $67.5 billion 89 United States 4 5 Larry Ellison $59 billion 75 United States 5 6 Amancio Ortega $55.1 billion 84 Spain 6 7 Mark Zuckerberg $54.7 billion 35 United States 7 8 Jim Walton $54.6 billion 71 United States 8 9 Alice Walton $54.4 billion 70 United States 9 10 S. Robson Walton $54.1 billion 77 United States Source(s) of wealth 0 Amazon 1 Microsoft 2 LVMH 3 Berkshire Hathaway 4 Oracle Corporation 5 Inditex, Zara 6 Facebook, Inc. 7 Walmart 8 Walmart 9 Walmart , No. Name Net worth (USD) Age Nationality \ 0 1 Jeff Bezos $131 billion 55 United States 1 2 Bill Gates $96.5 billion 63 United States 2 3 Warren Buffett $82.5 billion 88 United States 3 4 Bernard Arnault $76 billion 70 France 4 5 Carlos Slim $64 billion 79 Mexico 5 6 Amancio Ortega $62.7 billion 82 Spain 6 7 Larry Ellison $62.5 billion 74 United States 7 8 Mark Zuckerberg $62.3 billion 34 United States 8 9 Michael Bloomberg $55.5 billion 77 United States 9 10 Larry Page $50.8 billion 45 United States Source(s) of wealth 0 Amazon 1 Microsoft 2 Berkshire Hathaway 3 LVMH 4 América Móvil, Grupo Carso 5 Inditex, Zara 6 Oracle Corporation 7 Facebook, Inc. 8 Bloomberg L.P. 9 Alphabet Inc. , No. Name Net worth (USD) Age Nationality \ 0 1 Jeff Bezos $112 billion 54 United States 1 2 Bill Gates $90 billion 62 United States 2 3 Warren Buffett $84 billion 87 United States 3 4 Bernard Arnault $72 billion 69 France 4 5 Mark Zuckerberg $71 billion 33 United States 5 6 Amancio Ortega $70 billion 81 Spain 6 7 Carlos Slim $67.1 billion 78 Mexico 7 8 Charles Koch $60 billion 82 United States 8 8 David Koch $60 billion 77 United States 9 10 Larry Ellison $58.5 billion 73 United States Source(s) of wealth 0 Amazon 1 Microsoft 2 Berkshire Hathaway 3 LVMH 4 Facebook, Inc. 5 Inditex, Zara 6 América Móvil, Grupo Carso 7 Koch Industries 8 Koch Industries 9 Oracle Corporation , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $86.0 billion 61 United States 1 2 Warren Buffett $75.6 billion 86 United States 2 3 Jeff Bezos $72.8 billion 53 United States 3 4 Amancio Ortega $71.3 billion 80 Spain 4 5 Mark Zuckerberg $56.0 billion 32 United States 5 6 Carlos Slim $54.5 billion 77 Mexico 6 7 Larry Ellison $52.2 billion 72 United States 7 8 Charles Koch $48.3 billion 81 United States 8 8 David Koch $48.3 billion 76 United States 9 10 Michael Bloomberg $47.5 billion 75 United States Source(s) of wealth 0 Microsoft 1 Berkshire Hathaway 2 Amazon 3 Inditex, Zara 4 Facebook, Inc. 5 América Móvil, Grupo Carso 6 Oracle Corporation 7 Koch Industries 8 Koch Industries 9 Bloomberg L.P. , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $75.0 billion 60 United States 1 2 Amancio Ortega $67.0 billion 79 Spain 2 3 Warren Buffett $60.8 billion 85 United States 3 4 Carlos Slim $50.0 billion 76 Mexico 4 5 Jeff Bezos $45.2 billion 52 United States 5 6 Mark Zuckerberg $44.6 billion 31 United States 6 7 Larry Ellison $43.6 billion 71 United States 7 8 Michael Bloomberg $40.0 billion 74 United States 8 9 Charles Koch $39.6 billion 80 United States 9 9 David Koch $39.6 billion 75 United States Source(s) of wealth 0 Microsoft 1 Inditex 2 Berkshire Hathaway 3 América Móvil, Grupo Carso 4 Amazon 5 Facebook, Inc. 6 Oracle Corporation 7 Bloomberg L.P. 8 Koch Industries 9 Koch Industries , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $79.2 billion 59 United States 1 2 Carlos Slim $77.1 billion 75 Mexico 2 3 Warren Buffett $72.7 billion 84 United States 3 4 Amancio Ortega $64.5 billion 78 Spain 4 5 Larry Ellison $54.3 billion 70 United States 5 6 Charles Koch $42.9 billion 79 United States 6 6 David Koch $42.9 billion 74 United States 7 8 Christy Walton $41.7 billion 66 United States 8 9 Jim Walton $40.6 billion 66 United States 9 10 Liliane Bettencourt $40.1 billion 92 France Source(s) of wealth 0 Microsoft 1 América Móvil, Grupo Carso 2 Berkshire Hathaway 3 Inditex 4 Oracle Corporation 5 Koch Industries 6 Koch Industries 7 Walmart 8 Walmart 9 L'Oreal , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $76.0 billion 58 United States 1 2 Carlos Slim & family $72.0 billion 74 Mexico 2 3 Amancio Ortega $64.0 billion 77 Spain 3 4 Warren Buffett $58.2 billion 83 United States 4 5 Larry Ellison $48.0 billion 70 United States 5 6 Charles Koch $40.0 billion 78 United States 6 6 David Koch $40.0 billion 73 United States 7 8 Sheldon Adelson $38.0 billion 80 United States 8 9 Christy Walton & family $36.7 billion 65 United States 9 10 Jim Walton $34.7 billion 65 United States Source(s) of wealth 0 Microsoft 1 América Móvil, Grupo Carso 2 Inditex 3 Berkshire Hathaway 4 Oracle Corporation 5 Koch Industries 6 Koch Industries 7 Las Vegas Sands 8 Walmart 9 Walmart , No. Name Net worth (USD) Age Nationality \ 0 1 Carlos Slim & family $73.0 billion 73 Mexico 1 2 Bill Gates $67.0 billion 57 United States 2 3 Amancio Ortega $57.0 billion 76 Spain 3 4 Warren Buffett $53.5 billion 82 United States 4 5 Larry Ellison $43.0 billion 68 United States 5 6 Charles Koch $34.0 billion 77 United States 6 6 David Koch $34.0 billion 72 United States 7 8 Li Ka-shing $31.0 billion 84 Hong Kong 8 9 Liliane Bettencourt & family $30.0 billion 90 France 9 10 Bernard Arnault $29.0 billion 63 France Source(s) of wealth 0 América Móvil, Grupo Carso 1 Microsoft 2 Inditex Group 3 Berkshire Hathaway 4 Oracle Corporation 5 Koch Industries 6 Koch Industries 7 Cheung Kong Holdings 8 L'Oréal 9 LVMH , No. Name Net worth (USD) Age Nationality \ 0 1 Carlos Slim & family $69.0 billion 72 Mexico 1 2 Bill Gates $61.0 billion 56 United States 2 3 Warren Buffett $44.0 billion 81 United States 3 4 Bernard Arnault $41.0 billion 63 France 4 5 Amancio Ortega $37.5 billion 75 Spain 5 6 Larry Ellison $36.0 billion 67 United States 6 7 Eike Batista $30.0 billion 55 Brazil 7 8 Stefan Persson $26.0 billion 64 Sweden 8 9 Li Ka-shing $25.5 billion 83 Hong Kong 9 10 Karl Albrecht $25.4 billion 92 Germany Source(s) of wealth 0 América Móvil, Grupo Carso 1 Microsoft 2 Berkshire Hathaway 3 LVMH Moët Hennessy • Louis Vuitton 4 Inditex Group 5 Oracle Corporation 6 EBX Group 7 H&M 8 Cheung Kong Holdings 9 Aldi , No. Name Net worth (USD) Age Nationality \ 0 1 Carlos Slim & family $74.0 billion 71 Mexico 1 2 Bill Gates $56.0 billion 55 United States 2 3 Warren Buffett $50.0 billion 80 United States 3 4 Bernard Arnault $41.0 billion 62 France 4 5 Larry Ellison $39.5 billion 66 United States 5 6 Lakshmi Mittal $31.1 billion 60 India 6 7 Amancio Ortega $31.0 billion 74 Spain 7 8 Eike Batista $30.0 billion 53 Brazil 8 9 Mukesh Ambani $27.0 billion 54 India 9 10 Christy Walton & family $26.5 billion 62 United States Source(s) of wealth 0 América Móvil, Grupo Carso 1 Microsoft 2 Berkshire Hathaway 3 LVMH Moët Hennessy • Louis Vuitton 4 Oracle Corporation 5 Arcelor Mittal 6 Inditex Group 7 EBX Group 8 Reliance Industries 9 Walmart , No. Name Net worth (USD) Age Nationality \ 0 1 Carlos Slim & family $53.5 billion 70 Mexico 1 2 Bill Gates $53.0 billion 54 United States 2 3 Warren Buffett $47.0 billion 79 United States 3 4 Mukesh Ambani $29.0 billion 53 India 4 5 Lakshmi Mittal $28.7 billion 60 India 5 6 Larry Ellison $28.0 billion 66 United States 6 7 Bernard Arnault $27.5 billion 61 France 7 8 Eike Batista $27.0 billion 53 Brazil 8 9 Amancio Ortega $25.0 billion 74 Spain 9 10 Karl Albrecht $23.5 billion 90 Germany Source(s) of wealth 0 América Móvil, Grupo Carso 1 Microsoft 2 Berkshire Hathaway 3 Reliance Industries 4 Arcelor Mittal 5 Oracle Corporation 6 LVMH Moët Hennessy • Louis Vuitton 7 EBX Group 8 Inditex Group 9 Aldi Süd , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $40.0 billion 53 United States 1 2 Warren Buffett $37.0 billion 78 United States 2 3 Carlos Slim $35.0 billion 69 Mexico 3 4 Larry Ellison $22.5 billion 64 United States 4 5 Ingvar Kamprad $22.0 billion 83 Sweden 5 6 Karl Albrecht $21.5 billion 89 Germany 6 7 Mukesh Ambani $19.5 billion 52 India 7 8 Lakshmi Mittal $19.3 billion 58 India 8 9 Theo Albrecht $18.8 billion 87 Germany 9 10 Amancio Ortega $18.3 billion 73 Spain Source(s) of wealth 0 Microsoft 1 Berkshire Hathaway 2 América Móvil, Grupo Carso 3 Oracle Corporation 4 IKEA 5 Aldi Süd 6 Reliance Industries 7 Arcelor Mittal 8 Aldi Nord, Trader Joe's 9 Inditex Group , No. Name Net worth (USD) Age Nationality \ 0 1 Warren Buffett $62.0 billion 77 United States 1 2 Carlos Slim $60.0 billion 68 Mexico 2 3 Bill Gates $58.0 billion 52 United States 3 4 Lakshmi Mittal $45.0 billion 57 India 4 5 Mukesh Ambani $43.0 billion 51 India 5 6 Anil Ambani $42.0 billion 48 India 6 7 Ingvar Kamprad $31.0 billion 81 Sweden 7 8 Kushal Pal Singh $30.0 billion 76 India 8 9 Oleg Deripaska $28.0 billion 40 Russia 9 10 Karl Albrecht $27.0 billion 88 Germany Source(s) of wealth 0 Berkshire Hathaway 1 América Móvil, Grupo Carso 2 Microsoft 3 Arcelor Mittal 4 Reliance Industries 5 Anil Dhirubhai Ambani Group 6 IKEA 7 DLF Group 8 Rusal 9 Aldi Süd , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $56.0 billion 51 United States 1 2 Warren Buffett $52.0 billion 76 United States 2 3 Carlos Slim $49.0 billion 67 Mexico 3 4 Ingvar Kamprad $33.0 billion 80 Sweden 4 5 Lakshmi Mittal $32.0 billion 56 India 5 6 Sheldon Adelson $26.5 billion 73 United States 6 7 Bernard Arnault $26.0 billion 58 France 7 8 Amancio Ortega $24.0 billion 71 Spain 8 9 Li Ka-shing $23.0 billion 78 Hong Kong 9 10 David Thomson $22.0 billion 49 Canada Source(s) of wealth 0 Microsoft 1 Berkshire Hathaway 2 América Móvil, Grupo Carso 3 IKEA 4 Arcelor Mittal 5 Las Vegas Sands 6 LVMH 7 Inditex Group 8 Cheung Kong Holdings, Hutchison Whampoa 9 Thomson Corporation , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $52.0 billion 50 United States 1 2 Warren Buffett $42.0 billion 75 United States 2 3 Carlos Slim $30.0 billion 66 Mexico 3 4 Ingvar Kamprad $28.0 billion 79 Sweden 4 5 Lakshmi Mittal $23.5 billion 55 India 5 6 Paul Allen $22.0 billion 53 United States 6 7 Bernard Arnault $21.5 billion 57 France 7 8 Al-Waleed bin Talal $20.0 billion 49 Saudi Arabia 8 9 Kenneth Thomson $19.6 billion 82 Canada 9 10 Li Ka-shing $18.8 billion 77 Hong Kong Source(s) of wealth 0 Microsoft 1 Berkshire Hathaway 2 América Móvil, Grupo Carso 3 IKEA 4 Mittal Steel Company 5 Microsoft 6 LVMH Moët Hennessy • Louis Vuitton 7 Kingdom Holding Company 8 Thomson Corporation 9 Cheung Kong Group, Hutchison Whampoa , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $46.5 billion 49 United States 1 2 Warren Buffett $44.0 billion 74 United States 2 3 Lakshmi Mittal $25.0 billion 54 India 3 4 Carlos Slim $23.8 billion 65 Mexico 4 5 Al-Waleed bin Talal $23.7 billion 49 Saudi Arabia 5 6 Ingvar Kamprad $23.0 billion 79 Sweden 6 7 Paul Allen $21.0 billion 52 United States 7 8 Karl Albrecht $18.5 billion 85 Germany 8 9 Larry Ellison $18.4 billion 60 United States 9 10 S. Robson Walton $18.3 billion 61 United States Source(s) of wealth 0 Microsoft 1 Berkshire Hathaway 2 Mittal Steel Company 3 América Móvil, Grupo Carso 4 Kingdom Holding Company 5 IKEA 6 Microsoft 7 Aldi Süd 8 Oracle Corporation 9 Walmart , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $46.6 billion 48 United States 1 2 Warren Buffett $42.9 billion 73 United States 2 3 Karl Albrecht $23.0 billion 84 Germany 3 4 Al-Waleed bin Talal $21.5 billion 47 Saudi Arabia 4 5 Paul Allen $21.0 billion 51 United States 5 6 Alice Walton* $20.0 billion 55 United States 6 6 Helen Walton* $20.0 billion 84 United States 7 6 Jim Walton* $20.0 billion 56 United States 8 6 John Walton* $20.0 billion 58 United States 9 6 S. Robson Walton* $20.0 billion 60 United States Source(s) of wealth 0 Microsoft 1 Berkshire Hathaway 2 Aldi Süd 3 Kingdom Holding Company 4 Microsoft 5 Wal-Mart 6 Wal-Mart 7 Wal-Mart 8 Wal-Mart 9 Wal-Mart , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $40.7 billion 47 United States 1 2 Warren Buffett $30.5 billion 72 United States 2 3 Karl and Theo Albrecht $25.6 billion 83 Germany 3 4 Paul Allen $20.1 billion 50 United States 4 5 Al-Waleed bin Talal $17.7 billion 46 Saudi Arabia 5 6 Larry Ellison $16.6 billion 58 United States 6 7 Alice Walton* $16.5 billion 54 United States 7 7 Helen Walton* $16.5 billion 83 United States 8 7 Jim Walton* $16.5 billion 55 United States 9 7 John Walton* $16.5 billion 57 United States 10 7 S. Robson Walton* $16.5 billion 59 United States Source(s) of wealth 0 Microsoft 1 Berkshire Hathaway 2 Aldi Süd 3 Microsoft 4 Kingdom Holding Company 5 Oracle Corporation 6 Wal-Mart 7 Wal-Mart 8 Wal-Mart 9 Wal-Mart 10 Wal-Mart , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $52.8 billion 46 United States 1 2 Warren Buffett $35.0 billion 71 United States 2 3 Karl and Theo Albrecht $26.8 billion 82 Germany 3 4 Paul Allen $25.2 billion 49 United States 4 5 Larry Ellison $23.5 billion 57 United States 5 6 Jim Walton* $20.8 billion 54 United States 6 7 John Walton* $20.7 billion 56 United States 7 8 Alice Walton* $20.5 billion 53 United States 8 8 S. Robson Walton* $20.5 billion 58 United States 9 8 Helen Walton* $20.5 billion 82 United States Source(s) of wealth 0 Microsoft 1 Berkshire Hathaway 2 Aldi Süd 3 Microsoft 4 Oracle Corporation 5 Wal-Mart 6 Wal-Mart 7 Wal-Mart 8 Wal-Mart 9 Wal-Mart , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $58.7 billion 45 United States 1 2 Warren Buffett $32.3 billion 70 United States 2 3 Paul Allen $30.4 billion 48 United States 3 4 Larry Ellison $26.0 billion 56 United States 4 5 Karl and Theo Albrecht $25.0 billion 81 Germany 5 6 Al-Waleed bin Talal $20.0 billion 44 Saudi Arabia 6 7 Jim Walton* $18.8 billion 53 United States 7 8 John Walton* $18.7 billion 55 United States 8 9 S. Robson Walton* $18.6 billion 57 United States 9 10 Alice Walton* $18.5 billion 52 United States 10 10 Helen Walton* $18.5 billion 81 United States Source(s) of wealth 0 Microsoft 1 Berkshire Hathaway 2 Microsoft 3 Oracle Corporation 4 Aldi 5 Kingdom Holding Company 6 Wal-Mart 7 Wal-Mart 8 Wal-Mart 9 Wal-Mart 10 Wal-Mart , No. Name Net worth (USD) Age Nationality \ 0 1 Bill Gates $60.0 billion 44 United States 1 2 Larry Ellison $47.0 billion 55 United States 2 3 Paul Allen $28.0 billion 47 United States 3 4 Warren Buffett $25.6 billion 69 United States 4 5 Karl and Theo Albrecht $20.0 billion 80 Germany 5 6 Al-Waleed bin Talal $20.0 billion 43 Saudi Arabia 6 7 S. Robson Walton $20.0 billion 57 United States 7 8 Masayoshi Son $19.4 billion 43 Japan 8 9 Michael Dell $19.1 billion 35 United States 9 10 Kenneth Thomson $16.1 billion 77 Canada Source(s) of wealth 0 Microsoft 1 Oracle Corporation 2 Microsoft 3 Berkshire Hathaway 4 Aldi Süd 5 Kingdom Holding Company 6 Wal-Mart 7 Softbank Capital, SoftBank Mobile 8 Dell 9 The Thomson Corporation , No.[44] Name Net worth (USD) Nationality 0 1 Bill Gates $90.0 billion United States 1 2 Warren Buffett $36.0 billion United States 2 3 Paul Allen $30.0 billion United States 3 4 Steven Ballmer $19.5 billion United States 4 5 Philip Anschutz $16.5 billion United States 5 6 Michael Dell $16.5 billion United States 6 7 S. Robson Walton $15.8 billion United States 7 8 Al-Waleed Bin Talal $15.0 billion Saudi Arabia 8 9 Karl and Theo Albrecht $13.6 billion Germany 9 10 Li Ka-shing & family $12.6 billion Hong Kong, No.[44] Name Net worth (USD) Nationality 0 1 Bill Gates $51.0 billion United States 1 2 Walton family $48.0 billion United States 2 3 Warren Buffett $33.0 billion United States 3 4 Paul Allen $21.0 billion United States 4 5 Kenneth Thomson $14.4 billion Canada 5 6 Jay and Robert Pritzker $13.5 billion United States 6 7 Forrest Mars Sr. & family $13.5 billion United States 7 8 Al-Waleed Bin Talal $13.3 billion Saudi Arabia 8 9 Lee Shau-kee $12.7 billion Hong Kong 9 10 Karl and Theo Albrecht $11.7 billion Germany, No.[44] Name Net worth (USD) Nationality 0 1 Bill Gates $36.4 billion United States 1 2 Walton family $27.6 billion United States 2 3 Warren Buffett $23.2 billion United States 3 4 Lee Shau-kee $14.7 billion Hong Kong 4 5 Paul Allen $14.1 billion United States 5 6 Kwok brothers $12.3 billion Hong Kong 6 7 Haas family $12.3 billion United States 7 8 Forrest Mars Sr. & family $12.0 billion United States 8 9 Karl and Theo Albrecht $11.5 billion Germany 9 10 Tsai Wan-lin & family $11.3 billion Taiwan, No.[44] Name Net worth (USD) Nationality 0 1 Walton family $22.9 billion United States 1 2 Bill Gates $18.0 billion United States 2 3 Warren Buffett $15.3 billion United States 3 4 Oeri, Hoffman & Sacher families $13.1 billion Switzerland 4 5 Lee Shau-kee $12.7 billion Hong Kong 5 6 Tsai Wan-lin & family $12.2 billion Taiwan 6 7 Kwok brothers $11.2 billion Hong Kong 7 8 Li Ka-shing & family $10.6 billion Hong Kong 8 9 Yoshiaki Tsutsumi $9.2 billion Japan 9 10 Karl and Theo Albrecht $9.0 billion Germany, No.[44] Name Net worth (USD) Nationality 0 1 Walton family $23.5 billion United States 1 2 Bill Gates $12.9 billion United States 2 3 Warren Buffett $10.7 billion United States 3 4 Hans and Gad Rausing $9.0 billion Sweden 4 5 Yoshiaki Tsutsumi $9.0 billion Japan 5 6 Paul Sacher & Hoffman family $8.6 billion Switzerland 6 7 Tsai Wan-lin & family $8.5 billion Taiwan 7 8 Kenneth Thomson $6.5 billion Canada 8 9 Lee Shau-kee $6.5 billion Hong Kong 9 10 Chung Ju-yung $6.2 billion South Korea, No.[44] Name Net worth (USD) Nationality 0 1 Walton family $22.6 billion United States 1 2 du Pont family $9.0 billion United States 2 3 Hans and Gad Rausing $9.0 billion Sweden 3 4 Yoshiaki Tsutsumi $8.5 billion Japan 4 5 Bill Gates $8.2 billion United States 5 6 Warren Buffett $7.9 billion United States 6 7 Paul Sacher & Hoffman family $7.8 billion Switzerland 7 8 Tsai Wan-lin & family $7.5 billion Taiwan 8 9 Karl and Theo Albrecht $7.3 billion Germany 9 10 Carlos Slim $6.6 billion Mexico, No.[44] Name Net worth (USD) Nationality 0 1 Walton family $25.3 billion United States 1 2 Mars family $9.2 billion United States 2 3 Yoshiaki Tsutsumi $9.0 billion Japan 3 4 du Pont family $8.6 billion United States 4 5 Minoru and Akira Mori $7.5 billion Japan 5 6 Bill Gates $7.4 billion United States 6 7 Samuel and Donald Newhouse $7.0 billion United States 7 8 Sid and Lee Bass & brothers $6.8 billion United States 8 9 Warren Buffett $6.6 billion United States 9 10 Erivan Haub $6.2 billion Germany, No.[44] Name Net worth (USD) Nationality 0 1 Walton family $23.8 billion United States 1 2 Taikichiro Mori $13.0 billion Japan 2 3 Yoshiaki Tsutsumi $10.0 billion Japan 3 4 Hans and Gad Rausing $7.0 billion Sweden 4 5 Erivan Haub $6.9 billion Germany 5 6 Haniel family $6.4 billion Germany 6 7 Bill Gates $6.4 billion United States 7 8 David Sainsbury & family $6.2 billion United Kingdom 8 9 Kenneth Thomson $6.2 billion Canada 9 10 Shin Kyuk-ho $6.0 billion South Korea, No.[44] Name Net worth (USD) Nationality 0 1 Walton family $18.5 billion United States 1 2 Taikichiro Mori $15.0 billion Japan 2 3 Yoshiaki Tsutsumi $14.0 billion Japan 3 4 du Pont family $10.0 billion United States 4 5 Hans and Gad Rausing $9.0 billion Sweden 5 6 Kitaro Watanabe $7.7 billion Japan 6 7 Paul Reichmann & brothers $7.1 billion Canada 7 8 Kenneth Thomson $6.8 billion Canada 8 9 Kenkichi Nakajima $6.1 billion Japan 9 10 Shin Kyuk-ho $6.0 billion South Korea, No.[44] Name Net worth (USD) Nationality 0 1 Yoshiaki Tsutsumi $16.0 billion Japan 1 2 Taikichiro Mori $14.6 billion Japan 2 3 Walton family $13.5 billion United States 3 4 du Pont family $10.0 billion United States 4 5 Hans and Gad Rausing $9.6 billion Sweden 5 6 Kitaro Watanabe $9.2 billion Japan 6 7 Paul Reichmann & brothers $9.0 billion Canada 7 8 Kenkichi Nakajima $8.4 billion Japan 8 9 Shin Kyuk-ho $7.5 billion South Korea 9 10 Eitaro Itoyama $5.8 billion Japan, No.[45] Name Net worth (USD) Nationality 0 1 Yoshiaki Tsutsumi $15.0 billion Japan 1 2 Taikichiro Mori $14.2 billion Japan 2 3 Sam Walton & family $8.7 billion United States 3 4 Reichmann brothers $8.0 billion Canada 4 4 Shin Kyuk-ho $8.0 billion South Korea 5 6 Hirotomo Takei & family $7.8 billion Japan 6 7 Kitaro Watanabe $7.0 billion+ Japan 7 8 Haruhiko Yoshimoto & family $7.0 billion Japan 8 8 Hans and Gad Rausing $7.0 billion Sweden 9 10 Eitaro Itoyama $6.6 billion Japan, No.[46] Name Net worth (USD) Nationality 0 1 Yoshiaki Tsutsumi $18.9 billion Japan 1 2 Taikichiro Mori $18.0 billion Japan 2 3 Reichmann brothers $9.0 billion Canada 3 4 Shin Kyuk-ho $8.0 billion South Korea 4 4 K. C. Irving $8.0 billion Canada 5 6 Haruhiko Yoshimoto $7.8 billion Japan 6 7 Sam Walton $6.5 billion United States 7 8 Tsai Wan-lin $5.6 billion Taiwan 8 9 Eitaro Itoyama $5.0 billion+ Japan 9 10 Kitaro Watanabe $5.2 billion Japan, Year Number of billionaires \ 0 2021[2] 2755 1 2020 2095 2 2019 2153 3 2018 2208 4 2017 2043 5 2016 1810 6 2015[15] 1826 7 2014[52] 1645 8 2013[53] 1426 9 2012 1226 10 2011 1210 11 2010 1011 12 2009 793 13 2008 1125 14 2007 946 15 2006 793 16 2005 691 17 2004 587 18 2003 476 19 2002 497 20 2001 538 21 2000 470 22 Sources: Forbes.[15][52][51][53] Sources: Forbes.[15][52][51][53] Group's combined net worth 0 $13.1 trillion 1 $8.0 trillion 2 $8.7 trillion 3 $9.1 trillion 4 $7.7 trillion 5 $6.5 trillion 6 $7.1 trillion 7 $6.4 trillion 8 $5.4 trillion 9 $4.6 trillion 10 $4.5 trillion 11 $3.6 trillion 12 $2.4 trillion 13 $4.4 trillion 14 $3.5 trillion 15 $2.6 trillion 16 $2.2 trillion 17 $1.9 trillion 18 $1.4 trillion 19 $1.5 trillion 20 $1.8 trillion 21 NaN 22 Sources: Forbes.[15][52][51][53] , .mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}.mw-parser-output .infobox .navbar{font-size:100%}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}vteForbes magazine \ 0 Companies 1 People 2 General 3 Richest 4 Places 5 Sports 6 Technology .mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}.mw-parser-output .infobox .navbar{font-size:100%}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}vteForbes magazine.1 \ 0 Global 2000 Forbes 500 1 General Celebrity 100 30 Under 30 China Celebr... 2 Celebrity 100 30 Under 30 China Celebrity 100 ... 3 The World's Billionaires Forbes 400 Australia’... 4 America's Best Colleges 5 Highest-paid athletes Most valuable sports tea... 6 Midas List (Tech's Top Deal Makers) .mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}.mw-parser-output .infobox .navbar{font-size:100%}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}vteForbes magazine.2 0 NaN 1 NaN 2 NaN 3 NaN 4 NaN 5 NaN 6 NaN , 0 1 0 General Celebrity 100 30 Under 30 China Celebrity 100 ... 1 Richest The World's Billionaires Forbes 400 Australia’..., vteBillionaires vteBillionaires.1 0 By citizenship Argentina Austria Belgium Brazil Canada Chile ... 1 By region World Africa Asia Europe Latin America 2 Forbes lists 2010 2011 2012 2013 2014 2015 2016 2017 2018 2... 3 Lists Black Bloomberg Billionaires Index Financial R... 4 Other Billionaire space race, vteExtreme wealth \ 0 Concepts 1 Capital accumulation Overaccumulation Economic... 2 People 3 Wealth 4 Lists 5 People 6 Organizations 7 Other 8 See also 9 Diseases of affluence Affluenza Argumentum ad ... 10 Philanthropy 11 Sayings 12 Media 13 Category By Country Commons Search Commons vteExtreme wealth.1 0 Capital accumulation Overaccumulation Economic... 1 Capital accumulation Overaccumulation Economic... 2 Billionaire Captain of industry High-net-worth... 3 Concentration Distribution Dynastic Effect Geo... 4 People Forbes list of billionaires Female bill... 5 Forbes list of billionaires Female billionaire... 6 Largest companies by revenue Largest corporate... 7 Cities by number of billionaires Countries by ... 8 Diseases of affluence Affluenza Argumentum ad ... 9 Diseases of affluence Affluenza Argumentum ad ... 10 Gospel of Wealth The Giving Pledge Philanthroc... 11 The rich get richer and the poor get poorer So... 12 Das Kapital Plutus Greek god of wealth Supercl... 13 Category By Country Commons Search Commons , 0 \ 0 Capital accumulation Overaccumulation Economic... 1 People 2 Wealth 1 0 Capital accumulation Overaccumulation Economic... 1 Billionaire Captain of industry High-net-worth... 2 Concentration Distribution Dynastic Effect Geo... , 0 1 0 People Forbes list of billionaires Female billionaire... 1 Organizations Largest companies by revenue Largest corporate... 2 Other Cities by number of billionaires Countries by ..., 0 \ 0 Diseases of affluence Affluenza Argumentum ad ... 1 Philanthropy 2 Sayings 3 Media 1 0 Diseases of affluence Affluenza Argumentum ad ... 1 Gospel of Wealth The Giving Pledge Philanthroc... 2 The rich get richer and the poor get poorer So... 3 Das Kapital Plutus Greek god of wealth Supercl... ]
In [17]:
df_list[0]
Out[17]:
0 | 1 | |
---|---|---|
0 | List of the world's billionaires, ranked in or... | List of the world's billionaires, ranked in or... |
1 | The net worth of the world's billionaires incr... | The net worth of the world's billionaires incr... |
2 | Publication details | Publication details |
3 | Publisher | Whale Media InvestmentsForbes family |
4 | Publication | Forbes |
5 | First published | March 1987[1] |
6 | Latest publication | April 6, 2021 |
7 | Current list details (2021)[2] | Current list details (2021)[2] |
8 | Wealthiest | Elon Musk |
9 | Net worth (1st) | US$201 billion |
10 | Number of billionaires | 2755 |
11 | Total list net worth value | US$13.1 trillion |
12 | New members to the list | 493 |
13 | Forbes: The World's Billionaires website | Forbes: The World's Billionaires website |
In [26]:
df = df_list[2]
df.head()
Out[26]:
No. | Name | Net worth (USD) | Age | Nationality | Source(s) of wealth | |
---|---|---|---|---|---|---|
0 | 1 | Jeff Bezos | $177 billion | 57 | United States | Amazon |
1 | 2 | Elon Musk | $151 billion | 49 | United States | Tesla, SpaceX |
2 | 3 | Bernard Arnault & family | $150 billion | 72 | France | LVMH |
3 | 4 | Bill Gates | $124 billion | 65 | United States | Microsoft |
4 | 5 | Mark Zuckerberg | $97 billion | 36 | United States | Facebook, Inc. |
In [27]:
# Memilih Tabel tertentu
pd.read_html(url, match='Number and combined net worth of billionaires by year')[0].head()
Out[27]:
Year | Number of billionaires | Group's combined net worth | |
---|---|---|---|
0 | 2021[2] | 2755 | $13.1 trillion |
1 | 2020 | 2095 | $8.0 trillion |
2 | 2019 | 2153 | $8.7 trillion |
3 | 2018 | 2208 | $9.1 trillion |
4 | 2017 | 2043 | $7.7 trillion |
Tidak ada komentar:
Posting Komentar
Relevant & Respectful Comments Only.