Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pop dayfirst attribute before read_excel. #173

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion timely_beliefs/beliefs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ def read_csv( # noqa C901
if col not in kwargs.get("usecols", [])
]
ext = find_out_extension(path)

dayfirst = kwargs.pop("dayfirst", None)

if ext.lower() == "csv":
df = pd.read_csv(path, **kwargs)
elif ext.lower() in ("xlsm", "xlsx", "xls"):
Expand All @@ -639,7 +642,7 @@ def read_csv( # noqa C901
raise TypeError(
f"Extension {ext} not recognized. Accepted file extensions are csv, xlsm, xlsx and xls."
)
dayfirst = kwargs.pop("dayfirst", None)

if filter_by_column:
# Filter the read-in data
for col, val in filter_by_column.items():
Expand Down