Skip to content

Commit 9c21856

Browse files
committed
Created using Colaboratory
1 parent 75beb5b commit 9c21856

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

Pandas_Tutorial.ipynb

+30-30
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "Pandas Tutorial.ipynb",
77
"provenance": [],
88
"collapsed_sections": [],
9-
"authorship_tag": "ABX9TyO8dbP1sfunTXTjSivB0W/Q",
9+
"authorship_tag": "ABX9TyMZ1qeD4j0AhLXdG2qW342F",
1010
"include_colab_link": true
1111
},
1212
"kernelspec": {
@@ -68,7 +68,7 @@
6868
"```\n",
6969
"!pip install pandas\n",
7070
"```\n",
71-
"and press enter to install library if not available in your workspace."
71+
"and press shift + enter to install library if not available in your workspace."
7272
]
7373
},
7474
{
@@ -88,7 +88,7 @@
8888
"source": [
8989
"import pandas as pd"
9090
],
91-
"execution_count": 4,
91+
"execution_count": null,
9292
"outputs": []
9393
},
9494
{
@@ -112,7 +112,7 @@
112112
"# df = pd.read_csv('Advertising.csv', index_col =\"TV\" ) # For custom index column\n",
113113
"#print(df)\n"
114114
],
115-
"execution_count": 5,
115+
"execution_count": null,
116116
"outputs": []
117117
},
118118
{
@@ -147,7 +147,7 @@
147147
"df.head()# By default, shows first 5 rows of data\n",
148148
"#df.tail()# By default, shows last 5 rows of data "
149149
],
150-
"execution_count": 6,
150+
"execution_count": null,
151151
"outputs": [
152152
{
153153
"output_type": "execute_result",
@@ -249,7 +249,7 @@
249249
"source": [
250250
"df.columns"
251251
],
252-
"execution_count": 7,
252+
"execution_count": null,
253253
"outputs": [
254254
{
255255
"output_type": "execute_result",
@@ -275,7 +275,7 @@
275275
"source": [
276276
"df.shape"
277277
],
278-
"execution_count": 8,
278+
"execution_count": null,
279279
"outputs": [
280280
{
281281
"output_type": "execute_result",
@@ -301,7 +301,7 @@
301301
"source": [
302302
"df.info()"
303303
],
304-
"execution_count": 9,
304+
"execution_count": null,
305305
"outputs": [
306306
{
307307
"output_type": "stream",
@@ -337,7 +337,7 @@
337337
"df.describe()\n",
338338
"# df.describe().T # For transpose view of the same"
339339
],
340-
"execution_count": 10,
340+
"execution_count": null,
341341
"outputs": [
342342
{
343343
"output_type": "execute_result",
@@ -467,7 +467,7 @@
467467
"df.isnull().values.any() # If any value is missing\n",
468468
"df.isnull().sum() # Total missing values"
469469
],
470-
"execution_count": 11,
470+
"execution_count": null,
471471
"outputs": [
472472
{
473473
"output_type": "execute_result",
@@ -508,7 +508,7 @@
508508
"df.drop([198,199], inplace =True) # rows with index labeled as 198 and 199 will be dropped\n",
509509
"df.shape"
510510
],
511-
"execution_count": 12,
511+
"execution_count": null,
512512
"outputs": [
513513
{
514514
"output_type": "execute_result",
@@ -536,7 +536,7 @@
536536
"df = df.drop(drop_list, axis=1)\n",
537537
"df.columns # Unnamed column will be dropped"
538538
],
539-
"execution_count": 13,
539+
"execution_count": null,
540540
"outputs": [
541541
{
542542
"output_type": "execute_result",
@@ -563,7 +563,7 @@
563563
"df.drop(df.columns[[0, 2]], axis = 1, inplace = True)\n",
564564
"df.columns "
565565
],
566-
"execution_count": 14,
566+
"execution_count": null,
567567
"outputs": [
568568
{
569569
"output_type": "execute_result",
@@ -599,7 +599,7 @@
599599
"df = pd.read_csv('Advertising.csv')\n",
600600
"print(df.head())"
601601
],
602-
"execution_count": 15,
602+
"execution_count": null,
603603
"outputs": [
604604
{
605605
"output_type": "stream",
@@ -638,7 +638,7 @@
638638
"data = df[['TV', 'radio']]\n",
639639
"data"
640640
],
641-
"execution_count": 16,
641+
"execution_count": null,
642642
"outputs": [
643643
{
644644
"output_type": "execute_result",
@@ -771,7 +771,7 @@
771771
"source": [
772772
"df.sort_values(['radio', 'TV'], ascending = False)# Set ascending true or false to get different order"
773773
],
774-
"execution_count": 17,
774+
"execution_count": null,
775775
"outputs": [
776776
{
777777
"output_type": "execute_result",
@@ -940,7 +940,7 @@
940940
"source": [
941941
"df[df.radio >= 49]# Can also use >,<, <=,=="
942942
],
943-
"execution_count": 18,
943+
"execution_count": null,
944944
"outputs": [
945945
{
946946
"output_type": "execute_result",
@@ -1053,7 +1053,7 @@
10531053
"source": [
10541054
"df[df['TV'].between(239,248)]"
10551055
],
1056-
"execution_count": 19,
1056+
"execution_count": null,
10571057
"outputs": [
10581058
{
10591059
"output_type": "execute_result",
@@ -1174,7 +1174,7 @@
11741174
"source": [
11751175
"df.query('239 <= TV <= 248')"
11761176
],
1177-
"execution_count": 20,
1177+
"execution_count": null,
11781178
"outputs": [
11791179
{
11801180
"output_type": "execute_result",
@@ -1295,7 +1295,7 @@
12951295
"source": [
12961296
"df[(df['TV'] >= 239) & (df['TV'] <= 248)]"
12971297
],
1298-
"execution_count": 21,
1298+
"execution_count": null,
12991299
"outputs": [
13001300
{
13011301
"output_type": "execute_result",
@@ -1425,7 +1425,7 @@
14251425
"source": [
14261426
"df.iloc[: , 0:3]"
14271427
],
1428-
"execution_count": 22,
1428+
"execution_count": null,
14291429
"outputs": [
14301430
{
14311431
"output_type": "execute_result",
@@ -1571,7 +1571,7 @@
15711571
"# use negative to exclude the last 3 columns\n",
15721572
"df.iloc[: , :-3]"
15731573
],
1574-
"execution_count": 23,
1574+
"execution_count": null,
15751575
"outputs": [
15761576
{
15771577
"output_type": "execute_result",
@@ -1704,7 +1704,7 @@
17041704
"source": [
17051705
"df.iloc[0:3 , :]"
17061706
],
1707-
"execution_count": 24,
1707+
"execution_count": null,
17081708
"outputs": [
17091709
{
17101710
"output_type": "execute_result",
@@ -1798,7 +1798,7 @@
17981798
"source": [
17991799
"df.iloc[:-3 , :]"
18001800
],
1801-
"execution_count": 25,
1801+
"execution_count": null,
18021802
"outputs": [
18031803
{
18041804
"output_type": "execute_result",
@@ -1966,7 +1966,7 @@
19661966
"source": [
19671967
"df.sum(axis=0)#axis 1 for rows"
19681968
],
1969-
"execution_count": 27,
1969+
"execution_count": null,
19701970
"outputs": [
19711971
{
19721972
"output_type": "execute_result",
@@ -2003,7 +2003,7 @@
20032003
"source": [
20042004
"df['TV'].sum()"
20052005
],
2006-
"execution_count": 28,
2006+
"execution_count": null,
20072007
"outputs": [
20082008
{
20092009
"output_type": "execute_result",
@@ -2029,7 +2029,7 @@
20292029
"source": [
20302030
"df.TV.mean()"
20312031
],
2032-
"execution_count": 29,
2032+
"execution_count": null,
20332033
"outputs": [
20342034
{
20352035
"output_type": "execute_result",
@@ -2055,7 +2055,7 @@
20552055
"source": [
20562056
"df.TV.median()"
20572057
],
2058-
"execution_count": 30,
2058+
"execution_count": null,
20592059
"outputs": [
20602060
{
20612061
"output_type": "execute_result",
@@ -2081,7 +2081,7 @@
20812081
"source": [
20822082
"df.TV.mode()"
20832083
],
2084-
"execution_count": 31,
2084+
"execution_count": null,
20852085
"outputs": [
20862086
{
20872087
"output_type": "execute_result",
@@ -2117,7 +2117,7 @@
21172117
"source": [
21182118
"df['TV'].corr(df['radio'], method='kendall')# method pearson, spearman"
21192119
],
2120-
"execution_count": 40,
2120+
"execution_count": null,
21212121
"outputs": [
21222122
{
21232123
"output_type": "execute_result",

0 commit comments

Comments
 (0)