-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclear_trash.py
24 lines (19 loc) · 890 Bytes
/
clear_trash.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# clear and deletes old pickle and analysis files so that the vampire package doesn't get confused.
import pandas as pd
import shutil
import os
cyto = r'C:\Users\super\Documents\Aghi Lab PC\CAF Project\Grouped Segmentation' \
r'\04052021 combined dataset\Segmented image sets propagation cyt.csv'
nuc = r'C:\Users\super\Documents\Aghi Lab PC\CAF Project\Grouped Segmentation' \
r'\04052021 combined dataset\Segmented image sets propagation nuc.csv'
cyto_df = pd.read_csv(cyto)
nuc_df = pd.read_csv(nuc)
dataframes = [cyto_df, nuc_df]
for grids in dataframes:
for path in grids['set location']:
files = os.listdir(path)
for item in files:
if item.endswith(".pickle"):
os.remove(os.path.join(path, item))
if item.startswith("VAMPIRE"):
os.remove(os.path.join(path,item))