From b16bbf716cae5ee5c2864a2150ee922dc22546a2 Mon Sep 17 00:00:00 2001 From: Nathan Randriamanana <37664429+TheAIWizard@users.noreply.github.com> Date: Fri, 3 May 2024 16:12:57 +0200 Subject: [PATCH] Update extract_test_data.py ignore folders and extract only files when extracting test data from batch folders --- utils/extract_test_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/extract_test_data.py b/utils/extract_test_data.py index ad6a12d..12cdd11 100644 --- a/utils/extract_test_data.py +++ b/utils/extract_test_data.py @@ -11,8 +11,8 @@ def transform_json_to_dataframe(json_dir: str): transformed_data = [] - - for filename in tqdm(os.listdir(json_dir)): + files_only = [item for item in os.listdir(json_dir) if os.path.isfile(os.path.join(json_dir, item))] + for filename in tqdm(files_only): with open(os.path.join(json_dir, filename), "r") as file: data = json.load(file)