@@ -33,6 +33,7 @@ def seriesDemo():
33
33
34
34
35
35
def dataFrameDemo ():
36
+ """This functions provides demo on pandas dataframe basics"""
36
37
d1 = {
37
38
"id" : [1 ,2 ,3 ],
38
39
"name" : ["Rohit" ,"Pooja" ,"Rajani" ]
@@ -67,7 +68,7 @@ def dataFrameDemo():
67
68
68
69
69
70
def dataframe_filter_demo ():
70
- """Dataframeoperation """
71
+ """This functions gives demo about pandas Dataframeto select rows on basis of condition """
71
72
72
73
d3 = [random .randint (i ,i * 10 )for i in range (0 ,500 )]
73
74
d4 = ['A' ,'B' ,'C' ,'D' ,'E' ]* 100
@@ -94,6 +95,7 @@ def dataframe_filter_demo():
94
95
95
96
96
97
def dataframe_duplicate_demo ():
98
+ """This functions gives demo to find duplicates in pandas dataframe and remove them"""
97
99
d = {
98
100
'id' : [1 ,2 ,3 ,4 ,5 ,1 ],
99
101
'name' : ['R' ,'O' ,'H' ,'I' ,'T' ,'R' ]
@@ -119,6 +121,7 @@ def dataframe_duplicate_demo():
119
121
120
122
121
123
def null_handling_demo ():
124
+ """This functions gives demo to handle null values in pandas dataframe"""
122
125
d = {
123
126
'id' : [1 ,2 ,3 ,4 ,5 ,None ,8 ],
124
127
'name' : ['R' ,'O' ,'H' ,'I' ,'T' ,'C' ,None ]
@@ -140,6 +143,7 @@ def null_handling_demo():
140
143
141
144
142
145
def dataframe_add_rows ():
146
+ """This functions gives demo to join two same pandas dataframes i.e. row-wise"""
143
147
d = {
144
148
'id' : [1 ,2 ,3 ,4 ,5 ],
145
149
'name' : ['R' ,'O' ,'H' ,'I' ,'T' ]
@@ -160,6 +164,7 @@ def dataframe_add_rows():
160
164
161
165
162
166
def dataframe_where_demo ():
167
+ """This functions gives demo to use where function with pandas dataframe"""
163
168
d = {
164
169
'id' : [1 ,2 ,3 ,4 ,5 ],
165
170
'name' : ['R' ,'O' ,'H' ,'I' ,'T' ]
@@ -195,6 +200,7 @@ def dataframe_remove_rows():
195
200
196
201
197
202
def dataframe_join_demo ():
203
+ """This functions gives demo to use 'join' function with pandas dataframes"""
198
204
emp_data = {
199
205
'emp_id' : [10 ,20 ,30 ,40 ,50 ,60 ],
200
206
'emp_name' : ["Rohit" ,"Pooja" ,"Rajani" ,"Rushi" ,"Rutu" ,"Prithvi" ],
@@ -221,6 +227,7 @@ def dataframe_join_demo():
221
227
222
228
223
229
def dataframe_merge_demo ():
230
+ """This functions gives demo to use 'merge' function with pandas dataframes"""
224
231
emp_data = {
225
232
'emp_id' : [10 ,20 ,30 ,40 ,50 ,60 ],
226
233
'emp_name' : ["Rohit" ,"Pooja" ,"Rajani" ,"Rushi" ,"Rutu" ,"Prithvi" ],
@@ -244,6 +251,7 @@ def dataframe_merge_demo():
244
251
245
252
246
253
def datframe_export_file ():
254
+ """This functions gives demo to export pandas dataframes to files like csv, json"""
247
255
emp_data = {
248
256
'emp_id' : [10 ,20 ,30 ,40 ,50 ,60 ],
249
257
'emp_name' : ["Rohit" ,"Pooja" ,"Rajani" ,"Rushi" ,"Rutu" ,"Prithvi" ],
@@ -273,6 +281,7 @@ def datframe_export_file():
273
281
274
282
275
283
def dataframe_read_json_export_to_parquet ():
284
+ """This functions gives demo to read files like csv, json and stored result in parquet format"""
276
285
json_file_path = os .getcwd ()+ "/data/employee_details/employee.json"
277
286
parquet_file_path = os .getcwd ()+ "/data/employee_details/parquet/"
278
287
df = pd .read_json (json_file_path )