Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit15f06af

Browse files
committed
2024/03/30 - Updating Demo python files
1 parent57278c8 commit15f06af

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎advanced/PythonDemo_05_Pandas_module.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def seriesDemo():
3333

3434

3535
defdataFrameDemo():
36+
"""This functions provides demo on pandas dataframe basics"""
3637
d1= {
3738
"id": [1,2,3],
3839
"name": ["Rohit","Pooja","Rajani"]
@@ -67,7 +68,7 @@ def dataFrameDemo():
6768

6869

6970
defdataframe_filter_demo():
70-
"""Dataframeoperation"""
71+
"""This functions gives demo about pandasDataframeto select rows on basis of condition"""
7172

7273
d3= [random.randint(i,i*10)foriinrange(0,500)]
7374
d4= ['A','B','C','D','E']*100
@@ -94,6 +95,7 @@ def dataframe_filter_demo():
9495

9596

9697
defdataframe_duplicate_demo():
98+
"""This functions gives demo to find duplicates in pandas dataframe and remove them"""
9799
d= {
98100
'id': [1,2,3,4,5,1],
99101
'name': ['R','O','H','I','T','R']
@@ -119,6 +121,7 @@ def dataframe_duplicate_demo():
119121

120122

121123
defnull_handling_demo():
124+
"""This functions gives demo to handle null values in pandas dataframe"""
122125
d= {
123126
'id': [1,2,3,4,5,None,8],
124127
'name': ['R','O','H','I','T','C',None]
@@ -140,6 +143,7 @@ def null_handling_demo():
140143

141144

142145
defdataframe_add_rows():
146+
"""This functions gives demo to join two same pandas dataframes i.e. row-wise"""
143147
d= {
144148
'id': [1,2,3,4,5],
145149
'name': ['R','O','H','I','T']
@@ -160,6 +164,7 @@ def dataframe_add_rows():
160164

161165

162166
defdataframe_where_demo():
167+
"""This functions gives demo to use where function with pandas dataframe"""
163168
d= {
164169
'id': [1,2,3,4,5],
165170
'name': ['R','O','H','I','T']
@@ -195,6 +200,7 @@ def dataframe_remove_rows():
195200

196201

197202
defdataframe_join_demo():
203+
"""This functions gives demo to use 'join' function with pandas dataframes"""
198204
emp_data= {
199205
'emp_id': [10,20,30,40,50,60],
200206
'emp_name': ["Rohit","Pooja","Rajani","Rushi","Rutu","Prithvi"],
@@ -221,6 +227,7 @@ def dataframe_join_demo():
221227

222228

223229
defdataframe_merge_demo():
230+
"""This functions gives demo to use 'merge' function with pandas dataframes"""
224231
emp_data= {
225232
'emp_id': [10,20,30,40,50,60],
226233
'emp_name': ["Rohit","Pooja","Rajani","Rushi","Rutu","Prithvi"],
@@ -244,6 +251,7 @@ def dataframe_merge_demo():
244251

245252

246253
defdatframe_export_file():
254+
"""This functions gives demo to export pandas dataframes to files like csv, json"""
247255
emp_data= {
248256
'emp_id': [10,20,30,40,50,60],
249257
'emp_name': ["Rohit","Pooja","Rajani","Rushi","Rutu","Prithvi"],
@@ -273,6 +281,7 @@ def datframe_export_file():
273281

274282

275283
defdataframe_read_json_export_to_parquet():
284+
"""This functions gives demo to read files like csv, json and stored result in parquet format"""
276285
json_file_path=os.getcwd()+"/data/employee_details/employee.json"
277286
parquet_file_path=os.getcwd()+"/data/employee_details/parquet/"
278287
df=pd.read_json(json_file_path)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp