From d3898a7dd490f9f9240b4cfb7f97449d36f4b0c5 Mon Sep 17 00:00:00 2001 From: shivam Date: Thu, 4 Oct 2018 15:20:40 +0530 Subject: [PATCH 1/3] added some changes --- ipl.ipynb | 180 +++++++++++++++++------------------------------------- 1 file changed, 55 insertions(+), 125 deletions(-) diff --git a/ipl.ipynb b/ipl.ipynb index e455232..acec8b8 100644 --- a/ipl.ipynb +++ b/ipl.ipynb @@ -2,25 +2,25 @@ "cells": [ { "cell_type": "code", - "execution_count": 4, + "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", - "\n", "\n", " \n", @@ -1658,7 +1658,7 @@ "58 S Ravi NaN " ] }, - "execution_count": 4, + "execution_count": 1, "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": 2, "metadata": {}, "outputs": [ { @@ -1709,16 +1709,16 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "57.6271186440678" + "0" ] }, - "execution_count": 58, + "execution_count": 3, "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,8 @@ }, { "cell_type": "code", - "execution_count": 66, - "metadata": { - "collapsed": true - }, + "execution_count": 6, + "metadata": {}, "outputs": [], "source": [ "#it was Rising Pune Supergiants and Mumbai Indians who reached the finals." @@ -1842,10 +1840,8 @@ }, { "cell_type": "code", - "execution_count": 77, - "metadata": { - "collapsed": true - }, + "execution_count": 7, + "metadata": {}, "outputs": [], "source": [ "#answer is 1" @@ -1853,79 +1849,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 +1865,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -1948,7 +1874,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -1957,16 +1883,24 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 10, "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": 10, "metadata": {}, "output_type": "execute_result" } @@ -1978,10 +1912,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 +1922,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" } @@ -2010,10 +1942,8 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "execution_count": 13, + "metadata": {}, "outputs": [], "source": [ "#47.45762711864407 is the percenaage of matches won, fielding first.\n" @@ -2022,21 +1952,21 @@ ], "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, From b30af95a4d0ed363150468224a07c5a6d4b51fd6 Mon Sep 17 00:00:00 2001 From: shivam shandilya Date: Thu, 4 Oct 2018 23:55:58 +0530 Subject: [PATCH 2/3] data_science_ipl --- ipl.ipynb | 246 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 235 insertions(+), 11 deletions(-) diff --git a/ipl.ipynb b/ipl.ipynb index acec8b8..b5e7a20 100644 --- a/ipl.ipynb +++ b/ipl.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -1658,7 +1658,7 @@ "58 S Ravi NaN " ] }, - "execution_count": 1, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -1681,7 +1681,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -1709,7 +1709,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -1718,7 +1718,7 @@ "0" ] }, - "execution_count": 3, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -1822,6 +1822,183 @@ "last_match[['team1','team2']] #we need to pass a list" ] }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
idseasoncitydateteam1team2toss_winnertoss_decisionresultdl_appliedwinnerwin_by_runswin_by_wicketsplayer_of_matchvenueumpire1umpire2umpire3
55562017Mumbai2017-05-16Rising Pune SupergiantMumbai IndiansMumbai Indiansfieldnormal0Rising Pune Supergiant200Washington SundarWankhede StadiumS RaviC ShamshuddinNaN
56572017Bangalore2017-05-17Sunrisers HyderabadKolkata Knight RidersKolkata Knight Ridersfieldnormal1Kolkata Knight Riders07NM Coulter-NileM Chinnaswamy StadiumAK ChaudharyNitin MenonNaN
57582017Bangalore2017-05-19Kolkata Knight RidersMumbai IndiansMumbai Indiansfieldnormal0Mumbai Indians06KV SharmaM Chinnaswamy StadiumNJ LlongNitin MenonNaN
58592017Hyderabad2017-05-21Mumbai IndiansRising Pune SupergiantMumbai Indiansbatnormal0Mumbai Indians10KH PandyaRajiv Gandhi International Stadium, UppalNJ LlongS RaviNaN
\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, @@ -1865,7 +2042,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -1874,7 +2051,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -1883,7 +2060,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -1900,7 +2077,7 @@ "28" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -1942,12 +2119,59 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "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": { From 3b317f5f2c5f4a60501ffc54e917400434283ec4 Mon Sep 17 00:00:00 2001 From: shivamshandilya108 <32788102+shivamshandilya108@users.noreply.github.com> Date: Mon, 21 Oct 2019 19:39:35 +0530 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.