Data manipulation using Pandas
Pandas is an open source,BSD-licensed library providing high performance,easy to use data structures and data analysis tools for Python.
Agenda
- Data Frames
- Data Series
- Different operations in Pandas
Playing with dataframe
#Playing with dataframe
df=pd.DataFrame(np.arange(0,20).reshape(5,4),index=['Row1','Row2','Row3','Row4','Row5']
,columns=['Col1','Col2','Col3','Col4'])## Col1 Col2 Col3 Col4
## Row1 0 1 2 3
## Row2 4 5 6 7
## Row3 8 9 10 11
## Row4 12 13 14 15
## Row5 16 17 18 19
## Col1 0
## Col2 1
## Col3 2
## Col4 3
## Name: Row1, dtype: int32
type(df.loc['Row1']) #data series
#series is either be only one row or one column
#dataframe is the combination of multiple rows and columns## <class 'pandas.core.series.Series'>
## Col1 Col2 Col3 Col4
## Row1 0 1 2 3
## Row2 4 5 6 7
## Row3 8 9 10 11
## Row4 12 13 14 15
## Row5 16 17 18 19
## Col1
## Row1 0
## Row2 4
## <class 'pandas.core.frame.DataFrame'>
## Row1 0
## Row2 4
## Name: Col1, dtype: int32
## <class 'pandas.core.series.Series'>
## Col2 Col3 Col4
## Row1 1 2 3
## Row2 5 6 7
## Row3 9 10 11
## Row4 13 14 15
## Row5 17 18 19
## array([[ 1, 2, 3],
## [ 5, 6, 7],
## [ 9, 10, 11],
## [13, 14, 15],
## [17, 18, 19]])
## Col1 0
## Col2 0
## Col3 0
## Col4 0
## dtype: int64
## 12 1
## 4 1
## 16 1
## 8 1
## 0 1
## Name: Col1, dtype: int64
## array([ 0, 4, 8, 12, 16])
## Row1 2
## Row2 6
## Row3 10
## Row4 14
## Row5 18
## Name: Col3, dtype: int32
## Col3 Col2
## Row1 2 1
## Row2 6 5
## Row3 10 9
## Row4 14 13
## Row5 18 17
## ID X0 X1 X2 X3 X4 X5 X6 ... X377 X378 X379 X380 X382 X383 X384 X385
## 0 1 az v n f d t a ... 0 1 0 0 0 0 0 0
## 1 2 t b ai a d b g ... 1 0 0 0 0 0 0 0
## 2 3 az v as f d a j ... 0 1 0 0 0 0 0 0
## 3 4 az l n f d z l ... 0 1 0 0 0 0 0 0
## 4 5 w s as c d y i ... 0 0 0 0 0 0 0 0
##
## [5 rows x 377 columns]
## <class 'pandas.core.frame.DataFrame'>
## RangeIndex: 4209 entries, 0 to 4208
## Columns: 377 entries, ID to X385
## dtypes: int64(369), object(8)
## memory usage: 12.1+ MB
## ID X10 ... X384 X385
## count 4209.000000 4209.000000 ... 4209.000000 4209.000000
## mean 4211.039202 0.019007 ... 0.000713 0.001663
## std 2423.078926 0.136565 ... 0.026691 0.040752
## min 1.000000 0.000000 ... 0.000000 0.000000
## 25% 2115.000000 0.000000 ... 0.000000 0.000000
## 50% 4202.000000 0.000000 ... 0.000000 0.000000
## 75% 6310.000000 0.000000 ... 0.000000 0.000000
## max 8416.000000 1.000000 ... 1.000000 1.000000
##
## [8 rows x 369 columns]
## row1 1 2 3 4
## 0 row2 5 6 7 8
## 1 row3 9 10 11 12
find no. of occurance of each categories in a column,like table() in R
## ak 432
## y 348
## z 335
## x 302
## ay 299
## t 293
## o 246
## f 213
## w 198
## j 171
## n 167
## aj 162
## az 161
## s 116
## ap 108
## al 88
## h 64
## d 61
## e 48
## v 40
## ai 38
## af 34
## m 34
## am 28
## i 25
## at 21
## u 20
## ba 19
## a 18
## b 13
## ad 12
## k 12
## aw 11
## aq 11
## r 10
## ax 8
## bc 6
## l 6
## c 6
## as 6
## ao 5
## au 5
## g 3
## ae 1
## av 1
## an 1
## p 1
## ag 1
## bb 1
## Name: X0, dtype: int64
## ID X0 X1 X2 X3 X4 X5 ... X378 X379 X380 X382 X383 X384 X385
## 60 101 ay i as c d j ... 0 0 0 0 0 0 0
## 61 103 x b m c d j ... 0 0 0 0 0 0 0
## 62 104 n l ak f d j ... 0 0 0 0 0 0 0
## 63 105 j aa as c d j ... 0 0 0 0 0 0 0
## 64 110 z b r c d j ... 0 0 0 0 0 0 0
## ... ... .. .. .. .. .. .. ... ... ... ... ... ... ... ...
## 4204 8410 aj h as f d aa ... 0 0 0 0 0 0 0
## 4205 8411 t aa ai d d aa ... 0 0 0 0 0 0 0
## 4206 8413 y v as f d aa ... 0 0 0 0 0 0 0
## 4207 8414 ak v as a d aa ... 0 0 0 0 0 0 0
## 4208 8416 t aa ai c d aa ... 0 0 0 0 0 0 0
##
## [4149 rows x 377 columns]
## ID X10 X11 ... X383 X384 X385
## ID 1.000000 -0.016166 -0.020253 ... -0.001625 0.013948 0.026357
## X10 -0.016166 1.000000 -0.002146 ... -0.003035 -0.003717 -0.005681
## X11 -0.020253 -0.002146 1.000000 ... -0.000336 -0.000412 -0.000629
## X12 0.043162 -0.039453 -0.004369 ... -0.006180 -0.007570 -0.011569
## X13 0.017910 -0.035496 -0.003931 ... -0.005560 -0.006811 -0.010408
## ... ... ... ... ... ... ... ...
## X380 0.012520 -0.012561 -0.001391 ... -0.001968 -0.002410 -0.003683
## X382 -0.021581 -0.013108 -0.001452 ... -0.002053 -0.002515 -0.003844
## X383 -0.001625 -0.003035 -0.000336 ... 1.000000 -0.000582 -0.000890
## X384 0.013948 -0.003717 -0.000412 ... -0.000582 1.000000 -0.001090
## X385 0.026357 -0.005681 -0.000629 ... -0.000890 -0.001090 1.000000
##
## [369 rows x 369 columns]
CSV
## <class 'str'>
## <_io.StringIO object at 0x000000002BAE4AF8>
## col1 col2 col3
## 0 x y 1
## 1 a b 2
## 2 c d 3
## col1 col3
## 0 x 1
## 1 a 2
## 2 c 3
## a,b,c,d
## 1,2,3,4
## 5,6,7,8
## 9,10,11
## a b c d
## 0 1 2 3 4
## 1 5 6 7 8
## 2 9 10 11 NaN
## 0 1
## 1 5
## 2 9
## Name: a, dtype: object
## '5'
## a b c d
## 0 1 2 3.0 4.0
## 1 5 6 7.0 8.0
## 2 9 10 11.0 NaN
## index a b c
## 0 4 apple bat 5.7
## 1 8 orange cow 10.0
## a b c
## index
## 4 apple bat 5.7
## 8 orange cow 10.0
## a b c
## 4 apple bat NaN
## 8 orange cow NaN
## a b c
## 0 4 apple bat
## 1 8 orange cow
## b c
## 0 apple bat
## 1 orange cow
## a b
## 0 hello,"Bob",nice to see you 5
## item_code ... sort_sequence
## 0 AA0 ... 2
## 1 AA0R ... 399
## 2 SA0 ... 1
## 3 SA0E ... 374
## 4 SA0L1 ... 358
##
## [5 rows x 5 columns]
Read JSON to CSV
data='{"employee_name":"James","email":"james@gmail.com","job_profile":[{"title1":"team lead","title2":"sr.developer"}]}'
df1=pd.read_json(data)## 0 1 2 3 4 5 ... 8 9 10 11 12 13
## 0 1 14.23 1.71 2.43 15.6 127 ... 0.28 2.29 5.64 1.04 3.92 1065
## 1 1 13.20 1.78 2.14 11.2 100 ... 0.26 1.28 4.38 1.05 3.40 1050
## 2 1 13.16 2.36 2.67 18.6 101 ... 0.30 2.81 5.68 1.03 3.17 1185
## 3 1 14.37 1.95 2.50 16.8 113 ... 0.24 2.18 7.80 0.86 3.45 1480
## 4 1 13.24 2.59 2.87 21.0 118 ... 0.39 1.82 4.32 1.04 2.93 735
##
## [5 rows x 14 columns]
## '{"0":{"employee_name":"James","email":"james@gmail.com","job_profile":{"title1":"team lead","title2":"sr.developer"}}}'
## '[{"0":1,"1":14.23,"2":1.71,"3":2.43,"4":15.6,"5":127,"6":2.8,"7":3.06,"8":0.28,"9":2.29,"10":5.64,"11":1.04,"12":3.92,"13":1065},{"0":1,"1":13.2,"2":1.78,"3":2.14,"4":11.2,"5":100,"6":2.65,"7":2.76,"8":0.26,"9":1.28,"10":4.38,"11":1.05,"12":3.4,"13":1050},{"0":1,"1":13.16,"2":2.36,"3":2.67,"4":18.6,"5":101,"6":2.8,"7":3.24,"8":0.3,"9":2.81,"10":5.68,"11":1.03,"12":3.17,"13":1185},{"0":1,"1":14.37,"2":1.95,"3":2.5,"4":16.8,"5":113,"6":3.85,"7":3.49,"8":0.24,"9":2.18,"10":7.8,"11":0.86,"12":3.45,"13":1480},{"0":1,"1":13.24,"2":2.59,"3":2.87,"4":21.0,"5":118,"6":2.8,"7":2.69,"8":0.39,"9":1.82,"10":4.32,"11":1.04,"12":2.93,"13":735},{"0":1,"1":14.2,"2":1.76,"3":2.45,"4":15.2,"5":112,"6":3.27,"7":3.39,"8":0.34,"9":1.97,"10":6.75,"11":1.05,"12":2.85,"13":1450},{"0":1,"1":14.39,"2":1.87,"3":2.45,"4":14.6,"5":96,"6":2.5,"7":2.52,"8":0.3,"9":1.98,"10":5.25,"11":1.02,"12":3.58,"13":1290},{"0":1,"1":14.06,"2":2.15,"3":2.61,"4":17.6,"5":121,"6":2.6,"7":2.51,"8":0.31,"9":1.25,"10":5.05,"11":1.06,"12":3.58,"13":1295},{"0":1,"1":14.83,"2":1.64,"3":2.17,"4":14.0,"5":97,"6":2.8,"7":2.98,"8":0.29,"9":1.98,"10":5.2,"11":1.08,"12":2.85,"13":1045},{"0":1,"1":13.86,"2":1.35,"3":2.27,"4":16.0,"5":98,"6":2.98,"7":3.15,"8":0.22,"9":1.85,"10":7.22,"11":1.01,"12":3.55,"13":1045},{"0":1,"1":14.1,"2":2.16,"3":2.3,"4":18.0,"5":105,"6":2.95,"7":3.32,"8":0.22,"9":2.38,"10":5.75,"11":1.25,"12":3.17,"13":1510},{"0":1,"1":14.12,"2":1.48,"3":2.32,"4":16.8,"5":95,"6":2.2,"7":2.43,"8":0.26,"9":1.57,"10":5.0,"11":1.17,"12":2.82,"13":1280},{"0":1,"1":13.75,"2":1.73,"3":2.41,"4":16.0,"5":89,"6":2.6,"7":2.76,"8":0.29,"9":1.81,"10":5.6,"11":1.15,"12":2.9,"13":1320},{"0":1,"1":14.75,"2":1.73,"3":2.39,"4":11.4,"5":91,"6":3.1,"7":3.69,"8":0.43,"9":2.81,"10":5.4,"11":1.25,"12":2.73,"13":1150},{"0":1,"1":14.38,"2":1.87,"3":2.38,"4":12.0,"5":102,"6":3.3,"7":3.64,"8":0.29,"9":2.96,"10":7.5,"11":1.2,"12":3.0,"13":1547},{"0":1,"1":13.63,"2":1.81,"3":2.7,"4":17.2,"5":112,"6":2.85,"7":2.91,"8":0.3,"9":1.46,"10":7.3,"11":1.28,"12":2.88,"13":1310},{"0":1,"1":14.3,"2":1.92,"3":2.72,"4":20.0,"5":120,"6":2.8,"7":3.14,"8":0.33,"9":1.97,"10":6.2,"11":1.07,"12":2.65,"13":1280},{"0":1,"1":13.83,"2":1.57,"3":2.62,"4":20.0,"5":115,"6":2.95,"7":3.4,"8":0.4,"9":1.72,"10":6.6,"11":1.13,"12":2.57,"13":1130},{"0":1,"1":14.19,"2":1.59,"3":2.48,"4":16.5,"5":108,"6":3.3,"7":3.93,"8":0.32,"9":1.86,"10":8.7,"11":1.23,"12":2.82,"13":1680},{"0":1,"1":13.64,"2":3.1,"3":2.56,"4":15.2,"5":116,"6":2.7,"7":3.03,"8":0.17,"9":1.66,"10":5.1,"11":0.96,"12":3.36,"13":845},{"0":1,"1":14.06,"2":1.63,"3":2.28,"4":16.0,"5":126,"6":3.0,"7":3.17,"8":0.24,"9":2.1,"10":5.65,"11":1.09,"12":3.71,"13":780},{"0":1,"1":12.93,"2":3.8,"3":2.65,"4":18.6,"5":102,"6":2.41,"7":2.41,"8":0.25,"9":1.98,"10":4.5,"11":1.03,"12":3.52,"13":770},{"0":1,"1":13.71,"2":1.86,"3":2.36,"4":16.6,"5":101,"6":2.61,"7":2.88,"8":0.27,"9":1.69,"10":3.8,"11":1.11,"12":4.0,"13":1035},{"0":1,"1":12.85,"2":1.6,"3":2.52,"4":17.8,"5":95,"6":2.48,"7":2.37,"8":0.26,"9":1.46,"10":3.93,"11":1.09,"12":3.63,"13":1015},{"0":1,"1":13.5,"2":1.81,"3":2.61,"4":20.0,"5":96,"6":2.53,"7":2.61,"8":0.28,"9":1.66,"10":3.52,"11":1.12,"12":3.82,"13":845},{"0":1,"1":13.05,"2":2.05,"3":3.22,"4":25.0,"5":124,"6":2.63,"7":2.68,"8":0.47,"9":1.92,"10":3.58,"11":1.13,"12":3.2,"13":830},{"0":1,"1":13.39,"2":1.77,"3":2.62,"4":16.1,"5":93,"6":2.85,"7":2.94,"8":0.34,"9":1.45,"10":4.8,"11":0.92,"12":3.22,"13":1195},{"0":1,"1":13.3,"2":1.72,"3":2.14,"4":17.0,"5":94,"6":2.4,"7":2.19,"8":0.27,"9":1.35,"10":3.95,"11":1.02,"12":2.77,"13":1285},{"0":1,"1":13.87,"2":1.9,"3":2.8,"4":19.4,"5":107,"6":2.95,"7":2.97,"8":0.37,"9":1.76,"10":4.5,"11":1.25,"12":3.4,"13":915},{"0":1,"1":14.02,"2":1.68,"3":2.21,"4":16.0,"5":96,"6":2.65,"7":2.33,"8":0.26,"9":1.98,"10":4.7,"11":1.04,"12":3.59,"13":1035},{"0":1,"1":13.73,"2":1.5,"3":2.7,"4":22.5,"5":101,"6":3.0,"7":3.25,"8":0.29,"9":2.38,"10":5.7,"11":1.19,"12":2.71,"13":1285},{"0":1,"1":13.58,"2":1.66,"3":2.36,"4":19.1,"5":106,"6":2.86,"7":3.19,"8":0.22,"9":1.95,"10":6.9,"11":1.09,"12":2.88,"13":1515},{"0":1,"1":13.68,"2":1.83,"3":2.36,"4":17.2,"5":104,"6":2.42,"7":2.69,"8":0.42,"9":1.97,"10":3.84,"11":1.23,"12":2.87,"13":990},{"0":1,"1":13.76,"2":1.53,"3":2.7,"4":19.5,"5":132,"6":2.95,"7":2.74,"8":0.5,"9":1.35,"10":5.4,"11":1.25,"12":3.0,"13":1235},{"0":1,"1":13.51,"2":1.8,"3":2.65,"4":19.0,"5":110,"6":2.35,"7":2.53,"8":0.29,"9":1.54,"10":4.2,"11":1.1,"12":2.87,"13":1095},{"0":1,"1":13.48,"2":1.81,"3":2.41,"4":20.5,"5":100,"6":2.7,"7":2.98,"8":0.26,"9":1.86,"10":5.1,"11":1.04,"12":3.47,"13":920},{"0":1,"1":13.28,"2":1.64,"3":2.84,"4":15.5,"5":110,"6":2.6,"7":2.68,"8":0.34,"9":1.36,"10":4.6,"11":1.09,"12":2.78,"13":880},{"0":1,"1":13.05,"2":1.65,"3":2.55,"4":18.0,"5":98,"6":2.45,"7":2.43,"8":0.29,"9":1.44,"10":4.25,"11":1.12,"12":2.51,"13":1105},{"0":1,"1":13.07,"2":1.5,"3":2.1,"4":15.5,"5":98,"6":2.4,"7":2.64,"8":0.28,"9":1.37,"10":3.7,"11":1.18,"12":2.69,"13":1020},{"0":1,"1":14.22,"2":3.99,"3":2.51,"4":13.2,"5":128,"6":3.0,"7":3.04,"8":0.2,"9":2.08,"10":5.1,"11":0.89,"12":3.53,"13":760},{"0":1,"1":13.56,"2":1.71,"3":2.31,"4":16.2,"5":117,"6":3.15,"7":3.29,"8":0.34,"9":2.34,"10":6.13,"11":0.95,"12":3.38,"13":795},{"0":1,"1":13.41,"2":3.84,"3":2.12,"4":18.8,"5":90,"6":2.45,"7":2.68,"8":0.27,"9":1.48,"10":4.28,"11":0.91,"12":3.0,"13":1035},{"0":1,"1":13.88,"2":1.89,"3":2.59,"4":15.0,"5":101,"6":3.25,"7":3.56,"8":0.17,"9":1.7,"10":5.43,"11":0.88,"12":3.56,"13":1095},{"0":1,"1":13.24,"2":3.98,"3":2.29,"4":17.5,"5":103,"6":2.64,"7":2.63,"8":0.32,"9":1.66,"10":4.36,"11":0.82,"12":3.0,"13":680},{"0":1,"1":13.05,"2":1.77,"3":2.1,"4":17.0,"5":107,"6":3.0,"7":3.0,"8":0.28,"9":2.03,"10":5.04,"11":0.88,"12":3.35,"13":885},{"0":1,"1":14.21,"2":4.04,"3":2.44,"4":18.9,"5":111,"6":2.85,"7":2.65,"8":0.3,"9":1.25,"10":5.24,"11":0.87,"12":3.33,"13":1080},{"0":1,"1":14.38,"2":3.59,"3":2.28,"4":16.0,"5":102,"6":3.25,"7":3.17,"8":0.27,"9":2.19,"10":4.9,"11":1.04,"12":3.44,"13":1065},{"0":1,"1":13.9,"2":1.68,"3":2.12,"4":16.0,"5":101,"6":3.1,"7":3.39,"8":0.21,"9":2.14,"10":6.1,"11":0.91,"12":3.33,"13":985},{"0":1,"1":14.1,"2":2.02,"3":2.4,"4":18.8,"5":103,"6":2.75,"7":2.92,"8":0.32,"9":2.38,"10":6.2,"11":1.07,"12":2.75,"13":1060},{"0":1,"1":13.94,"2":1.73,"3":2.27,"4":17.4,"5":108,"6":2.88,"7":3.54,"8":0.32,"9":2.08,"10":8.9,"11":1.12,"12":3.1,"13":1260},{"0":1,"1":13.05,"2":1.73,"3":2.04,"4":12.4,"5":92,"6":2.72,"7":3.27,"8":0.17,"9":2.91,"10":7.2,"11":1.12,"12":2.91,"13":1150},{"0":1,"1":13.83,"2":1.65,"3":2.6,"4":17.2,"5":94,"6":2.45,"7":2.99,"8":0.22,"9":2.29,"10":5.6,"11":1.24,"12":3.37,"13":1265},{"0":1,"1":13.82,"2":1.75,"3":2.42,"4":14.0,"5":111,"6":3.88,"7":3.74,"8":0.32,"9":1.87,"10":7.05,"11":1.01,"12":3.26,"13":1190},{"0":1,"1":13.77,"2":1.9,"3":2.68,"4":17.1,"5":115,"6":3.0,"7":2.79,"8":0.39,"9":1.68,"10":6.3,"11":1.13,"12":2.93,"13":1375},{"0":1,"1":13.74,"2":1.67,"3":2.25,"4":16.4,"5":118,"6":2.6,"7":2.9,"8":0.21,"9":1.62,"10":5.85,"11":0.92,"12":3.2,"13":1060},{"0":1,"1":13.56,"2":1.73,"3":2.46,"4":20.5,"5":116,"6":2.96,"7":2.78,"8":0.2,"9":2.45,"10":6.25,"11":0.98,"12":3.03,"13":1120},{"0":1,"1":14.22,"2":1.7,"3":2.3,"4":16.3,"5":118,"6":3.2,"7":3.0,"8":0.26,"9":2.03,"10":6.38,"11":0.94,"12":3.31,"13":970},{"0":1,"1":13.29,"2":1.97,"3":2.68,"4":16.8,"5":102,"6":3.0,"7":3.23,"8":0.31,"9":1.66,"10":6.0,"11":1.07,"12":2.84,"13":1270},{"0":1,"1":13.72,"2":1.43,"3":2.5,"4":16.7,"5":108,"6":3.4,"7":3.67,"8":0.19,"9":2.04,"10":6.8,"11":0.89,"12":2.87,"13":1285},{"0":2,"1":12.37,"2":0.94,"3":1.36,"4":10.6,"5":88,"6":1.98,"7":0.57,"8":0.28,"9":0.42,"10":1.95,"11":1.05,"12":1.82,"13":520},{"0":2,"1":12.33,"2":1.1,"3":2.28,"4":16.0,"5":101,"6":2.05,"7":1.09,"8":0.63,"9":0.41,"10":3.27,"11":1.25,"12":1.67,"13":680},{"0":2,"1":12.64,"2":1.36,"3":2.02,"4":16.8,"5":100,"6":2.02,"7":1.41,"8":0.53,"9":0.62,"10":5.75,"11":0.98,"12":1.59,"13":450},{"0":2,"1":13.67,"2":1.25,"3":1.92,"4":18.0,"5":94,"6":2.1,"7":1.79,"8":0.32,"9":0.73,"10":3.8,"11":1.23,"12":2.46,"13":630},{"0":2,"1":12.37,"2":1.13,"3":2.16,"4":19.0,"5":87,"6":3.5,"7":3.1,"8":0.19,"9":1.87,"10":4.45,"11":1.22,"12":2.87,"13":420},{"0":2,"1":12.17,"2":1.45,"3":2.53,"4":19.0,"5":104,"6":1.89,"7":1.75,"8":0.45,"9":1.03,"10":2.95,"11":1.45,"12":2.23,"13":355},{"0":2,"1":12.37,"2":1.21,"3":2.56,"4":18.1,"5":98,"6":2.42,"7":2.65,"8":0.37,"9":2.08,"10":4.6,"11":1.19,"12":2.3,"13":678},{"0":2,"1":13.11,"2":1.01,"3":1.7,"4":15.0,"5":78,"6":2.98,"7":3.18,"8":0.26,"9":2.28,"10":5.3,"11":1.12,"12":3.18,"13":502},{"0":2,"1":12.37,"2":1.17,"3":1.92,"4":19.6,"5":78,"6":2.11,"7":2.0,"8":0.27,"9":1.04,"10":4.68,"11":1.12,"12":3.48,"13":510},{"0":2,"1":13.34,"2":0.94,"3":2.36,"4":17.0,"5":110,"6":2.53,"7":1.3,"8":0.55,"9":0.42,"10":3.17,"11":1.02,"12":1.93,"13":750},{"0":2,"1":12.21,"2":1.19,"3":1.75,"4":16.8,"5":151,"6":1.85,"7":1.28,"8":0.14,"9":2.5,"10":2.85,"11":1.28,"12":3.07,"13":718},{"0":2,"1":12.29,"2":1.61,"3":2.21,"4":20.4,"5":103,"6":1.1,"7":1.02,"8":0.37,"9":1.46,"10":3.05,"11":0.906,"12":1.82,"13":870},{"0":2,"1":13.86,"2":1.51,"3":2.67,"4":25.0,"5":86,"6":2.95,"7":2.86,"8":0.21,"9":1.87,"10":3.38,"11":1.36,"12":3.16,"13":410},{"0":2,"1":13.49,"2":1.66,"3":2.24,"4":24.0,"5":87,"6":1.88,"7":1.84,"8":0.27,"9":1.03,"10":3.74,"11":0.98,"12":2.78,"13":472},{"0":2,"1":12.99,"2":1.67,"3":2.6,"4":30.0,"5":139,"6":3.3,"7":2.89,"8":0.21,"9":1.96,"10":3.35,"11":1.31,"12":3.5,"13":985},{"0":2,"1":11.96,"2":1.09,"3":2.3,"4":21.0,"5":101,"6":3.38,"7":2.14,"8":0.13,"9":1.65,"10":3.21,"11":0.99,"12":3.13,"13":886},{"0":2,"1":11.66,"2":1.88,"3":1.92,"4":16.0,"5":97,"6":1.61,"7":1.57,"8":0.34,"9":1.15,"10":3.8,"11":1.23,"12":2.14,"13":428},{"0":2,"1":13.03,"2":0.9,"3":1.71,"4":16.0,"5":86,"6":1.95,"7":2.03,"8":0.24,"9":1.46,"10":4.6,"11":1.19,"12":2.48,"13":392},{"0":2,"1":11.84,"2":2.89,"3":2.23,"4":18.0,"5":112,"6":1.72,"7":1.32,"8":0.43,"9":0.95,"10":2.65,"11":0.96,"12":2.52,"13":500},{"0":2,"1":12.33,"2":0.99,"3":1.95,"4":14.8,"5":136,"6":1.9,"7":1.85,"8":0.35,"9":2.76,"10":3.4,"11":1.06,"12":2.31,"13":750},{"0":2,"1":12.7,"2":3.87,"3":2.4,"4":23.0,"5":101,"6":2.83,"7":2.55,"8":0.43,"9":1.95,"10":2.57,"11":1.19,"12":3.13,"13":463},{"0":2,"1":12.0,"2":0.92,"3":2.0,"4":19.0,"5":86,"6":2.42,"7":2.26,"8":0.3,"9":1.43,"10":2.5,"11":1.38,"12":3.12,"13":278},{"0":2,"1":12.72,"2":1.81,"3":2.2,"4":18.8,"5":86,"6":2.2,"7":2.53,"8":0.26,"9":1.77,"10":3.9,"11":1.16,"12":3.14,"13":714},{"0":2,"1":12.08,"2":1.13,"3":2.51,"4":24.0,"5":78,"6":2.0,"7":1.58,"8":0.4,"9":1.4,"10":2.2,"11":1.31,"12":2.72,"13":630},{"0":2,"1":13.05,"2":3.86,"3":2.32,"4":22.5,"5":85,"6":1.65,"7":1.59,"8":0.61,"9":1.62,"10":4.8,"11":0.84,"12":2.01,"13":515},{"0":2,"1":11.84,"2":0.89,"3":2.58,"4":18.0,"5":94,"6":2.2,"7":2.21,"8":0.22,"9":2.35,"10":3.05,"11":0.79,"12":3.08,"13":520},{"0":2,"1":12.67,"2":0.98,"3":2.24,"4":18.0,"5":99,"6":2.2,"7":1.94,"8":0.3,"9":1.46,"10":2.62,"11":1.23,"12":3.16,"13":450},{"0":2,"1":12.16,"2":1.61,"3":2.31,"4":22.8,"5":90,"6":1.78,"7":1.69,"8":0.43,"9":1.56,"10":2.45,"11":1.33,"12":2.26,"13":495},{"0":2,"1":11.65,"2":1.67,"3":2.62,"4":26.0,"5":88,"6":1.92,"7":1.61,"8":0.4,"9":1.34,"10":2.6,"11":1.36,"12":3.21,"13":562},{"0":2,"1":11.64,"2":2.06,"3":2.46,"4":21.6,"5":84,"6":1.95,"7":1.69,"8":0.48,"9":1.35,"10":2.8,"11":1.0,"12":2.75,"13":680},{"0":2,"1":12.08,"2":1.33,"3":2.3,"4":23.6,"5":70,"6":2.2,"7":1.59,"8":0.42,"9":1.38,"10":1.74,"11":1.07,"12":3.21,"13":625},{"0":2,"1":12.08,"2":1.83,"3":2.32,"4":18.5,"5":81,"6":1.6,"7":1.5,"8":0.52,"9":1.64,"10":2.4,"11":1.08,"12":2.27,"13":480},{"0":2,"1":12.0,"2":1.51,"3":2.42,"4":22.0,"5":86,"6":1.45,"7":1.25,"8":0.5,"9":1.63,"10":3.6,"11":1.05,"12":2.65,"13":450},{"0":2,"1":12.69,"2":1.53,"3":2.26,"4":20.7,"5":80,"6":1.38,"7":1.46,"8":0.58,"9":1.62,"10":3.05,"11":0.96,"12":2.06,"13":495},{"0":2,"1":12.29,"2":2.83,"3":2.22,"4":18.0,"5":88,"6":2.45,"7":2.25,"8":0.25,"9":1.99,"10":2.15,"11":1.15,"12":3.3,"13":290},{"0":2,"1":11.62,"2":1.99,"3":2.28,"4":18.0,"5":98,"6":3.02,"7":2.26,"8":0.17,"9":1.35,"10":3.25,"11":1.16,"12":2.96,"13":345},{"0":2,"1":12.47,"2":1.52,"3":2.2,"4":19.0,"5":162,"6":2.5,"7":2.27,"8":0.32,"9":3.28,"10":2.6,"11":1.16,"12":2.63,"13":937},{"0":2,"1":11.81,"2":2.12,"3":2.74,"4":21.5,"5":134,"6":1.6,"7":0.99,"8":0.14,"9":1.56,"10":2.5,"11":0.95,"12":2.26,"13":625},{"0":2,"1":12.29,"2":1.41,"3":1.98,"4":16.0,"5":85,"6":2.55,"7":2.5,"8":0.29,"9":1.77,"10":2.9,"11":1.23,"12":2.74,"13":428},{"0":2,"1":12.37,"2":1.07,"3":2.1,"4":18.5,"5":88,"6":3.52,"7":3.75,"8":0.24,"9":1.95,"10":4.5,"11":1.04,"12":2.77,"13":660},{"0":2,"1":12.29,"2":3.17,"3":2.21,"4":18.0,"5":88,"6":2.85,"7":2.99,"8":0.45,"9":2.81,"10":2.3,"11":1.42,"12":2.83,"13":406},{"0":2,"1":12.08,"2":2.08,"3":1.7,"4":17.5,"5":97,"6":2.23,"7":2.17,"8":0.26,"9":1.4,"10":3.3,"11":1.27,"12":2.96,"13":710},{"0":2,"1":12.6,"2":1.34,"3":1.9,"4":18.5,"5":88,"6":1.45,"7":1.36,"8":0.29,"9":1.35,"10":2.45,"11":1.04,"12":2.77,"13":562},{"0":2,"1":12.34,"2":2.45,"3":2.46,"4":21.0,"5":98,"6":2.56,"7":2.11,"8":0.34,"9":1.31,"10":2.8,"11":0.8,"12":3.38,"13":438},{"0":2,"1":11.82,"2":1.72,"3":1.88,"4":19.5,"5":86,"6":2.5,"7":1.64,"8":0.37,"9":1.42,"10":2.06,"11":0.94,"12":2.44,"13":415},{"0":2,"1":12.51,"2":1.73,"3":1.98,"4":20.5,"5":85,"6":2.2,"7":1.92,"8":0.32,"9":1.48,"10":2.94,"11":1.04,"12":3.57,"13":672},{"0":2,"1":12.42,"2":2.55,"3":2.27,"4":22.0,"5":90,"6":1.68,"7":1.84,"8":0.66,"9":1.42,"10":2.7,"11":0.86,"12":3.3,"13":315},{"0":2,"1":12.25,"2":1.73,"3":2.12,"4":19.0,"5":80,"6":1.65,"7":2.03,"8":0.37,"9":1.63,"10":3.4,"11":1.0,"12":3.17,"13":510},{"0":2,"1":12.72,"2":1.75,"3":2.28,"4":22.5,"5":84,"6":1.38,"7":1.76,"8":0.48,"9":1.63,"10":3.3,"11":0.88,"12":2.42,"13":488},{"0":2,"1":12.22,"2":1.29,"3":1.94,"4":19.0,"5":92,"6":2.36,"7":2.04,"8":0.39,"9":2.08,"10":2.7,"11":0.86,"12":3.02,"13":312},{"0":2,"1":11.61,"2":1.35,"3":2.7,"4":20.0,"5":94,"6":2.74,"7":2.92,"8":0.29,"9":2.49,"10":2.65,"11":0.96,"12":3.26,"13":680},{"0":2,"1":11.46,"2":3.74,"3":1.82,"4":19.5,"5":107,"6":3.18,"7":2.58,"8":0.24,"9":3.58,"10":2.9,"11":0.75,"12":2.81,"13":562},{"0":2,"1":12.52,"2":2.43,"3":2.17,"4":21.0,"5":88,"6":2.55,"7":2.27,"8":0.26,"9":1.22,"10":2.0,"11":0.9,"12":2.78,"13":325},{"0":2,"1":11.76,"2":2.68,"3":2.92,"4":20.0,"5":103,"6":1.75,"7":2.03,"8":0.6,"9":1.05,"10":3.8,"11":1.23,"12":2.5,"13":607},{"0":2,"1":11.41,"2":0.74,"3":2.5,"4":21.0,"5":88,"6":2.48,"7":2.01,"8":0.42,"9":1.44,"10":3.08,"11":1.1,"12":2.31,"13":434},{"0":2,"1":12.08,"2":1.39,"3":2.5,"4":22.5,"5":84,"6":2.56,"7":2.29,"8":0.43,"9":1.04,"10":2.9,"11":0.93,"12":3.19,"13":385},{"0":2,"1":11.03,"2":1.51,"3":2.2,"4":21.5,"5":85,"6":2.46,"7":2.17,"8":0.52,"9":2.01,"10":1.9,"11":1.71,"12":2.87,"13":407},{"0":2,"1":11.82,"2":1.47,"3":1.99,"4":20.8,"5":86,"6":1.98,"7":1.6,"8":0.3,"9":1.53,"10":1.95,"11":0.95,"12":3.33,"13":495},{"0":2,"1":12.42,"2":1.61,"3":2.19,"4":22.5,"5":108,"6":2.0,"7":2.09,"8":0.34,"9":1.61,"10":2.06,"11":1.06,"12":2.96,"13":345},{"0":2,"1":12.77,"2":3.43,"3":1.98,"4":16.0,"5":80,"6":1.63,"7":1.25,"8":0.43,"9":0.83,"10":3.4,"11":0.7,"12":2.12,"13":372},{"0":2,"1":12.0,"2":3.43,"3":2.0,"4":19.0,"5":87,"6":2.0,"7":1.64,"8":0.37,"9":1.87,"10":1.28,"11":0.93,"12":3.05,"13":564},{"0":2,"1":11.45,"2":2.4,"3":2.42,"4":20.0,"5":96,"6":2.9,"7":2.79,"8":0.32,"9":1.83,"10":3.25,"11":0.8,"12":3.39,"13":625},{"0":2,"1":11.56,"2":2.05,"3":3.23,"4":28.5,"5":119,"6":3.18,"7":5.08,"8":0.47,"9":1.87,"10":6.0,"11":0.93,"12":3.69,"13":465},{"0":2,"1":12.42,"2":4.43,"3":2.73,"4":26.5,"5":102,"6":2.2,"7":2.13,"8":0.43,"9":1.71,"10":2.08,"11":0.92,"12":3.12,"13":365},{"0":2,"1":13.05,"2":5.8,"3":2.13,"4":21.5,"5":86,"6":2.62,"7":2.65,"8":0.3,"9":2.01,"10":2.6,"11":0.73,"12":3.1,"13":380},{"0":2,"1":11.87,"2":4.31,"3":2.39,"4":21.0,"5":82,"6":2.86,"7":3.03,"8":0.21,"9":2.91,"10":2.8,"11":0.75,"12":3.64,"13":380},{"0":2,"1":12.07,"2":2.16,"3":2.17,"4":21.0,"5":85,"6":2.6,"7":2.65,"8":0.37,"9":1.35,"10":2.76,"11":0.86,"12":3.28,"13":378},{"0":2,"1":12.43,"2":1.53,"3":2.29,"4":21.5,"5":86,"6":2.74,"7":3.15,"8":0.39,"9":1.77,"10":3.94,"11":0.69,"12":2.84,"13":352},{"0":2,"1":11.79,"2":2.13,"3":2.78,"4":28.5,"5":92,"6":2.13,"7":2.24,"8":0.58,"9":1.76,"10":3.0,"11":0.97,"12":2.44,"13":466},{"0":2,"1":12.37,"2":1.63,"3":2.3,"4":24.5,"5":88,"6":2.22,"7":2.45,"8":0.4,"9":1.9,"10":2.12,"11":0.89,"12":2.78,"13":342},{"0":2,"1":12.04,"2":4.3,"3":2.38,"4":22.0,"5":80,"6":2.1,"7":1.75,"8":0.42,"9":1.35,"10":2.6,"11":0.79,"12":2.57,"13":580},{"0":3,"1":12.86,"2":1.35,"3":2.32,"4":18.0,"5":122,"6":1.51,"7":1.25,"8":0.21,"9":0.94,"10":4.1,"11":0.76,"12":1.29,"13":630},{"0":3,"1":12.88,"2":2.99,"3":2.4,"4":20.0,"5":104,"6":1.3,"7":1.22,"8":0.24,"9":0.83,"10":5.4,"11":0.74,"12":1.42,"13":530},{"0":3,"1":12.81,"2":2.31,"3":2.4,"4":24.0,"5":98,"6":1.15,"7":1.09,"8":0.27,"9":0.83,"10":5.7,"11":0.66,"12":1.36,"13":560},{"0":3,"1":12.7,"2":3.55,"3":2.36,"4":21.5,"5":106,"6":1.7,"7":1.2,"8":0.17,"9":0.84,"10":5.0,"11":0.78,"12":1.29,"13":600},{"0":3,"1":12.51,"2":1.24,"3":2.25,"4":17.5,"5":85,"6":2.0,"7":0.58,"8":0.6,"9":1.25,"10":5.45,"11":0.75,"12":1.51,"13":650},{"0":3,"1":12.6,"2":2.46,"3":2.2,"4":18.5,"5":94,"6":1.62,"7":0.66,"8":0.63,"9":0.94,"10":7.1,"11":0.73,"12":1.58,"13":695},{"0":3,"1":12.25,"2":4.72,"3":2.54,"4":21.0,"5":89,"6":1.38,"7":0.47,"8":0.53,"9":0.8,"10":3.85,"11":0.75,"12":1.27,"13":720},{"0":3,"1":12.53,"2":5.51,"3":2.64,"4":25.0,"5":96,"6":1.79,"7":0.6,"8":0.63,"9":1.1,"10":5.0,"11":0.82,"12":1.69,"13":515},{"0":3,"1":13.49,"2":3.59,"3":2.19,"4":19.5,"5":88,"6":1.62,"7":0.48,"8":0.58,"9":0.88,"10":5.7,"11":0.81,"12":1.82,"13":580},{"0":3,"1":12.84,"2":2.96,"3":2.61,"4":24.0,"5":101,"6":2.32,"7":0.6,"8":0.53,"9":0.81,"10":4.92,"11":0.89,"12":2.15,"13":590},{"0":3,"1":12.93,"2":2.81,"3":2.7,"4":21.0,"5":96,"6":1.54,"7":0.5,"8":0.53,"9":0.75,"10":4.6,"11":0.77,"12":2.31,"13":600},{"0":3,"1":13.36,"2":2.56,"3":2.35,"4":20.0,"5":89,"6":1.4,"7":0.5,"8":0.37,"9":0.64,"10":5.6,"11":0.7,"12":2.47,"13":780},{"0":3,"1":13.52,"2":3.17,"3":2.72,"4":23.5,"5":97,"6":1.55,"7":0.52,"8":0.5,"9":0.55,"10":4.35,"11":0.89,"12":2.06,"13":520},{"0":3,"1":13.62,"2":4.95,"3":2.35,"4":20.0,"5":92,"6":2.0,"7":0.8,"8":0.47,"9":1.02,"10":4.4,"11":0.91,"12":2.05,"13":550},{"0":3,"1":12.25,"2":3.88,"3":2.2,"4":18.5,"5":112,"6":1.38,"7":0.78,"8":0.29,"9":1.14,"10":8.21,"11":0.65,"12":2.0,"13":855},{"0":3,"1":13.16,"2":3.57,"3":2.15,"4":21.0,"5":102,"6":1.5,"7":0.55,"8":0.43,"9":1.3,"10":4.0,"11":0.6,"12":1.68,"13":830},{"0":3,"1":13.88,"2":5.04,"3":2.23,"4":20.0,"5":80,"6":0.98,"7":0.34,"8":0.4,"9":0.68,"10":4.9,"11":0.58,"12":1.33,"13":415},{"0":3,"1":12.87,"2":4.61,"3":2.48,"4":21.5,"5":86,"6":1.7,"7":0.65,"8":0.47,"9":0.86,"10":7.65,"11":0.54,"12":1.86,"13":625},{"0":3,"1":13.32,"2":3.24,"3":2.38,"4":21.5,"5":92,"6":1.93,"7":0.76,"8":0.45,"9":1.25,"10":8.42,"11":0.55,"12":1.62,"13":650},{"0":3,"1":13.08,"2":3.9,"3":2.36,"4":21.5,"5":113,"6":1.41,"7":1.39,"8":0.34,"9":1.14,"10":9.4,"11":0.57,"12":1.33,"13":550},{"0":3,"1":13.5,"2":3.12,"3":2.62,"4":24.0,"5":123,"6":1.4,"7":1.57,"8":0.22,"9":1.25,"10":8.6,"11":0.59,"12":1.3,"13":500},{"0":3,"1":12.79,"2":2.67,"3":2.48,"4":22.0,"5":112,"6":1.48,"7":1.36,"8":0.24,"9":1.26,"10":10.8,"11":0.48,"12":1.47,"13":480},{"0":3,"1":13.11,"2":1.9,"3":2.75,"4":25.5,"5":116,"6":2.2,"7":1.28,"8":0.26,"9":1.56,"10":7.1,"11":0.61,"12":1.33,"13":425},{"0":3,"1":13.23,"2":3.3,"3":2.28,"4":18.5,"5":98,"6":1.8,"7":0.83,"8":0.61,"9":1.87,"10":10.52,"11":0.56,"12":1.51,"13":675},{"0":3,"1":12.58,"2":1.29,"3":2.1,"4":20.0,"5":103,"6":1.48,"7":0.58,"8":0.53,"9":1.4,"10":7.6,"11":0.58,"12":1.55,"13":640},{"0":3,"1":13.17,"2":5.19,"3":2.32,"4":22.0,"5":93,"6":1.74,"7":0.63,"8":0.61,"9":1.55,"10":7.9,"11":0.6,"12":1.48,"13":725},{"0":3,"1":13.84,"2":4.12,"3":2.38,"4":19.5,"5":89,"6":1.8,"7":0.83,"8":0.48,"9":1.56,"10":9.01,"11":0.57,"12":1.64,"13":480},{"0":3,"1":12.45,"2":3.03,"3":2.64,"4":27.0,"5":97,"6":1.9,"7":0.58,"8":0.63,"9":1.14,"10":7.5,"11":0.67,"12":1.73,"13":880},{"0":3,"1":14.34,"2":1.68,"3":2.7,"4":25.0,"5":98,"6":2.8,"7":1.31,"8":0.53,"9":2.7,"10":13.0,"11":0.57,"12":1.96,"13":660},{"0":3,"1":13.48,"2":1.67,"3":2.64,"4":22.5,"5":89,"6":2.6,"7":1.1,"8":0.52,"9":2.29,"10":11.75,"11":0.57,"12":1.78,"13":620},{"0":3,"1":12.36,"2":3.83,"3":2.38,"4":21.0,"5":88,"6":2.3,"7":0.92,"8":0.5,"9":1.04,"10":7.65,"11":0.56,"12":1.58,"13":520},{"0":3,"1":13.69,"2":3.26,"3":2.54,"4":20.0,"5":107,"6":1.83,"7":0.56,"8":0.5,"9":0.8,"10":5.88,"11":0.96,"12":1.82,"13":680},{"0":3,"1":12.85,"2":3.27,"3":2.58,"4":22.0,"5":106,"6":1.65,"7":0.6,"8":0.6,"9":0.96,"10":5.58,"11":0.87,"12":2.11,"13":570},{"0":3,"1":12.96,"2":3.45,"3":2.35,"4":18.5,"5":106,"6":1.39,"7":0.7,"8":0.4,"9":0.94,"10":5.28,"11":0.68,"12":1.75,"13":675},{"0":3,"1":13.78,"2":2.76,"3":2.3,"4":22.0,"5":90,"6":1.35,"7":0.68,"8":0.41,"9":1.03,"10":9.58,"11":0.7,"12":1.68,"13":615},{"0":3,"1":13.73,"2":4.36,"3":2.26,"4":22.5,"5":88,"6":1.28,"7":0.47,"8":0.52,"9":1.15,"10":6.62,"11":0.78,"12":1.75,"13":520},{"0":3,"1":13.45,"2":3.7,"3":2.6,"4":23.0,"5":111,"6":1.7,"7":0.92,"8":0.43,"9":1.46,"10":10.68,"11":0.85,"12":1.56,"13":695},{"0":3,"1":12.82,"2":3.37,"3":2.3,"4":19.5,"5":88,"6":1.48,"7":0.66,"8":0.4,"9":0.97,"10":10.26,"11":0.72,"12":1.75,"13":685},{"0":3,"1":13.58,"2":2.58,"3":2.69,"4":24.5,"5":105,"6":1.55,"7":0.84,"8":0.39,"9":1.54,"10":8.66,"11":0.74,"12":1.8,"13":750},{"0":3,"1":13.4,"2":4.6,"3":2.86,"4":25.0,"5":112,"6":1.98,"7":0.96,"8":0.27,"9":1.11,"10":8.5,"11":0.67,"12":1.92,"13":630},{"0":3,"1":12.2,"2":3.03,"3":2.32,"4":19.0,"5":96,"6":1.25,"7":0.49,"8":0.4,"9":0.73,"10":5.5,"11":0.66,"12":1.83,"13":510},{"0":3,"1":12.77,"2":2.39,"3":2.28,"4":19.5,"5":86,"6":1.39,"7":0.51,"8":0.48,"9":0.64,"10":9.899999,"11":0.57,"12":1.63,"13":470},{"0":3,"1":14.16,"2":2.51,"3":2.48,"4":20.0,"5":91,"6":1.68,"7":0.7,"8":0.44,"9":1.24,"10":9.7,"11":0.62,"12":1.71,"13":660},{"0":3,"1":13.71,"2":5.65,"3":2.45,"4":20.5,"5":95,"6":1.68,"7":0.61,"8":0.52,"9":1.06,"10":7.7,"11":0.64,"12":1.74,"13":740},{"0":3,"1":13.4,"2":3.91,"3":2.48,"4":23.0,"5":102,"6":1.8,"7":0.75,"8":0.43,"9":1.41,"10":7.3,"11":0.7,"12":1.56,"13":750},{"0":3,"1":13.27,"2":4.28,"3":2.26,"4":20.0,"5":120,"6":1.59,"7":0.69,"8":0.43,"9":1.35,"10":10.2,"11":0.59,"12":1.56,"13":835},{"0":3,"1":13.17,"2":2.59,"3":2.37,"4":20.0,"5":120,"6":1.65,"7":0.68,"8":0.53,"9":1.46,"10":9.3,"11":0.6,"12":1.62,"13":840},{"0":3,"1":14.13,"2":4.1,"3":2.74,"4":24.5,"5":96,"6":2.05,"7":0.76,"8":0.56,"9":1.35,"10":9.2,"11":0.61,"12":1.6,"13":560}]'
Reading HTML content
url = 'https://www.fdic.gov/bank/individual/failed/banklist.html'
dfs = pd.read_html(url) # read table from HTML page ## Bank Name ... Closing Date
## 0 The First State Bank ... April 3, 2020
## 1 Ericson State Bank ... February 14, 2020
## 2 City National Bank of New Jersey ... November 1, 2019
## 3 Resolute Bank ... October 25, 2019
## 4 Louisa Community Bank ... October 25, 2019
## .. ... ... ...
## 556 Superior Bank, FSB ... July 27, 2001
## 557 Malta National Bank ... May 3, 2001
## 558 First Alliance Bank & Trust Co. ... February 2, 2001
## 559 National State Bank of Metropolis ... December 14, 2000
## 560 Bank of Honolulu ... October 13, 2000
##
## [561 rows x 6 columns]
url_mcc = 'https://en.wikipedia.org/wiki/Mobile_country_code'
dfs = pd.read_html(url_mcc, match='Country', header=0)## Mobile country code ... Remarks
## 0 289 ... MCC is not listed by ITU
## 1 412 ... NaN
## 2 276 ... NaN
## 3 603 ... NaN
## 4 544 ... NaN
## .. ... ... ...
## 247 452 ... NaN
## 248 543 ... NaN
## 249 421 ... NaN
## 250 645 ... NaN
## 251 648 ... NaN
##
## [252 rows x 6 columns]
Reading Excel Files
## Age Percentage cured Unnamed: 2 Unnamed: 3
## 0 NaN A B C
## 1 infants 0.99852 0.859971 0.584281
## 2 10 0.836235 0.530928 0.830369
## 3 11 0.500711 0.840163 0.405765
## 4 12 0.224256 0.0981093 0.899363
Pickling
All pandas objects are equipped with to_pickle methods which use Python’s cPickle module to save data structures to disk using the pickle format
## Age Percentage cured Unnamed: 2 Unnamed: 3
## 0 NaN A B C
## 1 infants 0.99852 0.859971 0.584281
## 2 10 0.836235 0.530928 0.830369
## 3 11 0.500711 0.840163 0.405765
## 4 12 0.224256 0.0981093 0.899363
Hope I was able to share some helpful concepts with you. See you in the next article. My website link Krishnamita.