From d2b6f1cda2d3d8b498a8b8a7a516cb76a2b9562c Mon Sep 17 00:00:00 2001
From: Prabhu Ramachandran
Date: Fri, 19 Jul 2019 00:57:23 +0530
Subject: Adding pandas related content.
---
cbse/data/sslc_small.csv | 41 +++
cbse/pandas.ipyml | 876 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 917 insertions(+)
create mode 100644 cbse/data/sslc_small.csv
create mode 100644 cbse/pandas.ipyml
diff --git a/cbse/data/sslc_small.csv b/cbse/data/sslc_small.csv
new file mode 100644
index 0000000..79dad21
--- /dev/null
+++ b/cbse/data/sslc_small.csv
@@ -0,0 +1,41 @@
+region;roll_number;name;fl;sl;math;sci;ss;total;pass;withheld;extra
+A;010001;T N;053;036;28;16;44;177;;;
+A;010002;A R;058;037;42;35;40;212;P;;
+A;010003;A M;072;056;71;55;70;324;P;;
+A;010004;S A;087;064;83;58;65;357;P;;
+A;010005;N A;059;045;50;35;48;237;P;;
+A;010006;A S;044;037;25;18;37;161;;;
+A;010007;G M;062;046;49;36;44;237;P;;
+A;010008;J R;087;071;97;71;81;407;P;;
+A;010009;J K;043;040;45;35;35;198;P;;
+B;019495;KARTHIK K;081;050;80;53;69;333;P;;
+B;019496;MARI SELVI V;046;036;38;35;44;199;P;;
+B;019497;AROCKIA ARUL JESURAJ A;089;063;98;86;95;431;P;;
+B;019498;MOHAMEDDHARICK S;069;036;35;36;51;227;P;;
+B;019499;SATHISHKUMAR V;077;057;61;53;78;326;P;;
+B;019500;MARIMUTHU P;089;071;92;78;88;418;P;;
+B;019501;JEYANDHIRA T;080;057;66;37;61;301;P;;
+B;019502;VAIRA MUTHU M;078;049;41;53;74;295;P;;
+B;019503;SARAVANAKUMAR C;073;044;50;53;72;292;P;;
+C;199976;SEKAR S;065;053;43;18;59;238;;;
+C;027394;RANI K;090;088;100;83;95;456;P;;
+C;027395;OMPRAKASH B;081;075;100;69;88;413;P;;
+C;027396;MAREESWARI V;075;059;84;48;58;324;P;;
+C;027397;MOHAMED SHAHUL HAMEED B;086;082;99;64;83;414;P;;
+C;027398;RAJA PON SUGANTHI T;057;044;50;45;58;254;P;;
+C;027399;RAJASINGAM P;086;090;96;82;97;451;P;;
+C;027400;AZHAGURANI M;075;075;57;57;67;331;P;;
+C;027401;MUTHU LAKSHMI B;061;040;38;40;35;214;P;;
+C;027402;RANJITHA G;085;077;79;50;66;357;P;;
+C;027403;REGINA R;076;070;89;51;67;353;P;;
+C;027404;AMALA P;062;044;51;47;46;250;P;;
+C;027405;SHEEBA P;089;085;99;83;95;451;P;;
+D;034890;PRABAKARAN S;074;047;44;53;53;271;P;;
+D;034891;SABURAL BARVIN J;066;043;78;35;60;282;P;;
+D;034892;AJITHA M;072;041;47;51;50;261;P;;
+D;034893;NAGALAKSHMI M;085;075;99;81;76;416;P;;
+D;034894;NITHYA R;072;054;62;59;60;307;P;;
+D;034895;SIVAKUMAR G;076;047;46;43;62;274;P;;
+D;034896;GOMATHI K;077;055;86;49;55;322;P;;
+D;034897;MEENAKSHI V;072;050;43;55;50;270;P;;
+D;034898;MEENAKSHI M;080;066;76;67;64;353;P;;
diff --git a/cbse/pandas.ipyml b/cbse/pandas.ipyml
new file mode 100644
index 0000000..60b115e
--- /dev/null
+++ b/cbse/pandas.ipyml
@@ -0,0 +1,876 @@
+cells:
+
+- markdown: |
+ Pandas
+ ======
+
+ - Provides a powerful `DataFrame` object.
+ - Makes it easy to deal with "Tabular" data.
+ - Very easy to read, process and visualize data.
+ - See http://pandas.pydata.org
+
+
+- code: |
+ %matplotlib inline
+ import numpy as np
+ import pandas as pd
+
+ id: 0
+
+- code: |
+ x = np.linspace(0, 2*np.pi, 100)
+ sin = np.sin(x)
+ cos = np.cos(x)
+
+ id: 1
+
+- code: |
+ df = pd.DataFrame({'x': x, 'sin': sin, 'cos': cos, 'x-data':x})
+ # OR
+ #df = pd.DataFrame(dict(x=x, sin=sin, cos=cos))
+
+ id: 2
+
+- code: |
+ df.head() # or df.tail()
+
+ id: 3
+
+- code: |
+ df.tail()
+
+ id: 4
+
+- code: |
+ df.describe()
+
+ id: 5
+
+- code: |
+ df1 = df[10:13]
+ df1.head()
+
+ id: 6
+
+- code: |
+ df.x[::10]
+
+ id: 7
+
+- code: |
+ df1.describe()
+
+ id: 8
+
+- code: |
+ # df.x-data[:5] will not work!!
+ df['x-data'][:5]
+
+ id: 9
+
+- code: |
+ df['x'][:5]
+
+ id: 10
+
+- code: |
+ df.x[:10]
+
+ id: 11
+
+- code: |
+ df.columns
+
+ id: 12
+
+- code: |
+ len(df)
+
+ id: 13
+
+- code: |
+ df.index
+
+ id: 14
+
+- code: |
+ df1 = df.copy()
+ df1.head()
+
+ id: 15
+
+- markdown: |
+ Indexing
+ =========
+
+ - Give me a data frame, where all cosine values are >0.
+
+
+- code: |
+ y = np.linspace(10, 11, 11)
+ y
+
+ id: 16
+
+- code: |
+ y> 10.5
+
+ id: 17
+
+- code: |
+ cond = y > 10.5
+ y[y > 10.7]
+
+ id: 18
+
+- code: |
+
+
+ id: 19
+
+- code: |
+
+
+ id: 20
+
+- code: |
+
+
+ id: 21
+
+- code: |
+ condition = df.cos > 0.0
+ print(len(condition))
+
+ id: 22
+
+- code: |
+ df_positive_cos = df[condition]
+ df_positive_cos.describe()
+
+ id: 23
+
+- code: |
+ # Combining conditionals
+ cond1 = df.sin > 0.0
+ df_all_positive = df[condition & cond1]
+ df_all_positive.describe()
+
+ id: 24
+
+- code: |
+ df_all_positive = df[(df.cos > 0.0) & (df.sin > 0)]
+ df_all_positive.describe()
+
+ id: 25
+
+- code: |
+ c = np.array([True, False, True, False])
+ c1 = np.array([False, True, False, False])
+ ~(c | c1)
+
+ id: 26
+
+- code: |
+ cond1 = df_positive_cos.sin > 0.0
+ df_all_positive = df_positive_cos[cond1]
+ df_all_positive.describe()
+
+ id: 27
+
+- code: |
+
+
+ id: 28
+
+- code: |
+ # This adds a new column sincos
+ df['sincos'] = df.sin*df.cos
+ len(df.sincos)
+
+ id: 29
+
+- code: |
+ df.describe()
+
+ id: 30
+
+- code: |
+ # Remove a column with del.
+ if 'x-data' in df:
+ del df['x-data']
+ df.head()
+
+ id: 31
+
+- markdown: |
+ Plotting
+ =========
+
+
+- code: |
+ df.plot()
+ # or
+ #df.plot.line()
+
+ id: 32
+
+- markdown: |
+ Notice that everything is plotted w.r.t. the index!
+ Let us fix this!
+
+
+- code: |
+ df.plot.line(x='x', y=['sin', 'cos'])
+
+ id: 33
+
+- code: |
+ # See what this does
+
+ df[(df.sin > 0.0) ^ (df.cos < 0.0)].plot.line(x='x', marker='o')
+
+ id: 34
+
+- code: |
+ df.plot.hist(y='cos')
+ # or
+ #df.plot(y='cos', kind='hist')
+
+ id: 35
+
+- markdown: |
+ Input and output CSV and other file formats
+ --------------------------------------------
+
+ - `pd.read_csv()`
+ - `df.to_csv()`
+ - Can read/save to clip board.
+ - Directly read from URLs.
+
+
+- code: |
+ df.to_csv('sincos.csv', index=False)
+
+ id: 36
+
+- code: |
+ df1 = pd.read_csv('sincos.csv')
+ df1.head()
+
+ id: 37
+
+- code: |
+
+
+ id: 38
+
+- code: |
+
+
+ id: 39
+
+- markdown: |
+ ### Conversion to LaTeX and HTML
+
+
+- code: |
+ print(df[:5].to_latex())
+
+ id: 40
+
+- code: |
+ print(df[:5].to_latex(index=False))
+
+ id: 41
+
+- code: |
+ print(df[:5].to_html())
+
+ id: 42
+
+- code: |
+ from IPython.display import HTML
+ HTML(df[:5].to_html())
+
+ id: 43
+
+- markdown: |
+ Selecting from the clipboard
+ =============================
+
+ - Let us select data from wikipedia:
+ - https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(nominal)_per_capita
+
+ Select some data and then do this:
+
+
+- code: |
+ df2 = pd.read_clipboard()
+ df2.columns = ['index', 'country', 'GDP']
+ df2.head()
+
+ id: 44
+
+- code: |
+ url = 'http://www.aero.iitb.ac.in/~prabhu/tmp/sslc_small.csv'
+ df = pd.read_csv(url, sep=';')
+
+ id: 45
+
+- code: |
+ df.head()
+ #df.describe()
+
+ id: 46
+
+- code: |
+ df.fl.iloc[0] = np.nan
+
+ id: 47
+
+- code: |
+ df.head()
+
+ id: 48
+
+- code: |
+ df.describe()
+
+ id: 49
+
+- code: |
+ pd.read_csv?
+
+ id: 50
+
+- markdown: |
+ Exercise
+ --------
+
+ Look at the following:
+
+ - https://data.gov.in/catalog/annual-and-seasonal-maximum-temperature-india
+ - https://data.gov.in/catalog/annual-and-seasonal-minimum-temperature-india
+
+
+ Download the csv file into a `datafile.csv` on your machine.
+
+
+- code: |
+ df = pd.read_csv('datafile.csv')
+ df.head()
+
+ id: 51
+
+- code: |
+ df.plot.line(x='YEAR')
+
+ id: 52
+
+- code: |
+
+
+ id: 53
+
+- markdown: |
+ Exercise
+ ---------
+
+
+ Consider a smaller file:
+
+ - File is at: http://www.aero.iitb.ac.in/~prabhu/tmp/sslc_small.csv
+
+
+- code: |
+ url = 'http://www.aero.iitb.ac.in/~prabhu/tmp/sslc_small.csv'
+ df = pd.read_csv(url)
+ df.head() # Produces only one strange column of data!
+
+ id: 54
+
+- markdown: |
+ Notice that this data is read incorrectly, this is because the separator is not a comma but a ';' so use this.
+
+
+- code: |
+ df = pd.read_csv(url, sep=';')
+ df.head()
+
+ id: 55
+
+- code: |
+ df['region'].value_counts()
+
+ id: 56
+
+- code: |
+ df.plot.scatter(x='fl', y='math')
+
+ id: 57
+
+- markdown: |
+ There are more options to `pd.read_csv`, for example if `'AA'` is a value indicating a non-existing value you can pass an option, called `na_values`. Read more on the documentation for `read_csv`.
+
+
+- code: |
+ url = 'http://www.aero.iitb.ac.in/~prabhu/tmp/sslc1.csv.gz'
+
+ id: 58
+
+- markdown: |
+ - This has a very large CSV file that is gzipped to save space.
+ - It can be loaded with the same method.
+ - You can download it and see the file.
+
+ To unzip it if you want you can do
+
+ ```
+ $ gunzip sslc1.csv.gz
+ ```
+
+ The file has missing values in the form of 'AA' entries for absent students.
+
+
+- code: |
+ df = pd.read_csv(url, sep=';', na_values='AA')
+
+ id: 59
+
+- markdown: |
+ If you have the `sslc1.csv` file locally you can do this:
+
+
+- code: |
+ df = pd.read_csv('sslc1.csv', sep=';', na_values='AA')
+ df.head()
+
+ id: 60
+
+- code: |
+ df.describe()
+
+ id: 61
+
+- code: |
+ df['pass'].value_counts()
+
+ id: 62
+
+- code: |
+ df.groupby('region')['pass'].value_counts()
+
+ id: 63
+
+- code: |
+ df.plot.hist(y='sl')
+
+ id: 64
+
+- markdown: |
+ ## Pivoting
+
+ - Powerful operation to group the data
+ - Performs a multi-dimensional summarization of the data
+
+ Here is a simple example
+
+
+- code: |
+ pd.pivot_table(df, index=['region'])
+
+ id: 65
+
+- markdown: |
+ The default aggregation function here is an average, i.e. `np.average`.
+
+
+- code: |
+ # This is not useful but tells you how this can be changed.
+ pd.pivot_table(df, index=['region'], aggfunc=np.sum)
+
+ id: 66
+
+- markdown: |
+ More information
+ ==================
+
+ - http://pandas.pydata.org
+ - Go through the tutorials here:
+
+ http://nbviewer.jupyter.org/github/jvns/pandas-cookbook/tree/v0.1/cookbook/
+
+ - Go over chapter 1 to 7.
+
+ Excellent material on pivot tables with pandas
+
+ - https://pbpython.com/pandas-pivot-table-explained.html
+
+ An excellent book on data science related tools has a nice section on pivot tables.
+
+ - https://jakevdp.github.io/PythonDataScienceHandbook/03.09-pivot-tables.html
+
+ Also has other material on pandas
+
+ - https://jakevdp.github.io/PythonDataScienceHandbook/03.00-introduction-to-pandas.html
+
+ The notebooks can also be edited live if you wish.
+
+
+- code: |
+
+
+ id: 67
+
+# The lines below here may be deleted if you do not need them.
+# ---------------------------------------------------------------------------
+metadata:
+ kernelspec:
+ display_name: Python 3
+ language: python
+ name: python3
+ language_info:
+ codemirror_mode:
+ name: ipython
+ version: 3
+ file_extension: .py
+ mimetype: text/x-python
+ name: python
+ nbconvert_exporter: python
+ pygments_lexer: ipython3
+ version: 3.6.0
+nbformat: 4
+nbformat_minor: 1
+
+# ---------------------------------------------------------------------------
+data:
+ [{execution_count: 1, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: null, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: null, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: null, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: null, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: null, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: null, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: null, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: null, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: 56, outputs: []}, {execution_count: 62, outputs: [{data: {text/html: "
\n\
+ \n
\n \n\
+ \
\n
\n
region
\n\
+ \
roll_number
\n
name
\n
fl
\n\
+ \
sl
\n
math
\n
sci
\n
ss
\n\
+ \
total
\n
pass
\n
withheld
\n\
+ \
extra
\n
\n \n \n
\n \
+ \
0
\n
A
\n
10001
\n
T N
\n\
+ \
53
\n
36
\n
28
\n
16
\n\
+ \
44
\n
177
\n
NaN
\n
NaN
\n\
+ \
NaN
\n
\n
\n
1
\n
A
\n\
+ \
10002
\n
A R
\n
58
\n
37
\n\
+ \
42
\n
35
\n
40
\n
212
\n\
+ \
P
\n
NaN
\n
NaN
\n
\n\
+ \
\n
2
\n
A
\n
10003
\n\
+ \
A M
\n
72
\n
56
\n
71
\n\
+ \
55
\n
70
\n
324
\n
P
\n\
+ \
NaN
\n
NaN
\n
\n
\n
3
\n\
+ \
A
\n
10004
\n
S A
\n
87
\n\
+ \
64
\n
83
\n
58
\n
65
\n\
+ \
357
\n
P
\n
NaN
\n
NaN
\n\
+ \
\n
\n
4
\n
A
\n
10005
\n\
+ \
N A
\n
59
\n
45
\n
50
\n\
+ \
35
\n
48
\n
237
\n
P
\n\
+ \
NaN
\n
NaN
\n
\n \n
\n\
+
", text/plain: ' region roll_number name fl sl math sci ss total
+ pass withheld extra
+
+ 0 A 10001 T N 53 36 28 16 44 177 NaN NaN NaN
+
+ 1 A 10002 A R 58 37 42 35 40 212 P NaN NaN
+
+ 2 A 10003 A M 72 56 71 55 70 324 P NaN NaN
+
+ 3 A 10004 S A 87 64 83 58 65 357 P NaN NaN
+
+ 4 A 10005 N A 59 45 50 35 48 237 P NaN NaN'},
+ execution_count: 62, metadata: {}, output_type: execute_result}]}, {execution_count: 66,
+ outputs: []}, {execution_count: 68, outputs: [{data: {text/html: "
\n\n
\n \n\
+ \
\n
\n
region
\n\
+ \
roll_number
\n
name
\n
fl
\n\
+ \
sl
\n
math
\n
sci
\n
ss
\n\
+ \
total
\n
pass
\n
withheld
\n\
+ \
extra
\n
\n \n \n
\n \
+ \
0
\n
A
\n
10001
\n
T N
\n\
+ \
NaN
\n
36
\n
28
\n
16
\n\
+ \
44
\n
177
\n
NaN
\n
NaN
\n\
+ \
NaN
\n
\n
\n
1
\n
A
\n\
+ \
10002
\n
A R
\n
58.0
\n \
+ \
37
\n
42
\n
35
\n
40
\n\
+ \
212
\n
P
\n
NaN
\n
NaN
\n\
+ \
\n
\n
2
\n
A
\n
10003
\n\
+ \
A M
\n
72.0
\n
56
\n
71
\n\
+ \
55
\n
70
\n
324
\n
P
\n\
+ \
NaN
\n
NaN
\n
\n
\n
3
\n\
+ \
A
\n
10004
\n
S A
\n
87.0
\n\
+ \
64
\n
83
\n
58
\n
65
\n\
+ \
357
\n
P
\n
NaN
\n
NaN
\n\
+ \
\n
\n
4
\n
A
\n
10005
\n\
+ \
N A
\n
59.0
\n
45
\n
50
\n\
+ \
35
\n
48
\n
237
\n
P
\n\
+ \
NaN
\n
NaN
\n
\n \n
\n\
+
", text/plain: " region roll_number name fl sl math sci\
+ \ ss total pass withheld \\\n0 A 10001 T N NaN 36\
+ \ 28 16 44 177 NaN NaN \n1 A 10002 A R\
+ \ 58.0 37 42 35 40 212 P NaN \n2 A 10003\
+ \ A M 72.0 56 71 55 70 324 P NaN \n3 A \
+ \ 10004 S A 87.0 64 83 58 65 357 P NaN \n4\
+ \ A 10005 N A 59.0 45 50 35 48 237 P \
+ \ NaN \n\n extra \n0 NaN \n1 NaN \n2 NaN \n3 NaN \
+ \ \n4 NaN "}, execution_count: 68, metadata: {}, output_type: execute_result}]},
+ {execution_count: 67, outputs: [{data: {text/html: "
\n\n\
+
\n \n
\n
\n
roll_number
\n \
+ \
fl
\n
sl
\n
math
\n
sci
\n\
+ \
ss
\n
total
\n
withheld
\n \
+ \
extra
\n
\n \n \n
\n \
+ \
count
\n
40.000000
\n
39.000000
\n\
+ \
40.000000
\n
40.000000
\n
40.000000
\n\
+ \
40.000000
\n
40.000000
\n
0.0
\n\
+ \
0.0
\n
\n
\n
mean
\n
27708.800000
\n\
+ \
73.230769
\n
56.375000
\n
65.425000
\n\
+ \
51.825000
\n
63.500000
\n
309.850000
\n\
+ \
NaN
\n
NaN
\n
\n
\n
std
\n\
+ \
29338.523097
\n
12.616742
\n
15.903052
\n\
+ \
23.915329
\n
18.092196
\n
17.558693
\n\
+ \
81.745869
\n
NaN
\n
NaN
\n \
+ \
\n
\n
min
\n
10001.000000
\n\
+ \
43.000000
\n
36.000000
\n
25.000000
\n\
+ \
16.000000
\n
35.000000
\n
161.000000
\n\
+ \
NaN
\n
NaN
\n
\n
\n
25%
\n\
+ \
19495.750000
\n
65.500000
\n
44.000000
\n\
+ \
44.750000
\n
36.750000
\n
50.000000
\n\
+ \
247.000000
\n
NaN
\n
NaN
\n \
+ \
\n
\n
50%
\n
27395.500000
\n\
+ \
75.000000
\n
53.500000
\n
61.500000
\n\
+ \
52.000000
\n
61.500000
\n
304.000000
\n\
+ \
NaN
\n
NaN
\n
\n
\n
75%
\n\
+ \
29276.250000
\n
83.000000
\n
70.250000
\n\
+ \
86.750000
\n
60.250000
\n
74.500000
\n\
+ \
357.000000
\n
NaN
\n
NaN
\n \
+ \
\n
\n
max
\n
199976.000000
\n\
+ \
90.000000
\n
90.000000
\n
100.000000
\n\
+ \
86.000000
\n
97.000000
\n
456.000000
\n\
+ \
NaN
\n
NaN
\n
\n \n
\n\
+
", text/plain: " roll_number fl sl \
+ \ math sci ss \\\ncount 40.000000 39.000000 40.000000\
+ \ 40.000000 40.000000 40.000000 \nmean 27708.800000 73.230769\
+ \ 56.375000 65.425000 51.825000 63.500000 \nstd 29338.523097\
+ \ 12.616742 15.903052 23.915329 18.092196 17.558693 \nmin \
+ \ 10001.000000 43.000000 36.000000 25.000000 16.000000 35.000000\
+ \ \n25% 19495.750000 65.500000 44.000000 44.750000 36.750000\
+ \ 50.000000 \n50% 27395.500000 75.000000 53.500000 61.500000\
+ \ 52.000000 61.500000 \n75% 29276.250000 83.000000 70.250000\
+ \ 86.750000 60.250000 74.500000 \nmax 199976.000000 90.000000\
+ \ 90.000000 100.000000 86.000000 97.000000 \n\n total\
+ \ withheld extra \ncount 40.000000 0.0 0.0 \nmean 309.850000\
+ \ NaN NaN \nstd 81.745869 NaN NaN \nmin 161.000000\
+ \ NaN NaN \n25% 247.000000 NaN NaN \n50% 304.000000\
+ \ NaN NaN \n75% 357.000000 NaN NaN \nmax 456.000000\
+ \ NaN NaN "}, execution_count: 67, metadata: {}, output_type: execute_result}]},
+ {execution_count: 69, outputs: []}, {execution_count: null, outputs: []}, {execution_count: null,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: 70, outputs: [
+ {data: {text/html: "
", text/plain: ' region roll_number name fl sl math sci ss total
+ pass withheld extra
+
+ 0 A 10001 T N 53 36 28 16 44 177 NaN NaN NaN
+
+ 1 A 10002 A R 58 37 42 35 40 212 P NaN NaN
+
+ 2 A 10003 A M 72 56 71 55 70 324 P NaN NaN
+
+ 3 A 10004 S A 87 64 83 58 65 357 P NaN NaN
+
+ 4 A 10005 N A 59 45 50 35 48 237 P NaN NaN'},
+ execution_count: 71, metadata: {}, output_type: execute_result}]}, {execution_count: 72,
+ outputs: [{data: {text/plain: 'C 13
+
+ B 9
+
+ A 9
+
+ D 9
+
+ Name: region, dtype: int64'}, execution_count: 72, metadata: {}, output_type: execute_result}]},
+ {execution_count: 73, outputs: [{data: {text/plain: }, execution_count: 73, metadata: {}, output_type: execute_result},
+ {data: {image/png: 'iVBORw0KGgoAAAANSUhEUgAAAYgAAAEKCAYAAAAIO8L1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAF+dJREFUeJzt3X+wXHd53/H3R5b824lsyWgcy4rNiDFJGazArQujwIANGaDUpoFQaDtVGTeaTgm/8ofs9I8SpnTGZjKlZDJDRsGlog0Yx4Kxh7QMHgXSTjt1K2GjGBtiY2Jbxj8UxSY2ICHhp3/suda1urrau3f3nN2779fMnd09e/bus2f33me/z/fHSVUhSdKJVnUdgCRpMpkgJEl9mSAkSX2ZICRJfZkgJEl9mSAkSX2ZICRJfZkgJEl9mSAkSX2t7jqA5Vi/fn1deumlXYchSVNl3759f11VF55qv6lOEJdeeil79+7tOgxJmipJHh5kP0tMkqS+TBCSpL5MEJKkvkwQkqS+TBCSpL7GliCS/MckTyW5d8G2C5LcmeSB5vL8ZnuS/H6SB5PsT/KqccUlaWU69NwRvvXoMxx67kjXoYxdW691nMNc/xPwB8DnFmy7Ad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BSCOU5IPNqrOPJfmDruORlmP1qXeRtAT/it7s3zcBYz2hvDRutiCkEUnyh8BLgf8GrNjzM2h2mCCkEamqfwn8AHgjvfVypKlmgpAk9WWCkCT1ZYKQJPVlgpAk9eVqrpKkvmxBSJL6MkFIkvoyQUiS+jJBSJL6MkFIkvoyQUiS+jJBSJL6MkFIkvr6fxzn9LxPLj+7AAAAAElFTkSuQmCC
+
+ ', text/plain:
}, metadata: {needs_background: light},
+ output_type: display_data}]}, {execution_count: 3, outputs: []}, {execution_count: 4,
+ outputs: []}, {execution_count: null, outputs: []}, {execution_count: null, outputs: []},
+ {execution_count: 14, outputs: [{data: {text/plain: 'P 159072
+
+ Name: pass, dtype: int64'}, execution_count: 14, metadata: {}, output_type: execute_result}]},
+ {execution_count: 18, outputs: [{data: {text/plain: 'region pass
+
+ A P 31013
+
+ B P 36202
+
+ C P 26681
+
+ D P 22080
+
+ E P 20880
+
+ F P 22216
+
+ Name: pass, dtype: int64'}, execution_count: 18, metadata: {}, output_type: execute_result}]},
+ {execution_count: null, outputs: []}, {execution_count: 7, outputs: [{data: {text/html: "