-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoops.py
More file actions
32 lines (29 loc) · 839 Bytes
/
oops.py
File metadata and controls
32 lines (29 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#more mistakes
import pandas as pd
import glob
import os
#record = "years"
files = glob.glob(".\SH_data\label_sets\labeled\\contains_d\*.csv")#.format(record))
# nums = []
# for f in files:
# x = f.split()[0]
# x = x.split("\\")[-1]
# nums.append(int(x))
# # os.rename(f, f.replace("SH_data\label_sets", "to_veiw_later/year"))
# nums = list(set(nums))
# nums.sort()
# print(nums)
# quit()
# indexes = [0]
for f in files:
df = pd.read_csv(f)
df_index = df['reason'].tolist()
try:
df_index = df["reason"].tolist()
except:
os.rename(f, f.replace("label_sets\labeled\\contains_d", "d_no_reason"))
print("bad moved" +(f))
continue
if "f" in df_index:
os.rename(f, f.replace("label_sets\labeled\\contains_d", "pot_null"))
print("moved" +(f))