Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dskit/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def load(filepath):

def read_folder(folder_path, file_type='csv'):
"""
Loads multiple files from a folder and concatenates them.
Load multiple files from a folder and return
a list of pandas DataFrames.
"""
if not os.path.exists(folder_path):
raise FileNotFoundError(f"The folder '{folder_path}' was not found.")
Expand All @@ -47,7 +48,7 @@ def read_folder(folder_path, file_type='csv'):
df_list.append(df)

if df_list:
return pd.concat(df_list, ignore_index=True)
return df_list
else:
return None

Expand Down