diff --git a/README.md b/README.md
index 94f71ed..ee4aa81 100644
--- a/README.md
+++ b/README.md
@@ -1 +1 @@
-This repository is about Data analysis using Python.
+This repository is about Data Analysis using Python.
diff --git a/ipl.ipynb b/ipl.ipynb
index e455232..b5e7a20 100644
--- a/ipl.ipynb
+++ b/ipl.ipynb
@@ -2,25 +2,25 @@
"cells": [
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
- "\n",
"
\n",
" \n",
@@ -1658,7 +1658,7 @@
"58 S Ravi NaN "
]
},
- "execution_count": 4,
+ "execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
@@ -1666,7 +1666,7 @@
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
- "df=pd.read_csv(\"/Users/pswaldia1/Downloads/ipl/matches.csv\")\n",
+ "df=pd.read_csv(\"matches.csv\")\n",
"df\n",
"df=df[df['season']==2017] #to only show show ipl season 2017 records.df\n",
"df"
@@ -1681,7 +1681,7 @@
},
{
"cell_type": "code",
- "execution_count": 57,
+ "execution_count": 22,
"metadata": {},
"outputs": [
{
@@ -1709,16 +1709,16 @@
},
{
"cell_type": "code",
- "execution_count": 58,
+ "execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "57.6271186440678"
+ "0"
]
},
- "execution_count": 58,
+ "execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
@@ -1741,7 +1741,7 @@
},
{
"cell_type": "code",
- "execution_count": 63,
+ "execution_count": 4,
"metadata": {},
"outputs": [
{
@@ -1751,7 +1751,7 @@
"Name: winner, dtype: object"
]
},
- "execution_count": 63,
+ "execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
@@ -1770,25 +1770,25 @@
},
{
"cell_type": "code",
- "execution_count": 65,
+ "execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
- "\n",
"
\n",
" \n",
@@ -1813,7 +1813,7 @@
"58 Mumbai Indians Rising Pune Supergiant"
]
},
- "execution_count": 65,
+ "execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
@@ -1824,10 +1824,185 @@
},
{
"cell_type": "code",
- "execution_count": 66,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 8,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " id | \n",
+ " season | \n",
+ " city | \n",
+ " date | \n",
+ " team1 | \n",
+ " team2 | \n",
+ " toss_winner | \n",
+ " toss_decision | \n",
+ " result | \n",
+ " dl_applied | \n",
+ " winner | \n",
+ " win_by_runs | \n",
+ " win_by_wickets | \n",
+ " player_of_match | \n",
+ " venue | \n",
+ " umpire1 | \n",
+ " umpire2 | \n",
+ " umpire3 | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 55 | \n",
+ " 56 | \n",
+ " 2017 | \n",
+ " Mumbai | \n",
+ " 2017-05-16 | \n",
+ " Rising Pune Supergiant | \n",
+ " Mumbai Indians | \n",
+ " Mumbai Indians | \n",
+ " field | \n",
+ " normal | \n",
+ " 0 | \n",
+ " Rising Pune Supergiant | \n",
+ " 20 | \n",
+ " 0 | \n",
+ " Washington Sundar | \n",
+ " Wankhede Stadium | \n",
+ " S Ravi | \n",
+ " C Shamshuddin | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 56 | \n",
+ " 57 | \n",
+ " 2017 | \n",
+ " Bangalore | \n",
+ " 2017-05-17 | \n",
+ " Sunrisers Hyderabad | \n",
+ " Kolkata Knight Riders | \n",
+ " Kolkata Knight Riders | \n",
+ " field | \n",
+ " normal | \n",
+ " 1 | \n",
+ " Kolkata Knight Riders | \n",
+ " 0 | \n",
+ " 7 | \n",
+ " NM Coulter-Nile | \n",
+ " M Chinnaswamy Stadium | \n",
+ " AK Chaudhary | \n",
+ " Nitin Menon | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 57 | \n",
+ " 58 | \n",
+ " 2017 | \n",
+ " Bangalore | \n",
+ " 2017-05-19 | \n",
+ " Kolkata Knight Riders | \n",
+ " Mumbai Indians | \n",
+ " Mumbai Indians | \n",
+ " field | \n",
+ " normal | \n",
+ " 0 | \n",
+ " Mumbai Indians | \n",
+ " 0 | \n",
+ " 6 | \n",
+ " KV Sharma | \n",
+ " M Chinnaswamy Stadium | \n",
+ " NJ Llong | \n",
+ " Nitin Menon | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 58 | \n",
+ " 59 | \n",
+ " 2017 | \n",
+ " Hyderabad | \n",
+ " 2017-05-21 | \n",
+ " Mumbai Indians | \n",
+ " Rising Pune Supergiant | \n",
+ " Mumbai Indians | \n",
+ " bat | \n",
+ " normal | \n",
+ " 0 | \n",
+ " Mumbai Indians | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " KH Pandya | \n",
+ " Rajiv Gandhi International Stadium, Uppal | \n",
+ " NJ Llong | \n",
+ " S Ravi | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " id season city date team1 \\\n",
+ "55 56 2017 Mumbai 2017-05-16 Rising Pune Supergiant \n",
+ "56 57 2017 Bangalore 2017-05-17 Sunrisers Hyderabad \n",
+ "57 58 2017 Bangalore 2017-05-19 Kolkata Knight Riders \n",
+ "58 59 2017 Hyderabad 2017-05-21 Mumbai Indians \n",
+ "\n",
+ " team2 toss_winner toss_decision result \\\n",
+ "55 Mumbai Indians Mumbai Indians field normal \n",
+ "56 Kolkata Knight Riders Kolkata Knight Riders field normal \n",
+ "57 Mumbai Indians Mumbai Indians field normal \n",
+ "58 Rising Pune Supergiant Mumbai Indians bat normal \n",
+ "\n",
+ " dl_applied winner win_by_runs win_by_wickets \\\n",
+ "55 0 Rising Pune Supergiant 20 0 \n",
+ "56 1 Kolkata Knight Riders 0 7 \n",
+ "57 0 Mumbai Indians 0 6 \n",
+ "58 0 Mumbai Indians 1 0 \n",
+ "\n",
+ " player_of_match venue \\\n",
+ "55 Washington Sundar Wankhede Stadium \n",
+ "56 NM Coulter-Nile M Chinnaswamy Stadium \n",
+ "57 KV Sharma M Chinnaswamy Stadium \n",
+ "58 KH Pandya Rajiv Gandhi International Stadium, Uppal \n",
+ "\n",
+ " umpire1 umpire2 umpire3 \n",
+ "55 S Ravi C Shamshuddin NaN \n",
+ "56 AK Chaudhary Nitin Menon NaN \n",
+ "57 NJ Llong Nitin Menon NaN \n",
+ "58 NJ Llong S Ravi NaN "
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "qualifiers_team_matches = df.tail(4)\n",
+ "qualifiers_team_matches"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
"outputs": [],
"source": [
"#it was Rising Pune Supergiants and Mumbai Indians who reached the finals."
@@ -1842,10 +2017,8 @@
},
{
"cell_type": "code",
- "execution_count": 77,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 7,
+ "metadata": {},
"outputs": [],
"source": [
"#answer is 1"
@@ -1853,79 +2026,9 @@
},
{
"cell_type": "code",
- "execution_count": 75,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "0 False\n",
- "1 False\n",
- "2 False\n",
- "3 False\n",
- "4 False\n",
- "5 False\n",
- "6 False\n",
- "7 False\n",
- "8 False\n",
- "9 False\n",
- "10 False\n",
- "11 False\n",
- "12 False\n",
- "13 False\n",
- "14 False\n",
- "15 False\n",
- "16 False\n",
- "17 False\n",
- "18 False\n",
- "19 False\n",
- "20 False\n",
- "21 False\n",
- "22 False\n",
- "23 False\n",
- "24 False\n",
- "25 False\n",
- "26 False\n",
- "27 False\n",
- "28 False\n",
- "29 False\n",
- "30 False\n",
- "31 False\n",
- "32 False\n",
- "33 False\n",
- "34 False\n",
- "35 False\n",
- "36 False\n",
- "37 False\n",
- "38 False\n",
- "39 False\n",
- "40 False\n",
- "41 False\n",
- "42 False\n",
- "43 False\n",
- "44 False\n",
- "45 False\n",
- "46 False\n",
- "47 False\n",
- "48 False\n",
- "49 False\n",
- "50 False\n",
- "51 False\n",
- "52 False\n",
- "53 False\n",
- "54 False\n",
- "55 False\n",
- "56 True\n",
- "57 False\n",
- "58 False\n",
- "Name: dl_applied, dtype: bool"
- ]
- },
- "execution_count": 75,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": []
},
{
@@ -1939,7 +2042,7 @@
},
{
"cell_type": "code",
- "execution_count": 29,
+ "execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
@@ -1948,7 +2051,7 @@
},
{
"cell_type": "code",
- "execution_count": 22,
+ "execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
@@ -1957,16 +2060,24 @@
},
{
"cell_type": "code",
- "execution_count": 26,
+ "execution_count": 11,
"metadata": {},
"outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "/home/shivam/anaconda2/lib/python2.7/site-packages/ipykernel_launcher.py:1: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
+ " \"\"\"Entry point for launching an IPython kernel.\n"
+ ]
+ },
{
"data": {
"text/plain": [
"28"
]
},
- "execution_count": 26,
+ "execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
@@ -1978,10 +2089,8 @@
},
{
"cell_type": "code",
- "execution_count": 27,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 14,
+ "metadata": {},
"outputs": [],
"source": [
"#28 is the number of matches won fielding first\n",
@@ -1990,16 +2099,16 @@
},
{
"cell_type": "code",
- "execution_count": 28,
+ "execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "47.45762711864407"
+ "0"
]
},
- "execution_count": 28,
+ "execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
@@ -2011,32 +2120,77 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [],
"source": [
- "#47.45762711864407 is the percenaage of matches won, fielding first.\n"
+ "# highest win by margin(run and wicket respectively)"
]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "146"
+ ]
+ },
+ "execution_count": 24,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df['win_by_runs'].max()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "10"
+ ]
+ },
+ "execution_count": 25,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df['win_by_wickets'].max()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
}
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "Python 2",
"language": "python",
- "name": "python3"
+ "name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 3
+ "version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.6.3"
+ "pygments_lexer": "ipython2",
+ "version": "2.7.15"
}
},
"nbformat": 4,