来源:Kaggle 官方课程 Pandas
2024-08-30@isSeymour
Pandas - Kaggle
1. Creating, Reading and Writing
1 2 import pandas as pdpd.set_option('display.max_rows' , 5 )
1 2 3 fruits = pd.DataFrame({'Apples' : [30 ], 'Bananas' : [21 ]}) fruits
1 2 3 4 fruit_sales = pd.DataFrame({'Apples' : [35 , 41 ], 'Bananas' : [21 , 34 ]}, index=['2017 Sales' , '2018 Sales' ]) fruit_sales
Apples
Bananas
2017 Sales
35
21
2018 Sales
41
34
1 2 3 ingredients = pd.Series(['4 cups' , '1 cup' , '2 large' , '1 can' ], index=['Flour' , 'Milk' , 'Eggs' , 'Spam' ], name='Dinner' ) ingredients
Flour 4 cups
Milk 1 cup
Eggs 2 large
Spam 1 can
Name: Dinner, dtype: object
1 2 reviews = pd.read_csv("../input/winemag-data_first150k.csv" ,index_col=0 ) reviews
country
description
designation
points
price
province
region_1
region_2
variety
winery
0
US
This tremendous 100% varietal wine hails from ...
Martha's Vineyard
96
235.0
California
Napa Valley
Napa
Cabernet Sauvignon
Heitz
1
Spain
Ripe aromas of fig, blackberry and cassis are ...
Carodorum Selección Especial Reserva
96
110.0
Northern Spain
Toro
NaN
Tinta de Toro
Bodega Carmen Rodríguez
...
...
...
...
...
...
...
...
...
...
...
150928
France
A perfect salmon shade, with scents of peaches...
Grand Brut Rosé
90
52.0
Champagne
Champagne
NaN
Champagne Blend
Gosset
150929
Italy
More Pinot Grigios should taste like this. A r...
NaN
90
15.0
Northeastern Italy
Alto Adige
NaN
Pinot Grigio
Alois Lageder
150930 rows × 10 columns
1 2 animals = pd.DataFrame({'Cows' : [12 , 20 ], 'Goats' : [22 , 19 ]}, index=['Year 1' , 'Year 2' ]) animals.to_csv("cows_and_goats.csv" )
2. Indexing, Selecting & Assigning
1 2 reviews = pd.read_csv("../input/winemag-data-130k-v2.csv" , index_col=0 ) reviews.head()
country
description
designation
points
price
province
region_1
region_2
taster_name
taster_twitter_handle
title
variety
winery
0
Italy
Aromas include tropical fruit, broom, brimston...
Vulkà Bianco
87
NaN
Sicily & Sardinia
Etna
NaN
Kerin O’Keefe
@kerinokeefe
Nicosia 2013 Vulkà Bianco (Etna)
White Blend
Nicosia
1
Portugal
This is ripe and fruity, a wine that is smooth...
Avidagos
87
15.0
Douro
NaN
NaN
Roger Voss
@vossroger
Quinta dos Avidagos 2011 Avidagos Red (Douro)
Portuguese Red
Quinta dos Avidagos
2
US
Tart and snappy, the flavors of lime flesh and...
NaN
87
14.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Rainstorm 2013 Pinot Gris (Willamette Valley)
Pinot Gris
Rainstorm
3
US
Pineapple rind, lemon pith and orange blossom ...
Reserve Late Harvest
87
13.0
Michigan
Lake Michigan Shore
NaN
Alexander Peartree
NaN
St. Julian 2013 Reserve Late Harvest Riesling ...
Riesling
St. Julian
4
US
Much like the regular bottling from 2012, this...
Vintner's Reserve Wild Child Block
87
65.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Sweet Cheeks 2012 Vintner's Reserve Wild Child...
Pinot Noir
Sweet Cheeks
1 2 desc = reviews.description desc
0 Aromas include tropical fruit, broom, brimston...
1 This is ripe and fruity, a wine that is smooth...
...
129969 A dry style of Pinot Gris, this is crisp with ...
129970 Big, rich and off-dry, this is powered by inte...
Name: description, Length: 129971, dtype: object
pandas.core.series.Series
1 2 first_description = reviews.description[0 ] first_description
"Aromas include tropical fruit, broom, brimstone and dried herb. The palate isn't overly expressive, offering unripened apple, citrus and dried sage alongside brisk acidity."
1 2 first_row = reviews.loc[0 ] first_row
country Italy
description Aromas include tropical fruit, broom, brimston...
...
variety White Blend
winery Nicosia
Name: 0, Length: 13, dtype: object
1 2 first_descriptions = reviews.loc[0 :9 , 'description' ] first_descriptions
0 Aromas include tropical fruit, broom, brimston...
1 This is ripe and fruity, a wine that is smooth...
...
8 Savory dried thyme notes accent sunnier flavor...
9 This has great depth of flavor with its fresh ...
Name: description, Length: 10, dtype: object
1 2 sample_reviews = reviews.loc[[1 ,2 ,3 ,5 ,8 ]] sample_reviews
country
description
designation
points
price
province
region_1
region_2
taster_name
taster_twitter_handle
title
variety
winery
1
Portugal
This is ripe and fruity, a wine that is smooth...
Avidagos
87
15.0
Douro
NaN
NaN
Roger Voss
@vossroger
Quinta dos Avidagos 2011 Avidagos Red (Douro)
Portuguese Red
Quinta dos Avidagos
2
US
Tart and snappy, the flavors of lime flesh and...
NaN
87
14.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Rainstorm 2013 Pinot Gris (Willamette Valley)
Pinot Gris
Rainstorm
3
US
Pineapple rind, lemon pith and orange blossom ...
Reserve Late Harvest
87
13.0
Michigan
Lake Michigan Shore
NaN
Alexander Peartree
NaN
St. Julian 2013 Reserve Late Harvest Riesling ...
Riesling
St. Julian
5
Spain
Blackberry and raspberry aromas show a typical...
Ars In Vitro
87
15.0
Northern Spain
Navarra
NaN
Michael Schachner
@wineschach
Tandem 2011 Ars In Vitro Tempranillo-Merlot (N...
Tempranillo-Merlot
Tandem
8
Germany
Savory dried thyme notes accent sunnier flavor...
Shine
87
12.0
Rheinhessen
NaN
NaN
Anna Lee C. Iijima
NaN
Heinz Eifel 2013 Shine Gewürztraminer (Rheinhe...
Gewürztraminer
Heinz Eifel
1 2 df = reviews.loc[[0 ,1 ,10 ,100 ], ['country' , 'province' , 'region_1' , 'region_2' ]] df
country
province
region_1
region_2
0
Italy
Sicily & Sardinia
Etna
NaN
1
Portugal
Douro
NaN
NaN
10
US
California
Napa Valley
Napa
100
US
New York
Finger Lakes
Finger Lakes
1 2 df = reviews.loc[0 :99 , ['country' , 'variety' ]] df
country
variety
0
Italy
White Blend
1
Portugal
Portuguese Red
...
...
...
98
Italy
Sangiovese
99
US
Bordeaux-style Red Blend
100 rows × 2 columns
1 2 italian_wines = reviews.loc[reviews.country == 'Italy' ] italian_wines
country
description
designation
points
price
province
region_1
region_2
taster_name
taster_twitter_handle
title
variety
winery
0
Italy
Aromas include tropical fruit, broom, brimston...
Vulkà Bianco
87
NaN
Sicily & Sardinia
Etna
NaN
Kerin O’Keefe
@kerinokeefe
Nicosia 2013 Vulkà Bianco (Etna)
White Blend
Nicosia
6
Italy
Here's a bright, informal red that opens with ...
Belsito
87
16.0
Sicily & Sardinia
Vittoria
NaN
Kerin O’Keefe
@kerinokeefe
Terre di Giurfo 2013 Belsito Frappato (Vittoria)
Frappato
Terre di Giurfo
...
...
...
...
...
...
...
...
...
...
...
...
...
...
129961
Italy
Intense aromas of wild cherry, baking spice, t...
NaN
90
30.0
Sicily & Sardinia
Sicilia
NaN
Kerin O’Keefe
@kerinokeefe
COS 2013 Frappato (Sicilia)
Frappato
COS
129962
Italy
Blackberry, cassis, grilled herb and toasted a...
Sàgana Tenuta San Giacomo
90
40.0
Sicily & Sardinia
Sicilia
NaN
Kerin O’Keefe
@kerinokeefe
Cusumano 2012 Sàgana Tenuta San Giacomo Nero d...
Nero d'Avola
Cusumano
19540 rows × 13 columns
1 2 top_oceania_wines = reviews.loc[(reviews.points >= 95 ) & (reviews.country.isin(['Australia' , 'New Zealand' ]))] top_oceania_wines
country
description
designation
points
price
province
region_1
region_2
taster_name
taster_twitter_handle
title
variety
winery
345
Australia
This wine contains some material over 100 year...
Rare
100
350.0
Victoria
Rutherglen
NaN
Joe Czerwinski
@JoeCz
Chambers Rosewood Vineyards NV Rare Muscat (Ru...
Muscat
Chambers Rosewood Vineyards
346
Australia
This deep brown wine smells like a damp, mossy...
Rare
98
350.0
Victoria
Rutherglen
NaN
Joe Czerwinski
@JoeCz
Chambers Rosewood Vineyards NV Rare Muscadelle...
Muscadelle
Chambers Rosewood Vineyards
...
...
...
...
...
...
...
...
...
...
...
...
...
...
122507
New Zealand
This blend of Cabernet Sauvignon (62.5%), Merl...
SQM Gimblett Gravels Cabernets/Merlot
95
79.0
Hawke's Bay
NaN
NaN
Joe Czerwinski
@JoeCz
Squawking Magpie 2014 SQM Gimblett Gravels Cab...
Bordeaux-style Red Blend
Squawking Magpie
122939
Australia
Full-bodied and plush yet vibrant and imbued w...
The Factor
98
125.0
South Australia
Barossa Valley
NaN
Joe Czerwinski
@JoeCz
Torbreck 2013 The Factor Shiraz (Barossa Valley)
Shiraz
Torbreck
49 rows × 13 columns
3. Summary Functions and Maps
1 2 reviews = pd.read_csv("../input/winemag-data-130k-v2.csv" , index_col=0 ) reviews.head()
country
description
designation
points
price
province
region_1
region_2
taster_name
taster_twitter_handle
title
variety
winery
0
Italy
Aromas include tropical fruit, broom, brimston...
Vulkà Bianco
87
NaN
Sicily & Sardinia
Etna
NaN
Kerin O’Keefe
@kerinokeefe
Nicosia 2013 Vulkà Bianco (Etna)
White Blend
Nicosia
1
Portugal
This is ripe and fruity, a wine that is smooth...
Avidagos
87
15.0
Douro
NaN
NaN
Roger Voss
@vossroger
Quinta dos Avidagos 2011 Avidagos Red (Douro)
Portuguese Red
Quinta dos Avidagos
2
US
Tart and snappy, the flavors of lime flesh and...
NaN
87
14.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Rainstorm 2013 Pinot Gris (Willamette Valley)
Pinot Gris
Rainstorm
3
US
Pineapple rind, lemon pith and orange blossom ...
Reserve Late Harvest
87
13.0
Michigan
Lake Michigan Shore
NaN
Alexander Peartree
NaN
St. Julian 2013 Reserve Late Harvest Riesling ...
Riesling
St. Julian
4
US
Much like the regular bottling from 2012, this...
Vintner's Reserve Wild Child Block
87
65.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Sweet Cheeks 2012 Vintner's Reserve Wild Child...
Pinot Noir
Sweet Cheeks
1 2 3 median_points = reviews.points.median() mean_points = reviews.points.mean() print (median_points, '\t' , mean_points)
88.0 88.44713820775404
1 2 countries = reviews.country.unique() countries
array(['Italy', 'Portugal', 'US', 'Spain', 'France', 'Germany',
'Argentina', 'Chile', 'Australia', 'Austria', 'South Africa',
'New Zealand', 'Israel', 'Hungary', 'Greece', 'Romania', 'Mexico',
'Canada', nan, 'Turkey', 'Czech Republic', 'Slovenia',
'Luxembourg', 'Croatia', 'Georgia', 'Uruguay', 'England',
'Lebanon', 'Serbia', 'Brazil', 'Moldova', 'Morocco', 'Peru',
'India', 'Bulgaria', 'Cyprus', 'Armenia', 'Switzerland',
'Bosnia and Herzegovina', 'Ukraine', 'Slovakia', 'Macedonia',
'China', 'Egypt'], dtype=object)
1 2 reviews_per_country = reviews.country.value_counts() reviews_per_country
country
US 54504
France 22093
...
China 1
Egypt 1
Name: count, Length: 43, dtype: int64
1 2 3 4 centered_price = reviews.price - reviews.price.mean() centered_price
0 NaN
1 -20.363389
...
129969 -3.363389
129970 -14.363389
Name: price, Length: 129971, dtype: float64
1 2 3 4 5 6 7 8 9 10 bargain_ratio = (reviews.points / reviews.price) print (bargain_ratio)print ('-' *25 )bargain_max = bargain_ratio.max () bargain_idxmax = bargain_ratio.idxmax() print (bargain_max, '\t' , bargain_idxmax)print ('-' *25 )bargain_wine = reviews.loc[bargain_idxmax, 'title' ] print (bargain_wine)
0 NaN
1 5.800000
...
129969 2.812500
129970 4.285714
Length: 129971, dtype: float64
-------------------------
21.5 64590
-------------------------
Bandit NV Merlot (California)
1 2 3 4 n_tro = reviews.description.map (lambda desc: 'tropical' in desc).sum () n_fru = reviews.description.map (lambda desc: 'fruity' in desc).sum () descriptor_counts = pd.Series([n_tro, n_fru], ['tropical' , 'fruity' ]) descriptor_counts
tropical 3607
fruity 9090
dtype: int64
1 2 3 4 5 6 7 8 9 10 11 12 def get_star (row ): if row.country == 'Canada' : return 3 elif row.points >= 95 : return 3 elif row.points >= 85 : return 2 else : return 1 star_ratings = reviews.apply(get_star, axis='columns' ) print (star_ratings)
0 2
1 2
..
129969 2
129970 2
Length: 129971, dtype: int64
4. Grouping and Sorting
1 reviews = pd.read_csv("../input/winemag-data-130k-v2.csv" , index_col=0 )
1 2 3 4 5 6 reviews_written = reviews.groupby("taster_twitter_handle" ).taster_twitter_handle.count() print (reviews_written)print ("-" *25 )reviews_written = reviews.groupby("taster_twitter_handle" ).size() print (reviews_written)
taster_twitter_handle
@AnneInVino 3685
@JoeCz 5147
...
@winewchristina 6
@worldwineguys 1005
Name: taster_twitter_handle, Length: 15, dtype: int64
-------------------------
taster_twitter_handle
@AnneInVino 3685
@JoeCz 5147
...
@winewchristina 6
@worldwineguys 1005
Length: 15, dtype: int64
1 2 best_rating_per_price = reviews.groupby('price' ).points.max () print (best_rating_per_price)
price
4.0 86
5.0 87
..
2500.0 96
3300.0 88
Name: points, Length: 390, dtype: int64
1 2 price_extremes = reviews.groupby('variety' ).price.agg(["min" , "max" ]) price_extremes
min
max
variety
Abouriou
15.0
75.0
Agiorgitiko
10.0
66.0
...
...
...
Çalkarası
19.0
19.0
Žilavka
15.0
15.0
707 rows × 2 columns
1 2 sorted_varieties = price_extremes.sort_values(by=["min" , "max" ], ascending=False ) sorted_varieties
min
max
variety
Ramisco
495.0
495.0
Terrantez
236.0
236.0
...
...
...
Vital
NaN
NaN
Zelen
NaN
NaN
707 rows × 2 columns
1 2 reviewer_mean_ratings = reviews.groupby('taster_name' ).points.mean() print (reviewer_mean_ratings)
taster_name
Alexander Peartree 85.855422
Anna Lee C. Iijima 88.415629
...
Susan Kostrzewa 86.609217
Virginie Boone 89.213379
Name: points, Length: 19, dtype: float64
1 reviewer_mean_ratings.describe()
count 19.000000
mean 88.233026
...
75% 88.975256
max 90.562551
Name: points, Length: 8, dtype: float64
1 2 3 4 5 country_variety_counts = reviews.groupby(['country' , 'variety' ]).size() print (country_variety_counts)print ('-' *25 )country_variety_counts = country_variety_counts.sort_values(ascending=False ) print (country_variety_counts)
country variety
Argentina Barbera 1
Bonarda 105
...
Uruguay Tempranillo-Tannat 1
White Blend 1
Length: 1612, dtype: int64
-------------------------
country variety
US Pinot Noir 9885
Cabernet Sauvignon 7315
...
Mexico Rosado 1
Uruguay White Blend 1
Length: 1612, dtype: int64
5. Data Types and Missing Values
1 reviews = pd.read_csv("../input/winemag-data-130k-v2.csv" , index_col=0 )
1 2 dtype = reviews.points.dtype print (dtype)
int64
1 2 point_strings = reviews.points.astype('str' ) point_strings
0 87
1 87
..
129969 90
129970 90
Name: points, Length: 129971, dtype: object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 missing_prices = reviews.price.isnull() print (missing_prices)print ('-' *25 )n_missing_prices = missing_prices.sum () print (n_missing_prices)missing_price_reviews = reviews[reviews.price.isnull()] n_missing_prices = len (missing_price_reviews) n_missing_prices = reviews.price.isnull().sum () n_missing_prices = pd.isnull(reviews.price).sum ()
0 True
1 False
...
129969 False
129970 False
Name: price, Length: 129971, dtype: bool
-------------------------
8996
1 2 3 4 5 6 7 8 reviews_region = reviews.region_1.fillna('Unknown' ) print (reviews_region)print ('-' *25 )reviews_per_region = reviews_region.value_counts() print (reviews_per_region)print ('-' *25 )reviews_per_region = reviews_per_region.sort_values(ascending=False ) print (reviews_per_region)
0 Etna
1 Unknown
...
129969 Alsace
129970 Alsace
Name: region_1, Length: 129971, dtype: object
-------------------------
region_1
Unknown 21247
Napa Valley 4480
...
Vin Santo di Carmignano 1
Paestum 1
Name: count, Length: 1230, dtype: int64
-------------------------
region_1
Unknown 21247
Napa Valley 4480
...
Geelong 1
Paestum 1
Name: count, Length: 1230, dtype: int64
6. Renaming and Combining
1 2 reviews = pd.read_csv("../input/winemag-data-130k-v2.csv" , index_col=0 ) reviews.head()
country
description
designation
points
price
province
region_1
region_2
taster_name
taster_twitter_handle
title
variety
winery
0
Italy
Aromas include tropical fruit, broom, brimston...
Vulkà Bianco
87
NaN
Sicily & Sardinia
Etna
NaN
Kerin O’Keefe
@kerinokeefe
Nicosia 2013 Vulkà Bianco (Etna)
White Blend
Nicosia
1
Portugal
This is ripe and fruity, a wine that is smooth...
Avidagos
87
15.0
Douro
NaN
NaN
Roger Voss
@vossroger
Quinta dos Avidagos 2011 Avidagos Red (Douro)
Portuguese Red
Quinta dos Avidagos
2
US
Tart and snappy, the flavors of lime flesh and...
NaN
87
14.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Rainstorm 2013 Pinot Gris (Willamette Valley)
Pinot Gris
Rainstorm
3
US
Pineapple rind, lemon pith and orange blossom ...
Reserve Late Harvest
87
13.0
Michigan
Lake Michigan Shore
NaN
Alexander Peartree
NaN
St. Julian 2013 Reserve Late Harvest Riesling ...
Riesling
St. Julian
4
US
Much like the regular bottling from 2012, this...
Vintner's Reserve Wild Child Block
87
65.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Sweet Cheeks 2012 Vintner's Reserve Wild Child...
Pinot Noir
Sweet Cheeks
1 2 renamed = reviews.rename(columns={'region_1' : 'region' , 'region_2' : 'locale' }) renamed.head()
country
description
designation
points
price
province
region
locale
taster_name
taster_twitter_handle
title
variety
winery
0
Italy
Aromas include tropical fruit, broom, brimston...
Vulkà Bianco
87
NaN
Sicily & Sardinia
Etna
NaN
Kerin O’Keefe
@kerinokeefe
Nicosia 2013 Vulkà Bianco (Etna)
White Blend
Nicosia
1
Portugal
This is ripe and fruity, a wine that is smooth...
Avidagos
87
15.0
Douro
NaN
NaN
Roger Voss
@vossroger
Quinta dos Avidagos 2011 Avidagos Red (Douro)
Portuguese Red
Quinta dos Avidagos
2
US
Tart and snappy, the flavors of lime flesh and...
NaN
87
14.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Rainstorm 2013 Pinot Gris (Willamette Valley)
Pinot Gris
Rainstorm
3
US
Pineapple rind, lemon pith and orange blossom ...
Reserve Late Harvest
87
13.0
Michigan
Lake Michigan Shore
NaN
Alexander Peartree
NaN
St. Julian 2013 Reserve Late Harvest Riesling ...
Riesling
St. Julian
4
US
Much like the regular bottling from 2012, this...
Vintner's Reserve Wild Child Block
87
65.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Sweet Cheeks 2012 Vintner's Reserve Wild Child...
Pinot Noir
Sweet Cheeks
1 2 reindexed = reviews.rename_axis('wines' , axis='rows' ) reindexed.head()
country
description
designation
points
price
province
region_1
region_2
taster_name
taster_twitter_handle
title
variety
winery
wines
0
Italy
Aromas include tropical fruit, broom, brimston...
Vulkà Bianco
87
NaN
Sicily & Sardinia
Etna
NaN
Kerin O’Keefe
@kerinokeefe
Nicosia 2013 Vulkà Bianco (Etna)
White Blend
Nicosia
1
Portugal
This is ripe and fruity, a wine that is smooth...
Avidagos
87
15.0
Douro
NaN
NaN
Roger Voss
@vossroger
Quinta dos Avidagos 2011 Avidagos Red (Douro)
Portuguese Red
Quinta dos Avidagos
2
US
Tart and snappy, the flavors of lime flesh and...
NaN
87
14.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Rainstorm 2013 Pinot Gris (Willamette Valley)
Pinot Gris
Rainstorm
3
US
Pineapple rind, lemon pith and orange blossom ...
Reserve Late Harvest
87
13.0
Michigan
Lake Michigan Shore
NaN
Alexander Peartree
NaN
St. Julian 2013 Reserve Late Harvest Riesling ...
Riesling
St. Julian
4
US
Much like the regular bottling from 2012, this...
Vintner's Reserve Wild Child Block
87
65.0
Oregon
Willamette Valley
Willamette Valley
Paul Gregutt
@paulgwine
Sweet Cheeks 2012 Vintner's Reserve Wild Child...
Pinot Noir
Sweet Cheeks
1 2 3 4 gaming_products = pd.read_csv("../input//gaming.csv" ) gaming_products['subreddit' ] = "r/gaming" movie_products = pd.read_csv("../input/movies.csv" ) movie_products['subreddit' ] = "r/movies"
1 2 combined_products = pd.concat([gaming_products, movie_products]) combined_products.head()
name
category
amazon_link
total_mentions
subreddit_mentions
subreddit
0
BOOMco Halo Covenant Needler Blaster
Toys & Games
https://www.amazon.com/BOOMco-Halo-Covenant-Ne...
4.0
4
r/gaming
1
Raspberry PI 3 Model B 1.2GHz 64-bit quad-core...
Electronics
https://www.amazon.com/Raspberry-Model-A1-2GHz...
19.0
3
r/gaming
2
CanaKit 5V 2.5A Raspberry Pi 3 Power Supply / ...
Electronics
https://www.amazon.com/CanaKit-Raspberry-Suppl...
7.0
3
r/gaming
3
Panasonic K-KJ17MCA4BA Advanced Individual Cel...
Electronics
https://www.amazon.com/Panasonic-Advanced-Indi...
29.0
2
r/gaming
4
Mayflash GameCube Controller Adapter for Wii U...
Electronics
https://www.amazon.com/GameCube-Controller-Ada...
24.0
2
r/gaming
1 2 powerlifting_meets = pd.read_csv("../input/meets.csv" ) powerlifting_competitors = pd.read_csv("../input/openpowerlifting.csv" )
1 2 3 4 5 6 7 8 9 powerlifting_1 = powerlifting_meets.set_index("MeetID" ) powerlifting_2 = powerlifting_competitors.set_index("MeetID" ) print (powerlifting_1)print ('-' *25 )print (powerlifting_2)powerlifting_combined = powerlifting_1.join(powerlifting_2) print ('-' *25 )print (powerlifting_combined)
MeetPath Federation Date MeetCountry MeetState \
MeetID
0 365strong/1601 365Strong 2016-10-29 USA NC
1 365strong/1602 365Strong 2016-11-19 USA MO
... ... ... ... ... ...
8480 xpc/2016-pro-finals XPC 2016-03-05 USA OH
8481 xpc/2017-finals XPC 2017-03-03 USA OH
MeetTown MeetName
MeetID
0 Charlotte 2016 Junior & Senior National Powerlifting Cha...
1 Ozark Thanksgiving Powerlifting Classic
... ... ...
8480 Columbus 2016 XPC PRO Finals
8481 Columbus 2017 XPC Finals
[8482 rows x 7 columns]
-------------------------
Name Sex Equipment Age Division BodyweightKg \
MeetID
0 Angie Belk Terry F Wraps 47.0 Mst 45-49 59.60
0 Dawn Bogart F Single-ply 42.0 Mst 40-44 58.51
... ... .. ... ... ... ...
8481 Jeff Bumanglag M Multi-ply NaN Elite 126.73
8481 Shane Hammock M Multi-ply NaN Elite 129.46
WeightClassKg Squat4Kg BestSquatKg Bench4Kg BestBenchKg \
MeetID
0 60 NaN 47.63 NaN 20.41
0 60 NaN 142.88 NaN 95.25
... ... ... ... ... ...
8481 140 NaN NaN NaN NaN
8481 140 NaN NaN NaN NaN
Deadlift4Kg BestDeadliftKg TotalKg Place Wilks
MeetID
0 NaN 70.31 138.35 1 155.05
0 NaN 163.29 401.42 1 456.38
... ... ... ... ... ...
8481 NaN 320.00 320.00 3 181.85
8481 NaN 362.50 362.50 2 205.18
[386414 rows x 16 columns]
-------------------------
MeetPath Federation Date MeetCountry MeetState \
MeetID
0 365strong/1601 365Strong 2016-10-29 USA NC
0 365strong/1601 365Strong 2016-10-29 USA NC
... ... ... ... ... ...
8481 xpc/2017-finals XPC 2017-03-03 USA OH
8481 xpc/2017-finals XPC 2017-03-03 USA OH
MeetTown MeetName \
MeetID
0 Charlotte 2016 Junior & Senior National Powerlifting Cha...
0 Charlotte 2016 Junior & Senior National Powerlifting Cha...
... ... ...
8481 Columbus 2017 XPC Finals
8481 Columbus 2017 XPC Finals
Name Sex Equipment ... WeightClassKg Squat4Kg \
MeetID ...
0 Angie Belk Terry F Wraps ... 60 NaN
0 Dawn Bogart F Single-ply ... 60 NaN
... ... .. ... ... ... ...
8481 Jeff Bumanglag M Multi-ply ... 140 NaN
8481 Shane Hammock M Multi-ply ... 140 NaN
BestSquatKg Bench4Kg BestBenchKg Deadlift4Kg BestDeadliftKg \
MeetID
0 47.63 NaN 20.41 NaN 70.31
0 142.88 NaN 95.25 NaN 163.29
... ... ... ... ... ...
8481 NaN NaN NaN NaN 320.00
8481 NaN NaN NaN NaN 362.50
TotalKg Place Wilks
MeetID
0 138.35 1 155.05
0 401.42 1 456.38
... ... ... ...
8481 320.00 3 181.85
8481 362.50 2 205.18
[386414 rows x 23 columns]