Skip to content

Commit 41c06bf

Browse files
committed
add sleep sort and quick sort in place
1 parent 5ff1177 commit 41c06bf

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

CSV_files/assets/course_name.csv

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
Name,Score
2-
Omar,82
3-
Mahmoud,86
4-
Noura,84
5-
Raneem,65
1+
name,course
2+
Noura,python40python401
3+
Mahmoud,python401
4+
Nizar,python401
5+
Raneem,python401
6+
Omer,python401

CSV_files/write_csv.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ def write_to_csv_files_using_DictWriter_class(data, fields, filename):
1515
writer.writerows(data)
1616

1717

18-
def write_by_pandas(name_dict, filename):
19-
df = pd.DataFrame(name_dict)
18+
def write_by_pandas(name_dict, filename, columns):
19+
df = pd.DataFrame(name_dict, columns=columns)
20+
print(df)
2021
df.to_csv(filename, index=False)
2122
return df
2223

@@ -37,9 +38,4 @@ def write_by_pandas(name_dict, filename):
3738

3839
# writing to csv file
3940
print(write_to_csv_files_using_DictWriter_class(mydata, fields, filename))
40-
41-
name_dict = {
42-
'Name': ['Omar', 'Mahmoud', 'Noura', 'Raneem'],
43-
'Score': [82, 86, 84, 65]
44-
}
45-
write_by_pandas(name_dict, filename)
41+
print(write_by_pandas(mydata, filename, columns=fields))

0 commit comments

Comments
 (0)