From 0afc691ec95714040fe9eef3040913bb21df8677 Mon Sep 17 00:00:00 2001 From: Dave McKay Date: Thu, 25 Jul 2024 13:52:03 +0100 Subject: [PATCH] drop int series --- csd3-side/scripts/gen_exclude_list.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/csd3-side/scripts/gen_exclude_list.py b/csd3-side/scripts/gen_exclude_list.py index c25ba35..9f994e6 100644 --- a/csd3-side/scripts/gen_exclude_list.py +++ b/csd3-side/scripts/gen_exclude_list.py @@ -30,18 +30,13 @@ mask_first = df['PATH_LEVELS'] == df['PATH_LEVELS'].min() mask_second = df['PATH_LEVELS'] == df['PATH_LEVELS'].min() + 1 mask = mask_first + mask_second -df = df[~mask] +df = df[~mask].drop(['PATH_LEVELS'], axis=1) if(len(df) == 0): exit('All paths are highest or second highest level, exiting.') print(df.head()) print(df.tail()) -for row in df.iterrows(): - if type(row[1]['LOCAL_FOLDER']) != str: - print(row[1]['LOCAL_FOLDER']) - print(type(row[1]['LOCAL_FOLDER'])) - raise ValueError('Non-string LOCAL_FOLDER') df = df.groupby('LOCAL_FOLDER').agg(','.join).reset_index().dropna() print(df['LOCAL_FOLDER'].head()) # df.to_csv('test.csv', index=False)