728x90
In [1]:
import pandas as pd
In [2]:
bank_df = pd.read_csv('bank customers.csv'); bank_df
Out[2]:
RowNumber | CustomerId | Surname | CreditScore | Geography | Gender | Age | Tenure | Balance | NumOfProducts | HasCrCard | IsActiveMember | EstimatedSalary | Exited | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 15634602 | Hargrave | 619 | France | Female | 42 | 2 | 0.00 | 1 | 1 | 1 | 101348.88 | 1 |
1 | 2 | 15647311 | Hill | 608 | Spain | Female | 41 | 1 | 83807.86 | 1 | 0 | 1 | 112542.58 | 0 |
2 | 3 | 15619304 | Onio | 502 | France | Female | 42 | 8 | 159660.80 | 3 | 1 | 0 | 113931.57 | 1 |
3 | 4 | 15701354 | Boni | 699 | France | Female | 39 | 1 | 0.00 | 2 | 0 | 0 | 93826.63 | 0 |
4 | 5 | 15737888 | Mitchell | 850 | Spain | Female | 43 | 2 | 125510.82 | 1 | 1 | 1 | 79084.10 | 0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
9995 | 9996 | 15606229 | Obijiaku | 771 | France | Male | 39 | 5 | 0.00 | 2 | 1 | 0 | 96270.64 | 0 |
9996 | 9997 | 15569892 | Johnstone | 516 | France | Male | 35 | 10 | 57369.61 | 1 | 1 | 1 | 101699.77 | 0 |
9997 | 9998 | 15584532 | Liu | 709 | France | Female | 36 | 7 | 0.00 | 1 | 0 | 1 | 42085.58 | 1 |
9998 | 9999 | 15682355 | Sabbatini | 772 | Germany | Male | 42 | 3 | 75075.31 | 2 | 1 | 0 | 92888.52 | 1 |
9999 | 10000 | 15628319 | Walker | 792 | France | Female | 28 | 4 | 130142.79 | 1 | 1 | 0 | 38190.78 | 0 |
10000 rows × 14 columns
In [3]:
# tabular data: 정형 데이터
house_prices_df = pd.read_html("https://www.livingin-canada.com/house-prices-canada.html")
In [4]:
house_prices_df[0]
Out[4]:
City | Average House Price | 12 Month Change | |
---|---|---|---|
0 | Vancouver, BC | $1,036,000 | + 2.63 % |
1 | Toronto, Ont | $870,000 | +10.2 % |
2 | Ottawa, Ont | $479,000 | + 15.4 % |
3 | Calgary, Alb | $410,000 | – 1.5 % |
4 | Montreal, Que | $435,000 | + 9.3 % |
5 | Halifax, NS | $331,000 | + 3.6 % |
6 | Regina, Sask | $254,000 | – 3.9 % |
7 | Fredericton, NB | $198,000 | – 4.3 % |
8 | (adsbygoogle = window.adsbygoogle || []).push(... | (adsbygoogle = window.adsbygoogle || []).push(... | (adsbygoogle = window.adsbygoogle || []).push(... |
In [5]:
house_prices_df[1]
Out[5]:
Province | Average House Price | 12 Month Change | |
---|---|---|---|
0 | British Columbia | $736,000 | + 7.6 % |
1 | Ontario | $594,000 | – 3.2 % |
2 | Alberta | $353,000 | – 7.5 % |
3 | Quebec | $340,000 | + 7.6 % |
4 | Manitoba | $295,000 | – 1.4 % |
5 | Saskatchewan | $271,000 | – 3.8 % |
6 | Nova Scotia | $266,000 | + 3.5 % |
7 | Prince Edward Island | $243,000 | + 3.0 % |
8 | Newfoundland / Labrador | $236,000 | – 1.6 % |
9 | New Brunswick | $183,000 | – 2.2 % |
10 | Canadian Average | $488,000 | – 1.3 % |
11 | (adsbygoogle = window.adsbygoogle || []).push(... | (adsbygoogle = window.adsbygoogle || []).push(... | (adsbygoogle = window.adsbygoogle || []).push(... |
728x90
'Data Analytics with python > [Data Analysis]' 카테고리의 다른 글
[Pandas][DataFrame]S2_04_index_setting (0) | 2023.01.21 |
---|---|
[Pandas][DataFrame]S2_03_Outputs (0) | 2023.01.21 |
[Pandas][DaraFrame]S2_01_DataFrame (0) | 2023.01.17 |
[Pandas][Series]S1_12_Slicing (0) | 2023.01.17 |
[Pandas][Series]S1_11_Indexing (0) | 2023.01.17 |
댓글