Skip to content

Commit

Permalink
Pop dayfirst attribute before read_excel. (#173)
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
  • Loading branch information
victorgarcia98 committed Mar 21, 2024
1 parent 4e6a6f5 commit f166edf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion timely_beliefs/beliefs/utils.py
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

0 comments on commit f166edf

Please sign in to comment.