import pandas as pd
reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv", index_col=0)
pd.set_option('max_rows', 5)
reviews
|
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 |
|
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
|
129969 |
France |
A dry style of Pinot Gris, this is crisp with ... |
NaN |
90 |
32.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Marcel Deiss 2012 Pinot Gris (Alsace) |
Pinot Gris |
Domaine Marcel Deiss |
|
129970 |
France |
Big, rich and off-dry, this is powered by inte... |
Lieu-dit Harth Cuvée Caroline |
90 |
21.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Schoffit 2012 Lieu-dit Harth Cuvée Car... |
Gewürztraminer |
Domaine Schoffit |
reviews.country
0 Italy
1 Portugal
...
129969 France
129970 France
Name: country, Length: 129971, dtype: object
reviews['country']
0 Italy
1 Portugal
...
129969 France
129970 France
Name: country, Length: 129971, dtype: object
reviews['country'][0]
'Italy'
reviews.iloc[0]
country Italy
description Aromas include tropical fruit, broom, brimston...
...
variety White Blend
winery Nicosia
Name: 0, Length: 13, dtype: object
reviews.iloc[:, 0]
0 Italy
1 Portugal
...
129969 France
129970 France
Name: country, Length: 129971, dtype: object
reviews.iloc[:3, 0]
0 Italy
1 Portugal
2 US
Name: country, dtype: object
reviews.iloc[1:3, 0]
1 Portugal
2 US
Name: country, dtype: object
reviews.iloc[[0, 1, 2], 0]
0 Italy
1 Portugal
2 US
Name: country, dtype: object
reviews.iloc[-5:]
|
country |
description |
designation |
points |
price |
province |
region_1 |
region_2 |
taster_name |
taster_twitter_handle |
title |
variety |
winery |
|
|
129966 |
Germany |
Notes of honeysuckle and cantaloupe sweeten th... |
Brauneberger Juffer-Sonnenuhr Spätlese |
90 |
28.0 |
Mosel |
NaN |
NaN |
Anna Lee C. Iijima |
NaN |
Dr. H. Thanisch (Erben Müller-Burggraef) 2013 ... |
Riesling |
Dr. H. Thanisch (Erben Müller-Burggraef) |
|
129967 |
US |
Citation is given as much as a decade of bottl... |
NaN |
90 |
75.0 |
Oregon |
Oregon |
Oregon Other |
Paul Gregutt |
@paulgwine |
Citation 2004 Pinot Noir (Oregon) |
Pinot Noir |
Citation |
|
129968 |
France |
Well-drained gravel soil gives this wine its c... |
Kritt |
90 |
30.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Gresser 2013 Kritt Gewurztraminer (Als... |
Gewürztraminer |
Domaine Gresser |
|
129969 |
France |
A dry style of Pinot Gris, this is crisp with ... |
NaN |
90 |
32.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Marcel Deiss 2012 Pinot Gris (Alsace) |
Pinot Gris |
Domaine Marcel Deiss |
|
129970 |
France |
Big, rich and off-dry, this is powered by inte... |
Lieu-dit Harth Cuvée Caroline |
90 |
21.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Schoffit 2012 Lieu-dit Harth Cuvée Car... |
Gewürztraminer |
Domaine Schoffit |
reviews.loc[0, 'country']
'Italy'
reviews.loc[:, ['taster_name', 'taster_twitter_handle', 'points']]
|
taster_name |
taster_twitter_handle |
points |
|
|
0 |
Kerin O’Keefe |
@kerinokeefe |
87 |
|
1 |
Roger Voss |
@vossroger |
87 |
|
... |
... |
... |
... |
|
129969 |
Roger Voss |
@vossroger |
90 |
|
129970 |
Roger Voss |
@vossroger |
90 |
reviews.set_index("title")
|
country |
description |
designation |
points |
price |
province |
region_1 |
region_2 |
taster_name |
taster_twitter_handle |
variety |
winery |
|
|
title |
||||||||||||
|
Nicosia 2013 Vulkà Bianco (Etna) |
Italy |
Aromas include tropical fruit, broom, brimston... |
Vulkà Bianco |
87 |
NaN |
Sicily & Sardinia |
Etna |
NaN |
Kerin O’Keefe |
@kerinokeefe |
White Blend |
Nicosia |
|
Quinta dos Avidagos 2011 Avidagos Red (Douro) |
Portugal |
This is ripe and fruity, a wine that is smooth... |
Avidagos |
87 |
15.0 |
Douro |
NaN |
NaN |
Roger Voss |
@vossroger |
Portuguese Red |
Quinta dos Avidagos |
|
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
|
Domaine Marcel Deiss 2012 Pinot Gris (Alsace) |
France |
A dry style of Pinot Gris, this is crisp with ... |
NaN |
90 |
32.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Pinot Gris |
Domaine Marcel Deiss |
|
Domaine Schoffit 2012 Lieu-dit Harth Cuvée Caroline Gewurztraminer (Alsace) |
France |
Big, rich and off-dry, this is powered by inte... |
Lieu-dit Harth Cuvée Caroline |
90 |
21.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Gewürztraminer |
Domaine Schoffit |
reviews.country == 'Italy'
0 True
1 False
...
129969 False
129970 False
Name: country, Length: 129971, dtype: bool
reviews.loc[reviews.country == 'Italy']
|
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 |
reviews.loc[(reviews.country == 'Italy') & (reviews.points >= 90)]
|
country |
description |
designation |
points |
price |
province |
region_1 |
region_2 |
taster_name |
taster_twitter_handle |
title |
variety |
winery |
|
|
120 |
Italy |
Slightly backward, particularly given the vint... |
Bricco Rocche Prapó |
92 |
70.0 |
Piedmont |
Barolo |
NaN |
NaN |
NaN |
Ceretto 2003 Bricco Rocche Prapó (Barolo) |
Nebbiolo |
Ceretto |
|
130 |
Italy |
At the first it was quite muted and subdued, b... |
Bricco Rocche Brunate |
91 |
70.0 |
Piedmont |
Barolo |
NaN |
NaN |
NaN |
Ceretto 2003 Bricco Rocche Brunate (Barolo) |
Nebbiolo |
Ceretto |
|
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
|
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 |
reviews.loc[(reviews.country == 'Italy') | (reviews.points >= 90)]
|
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 |
|
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
|
129969 |
France |
A dry style of Pinot Gris, this is crisp with ... |
NaN |
90 |
32.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Marcel Deiss 2012 Pinot Gris (Alsace) |
Pinot Gris |
Domaine Marcel Deiss |
|
129970 |
France |
Big, rich and off-dry, this is powered by inte... |
Lieu-dit Harth Cuvée Caroline |
90 |
21.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Schoffit 2012 Lieu-dit Harth Cuvée Car... |
Gewürztraminer |
Domaine Schoffit |
reviews.loc[reviews.country.isin(['Italy', 'France'])]
|
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 |
|
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
|
129969 |
France |
A dry style of Pinot Gris, this is crisp with ... |
NaN |
90 |
32.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Marcel Deiss 2012 Pinot Gris (Alsace) |
Pinot Gris |
Domaine Marcel Deiss |
|
129970 |
France |
Big, rich and off-dry, this is powered by inte... |
Lieu-dit Harth Cuvée Caroline |
90 |
21.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Schoffit 2012 Lieu-dit Harth Cuvée Car... |
Gewürztraminer |
Domaine Schoffit |
reviews.loc[reviews.price.notnull()]
|
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 |
|
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
... |
|
129969 |
France |
A dry style of Pinot Gris, this is crisp with ... |
NaN |
90 |
32.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Marcel Deiss 2012 Pinot Gris (Alsace) |
Pinot Gris |
Domaine Marcel Deiss |
|
129970 |
France |
Big, rich and off-dry, this is powered by inte... |
Lieu-dit Harth Cuvée Caroline |
90 |
21.0 |
Alsace |
Alsace |
NaN |
Roger Voss |
@vossroger |
Domaine Schoffit 2012 Lieu-dit Harth Cuvée Car... |
Gewürztraminer |
Domaine Schoffit |
reviews['critic'] = 'everyone'
reviews['critic']
0 everyone
1 everyone
...
129969 everyone
129970 everyone
Name: critic, Length: 129971, dtype: object
reviews['index_backwards'] = range(len(reviews), 0, -1)
reviews['index_backwards']
0 129971
1 129970
...
129969 2
129970 1
Name: index_backwards, Length: 129971, dtype: int64