Spaces:
Sleeping
Sleeping
Delete validate_csv.py
Browse files- validate_csv.py +0 -15
validate_csv.py
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
import csv
|
2 |
-
|
3 |
-
# File Input dan Output
|
4 |
-
input_file = "dataset.csv"
|
5 |
-
output_file = "cleaned_dataset.csv"
|
6 |
-
|
7 |
-
# Bersihkan Dataset
|
8 |
-
with open(input_file, "r") as infile, open(output_file, "w", newline="") as outfile:
|
9 |
-
reader = csv.reader(infile)
|
10 |
-
writer = csv.writer(outfile)
|
11 |
-
|
12 |
-
for row in reader:
|
13 |
-
# Hanya tulis baris dengan tepat 2 kolom
|
14 |
-
if len(row) == 2:
|
15 |
-
writer.writerow(row)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|