Professional Documents
Culture Documents
Import As Import As: Numpy NP Pandas PD
Import As Import As: Numpy NP Pandas PD
In [7]:
import numpy as np
import pandas as pd
In [8]:
index = range(1,9)
ipl18
Out[8]:
Team Matches Won Lost Tied N/R Points NRR For Against
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/ipl.html?t=1635478039386 1/5
10/29/21, 8:57 AM temp-163547803842548496
In [9]:
index = range(1,9)
ipl17
Out[9]:
Team Matches Won Lost Tied N/R Points NRR For Against
Question-1: Suppose in ‘ipl18’, you want to filter out the teams that have an NRR
greater than zero, and for which the ‘For’ score exceeds the ‘Against’ score, i.e. both
the conditions should be satisfied. Which teams will be left after you perform the above
filtration?
a) CSK, MI
b) SRH,CSK, MI
c) SRH,CSK, RCB
d) SRK,CSK, MI,RCB
Answer-1: b)
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/ipl.html?t=1635478039386 2/5
10/29/21, 8:57 AM temp-163547803842548496
In [10]:
ipl18[ipl18["NRR"]>0]
Out[10]:
Team Matches Won Lost Tied N/R Points NRR For Against
In [11]:
ipl18[ipl18["For"]>ipl18["Against"]]
Out[11]:
Team Matches Won Lost Tied N/R Points NRR For Against
Question-2:
If all the stats are taken for both ‘ipl17’ and ‘ipl18’, which team with its total
points greater than 25 will have the highest win percentage?
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/ipl.html?t=1635478039386 3/5
10/29/21, 8:57 AM temp-163547803842548496
In [12]:
a = ipl17.append(ipl18)
Out[12]:
Team Matches Won Lost Tied N/R Points NRR For Against
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/ipl.html?t=1635478039386 4/5
10/29/21, 8:57 AM temp-163547803842548496
In [13]:
(b["Won"]/(b["Won"]+b["Lost"]))*100
c = b[b["Won"]+b["Lost"]>25]
d = (c["Won"]/(c["Won"]+c["Lost"]))*100
Out[13]:
Team
SRH 62.962963
KKR 57.142857
MI 57.142857
KXIP 46.428571
DD 39.285714
RCB 33.333333
dtype: float64
In [ ]:
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/ipl.html?t=1635478039386 5/5
10/29/21, 8:58 AM temp-163547810389052713
In [1]:
import pandas as pd
In [2]:
pd.set_option("display.max_rows", 5)
In [3]:
reviews.head()
Out[3]:
Aromas
include
tropical Vulkà Sicily &
0 Italy 87 NaN Etna
fruit, Bianco Sardinia
broom,
brimston...
This is ripe
and fruity, a
1 Portugal Avidagos 87 15.0 Douro NaN
wine that is
smooth...
Tart and
snappy, the
Willamette Willam
2 US flavors of NaN 87 14.0 Oregon
Valley V
lime flesh
and...
Pineapple
rind, lemon Reserve Lake
3 US pith and Late 87 13.0 Michigan Michigan
orange Harvest Shore
blossom ...
Much like
Vintner's
the regular
Reserve Willamette Willam
4 US bottling 87 65.0 Oregon
Wild Child Valley V
from 2012,
Block
this...
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/wine_reviews.html?t=1635478104336 1/5
10/29/21, 8:58 AM temp-163547810389052713
In [5]:
desc = reviews["description"]
desc
Out[5]:
...
In [6]:
first_description
Out[6]:
In [7]:
first_row = reviews["country"]
first_row
Out[7]:
0 Italy
1 Portugal
...
129969 France
129970 France
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/wine_reviews.html?t=1635478104336 2/5
10/29/21, 8:58 AM temp-163547810389052713
In [8]:
first_description
Out[8]:
...
In [9]:
sample_reviews
Out[9]:
This is ripe
and fruity, a
1 Portugal Avidagos 87 15.0 Douro NaN
wine that is
smooth...
Tart and
snappy, the
Willamette W
2 US flavors of NaN 87 14.0 Oregon
Valley
lime flesh
and...
Pineapple
rind, lemon Reserve Lake
3 US pith and Late 87 13.0 Michigan Michigan
orange Harvest Shore
blossom ...
Blackberry
and
raspberry Northern
5 Spain Ars In Vitro 87 15.0 Navarra
aromas Spain
show a
typical...
Savory
dried thyme
notes
8 Germany Shine 87 12.0 Rheinhessen NaN
accent
sunnier
flavor...
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/wine_reviews.html?t=1635478104336 3/5
10/29/21, 8:58 AM temp-163547810389052713
In [11]:
df
Out[11]:
In [13]:
df
Out[13]:
country variety
98 Italy Sangiovese
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/wine_reviews.html?t=1635478104336 4/5
10/29/21, 8:58 AM temp-163547810389052713
In [14]:
reviews[italian_wines]
Out[14]:
Aromas
include
tropical Vulkà Sicily &
0 Italy 87 NaN Etna
fruit, Bianco Sardinia
broom,
brimston...
Here's a
bright,
Sicily &
6 Italy informal red Belsito 87 16.0 Vittoria
Sardinia
that opens
with ...
Intense
aromas of
Sicily &
129961 Italy wild cherry, NaN 90 30.0 Sicilia
Sardinia
baking
spice, t...
Blackberry,
cassis, Sàgana
Sicily &
129962 Italy grilled herb Tenuta San 90 40.0 Sicilia
Sardinia
and toasted Giacomo
a...
In [ ]:
https://htmtopdf.herokuapp.com/ipynbviewer/temp/0cb7f8661c6fa22d6c0eeba5028265f8/wine_reviews.html?t=1635478104336 5/5
Solutions Files Link: