Skip to content

Commit

Permalink
error parameter deprecation in pandas 2.2 to_numeric function
Browse files Browse the repository at this point in the history
  • Loading branch information
patgo25 authored and gipert committed Feb 29, 2024
1 parent b0728a6 commit b7471bc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pygama/flow/file_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ def scan_files(self, dirs: list[str] = None) -> None:

# convert cols to numeric dtypes where possible
for col in self.df.columns:
self.df[col] = pd.to_numeric(self.df[col], errors="ignore")
try:
self.df[col] = pd.to_numeric(self.df[col])
except ValueError:
continue

# sort rows according to timestamps
utils.inplace_sort(self.df, self.sortby)
Expand Down Expand Up @@ -673,7 +676,10 @@ def scan_daq_files(self, daq_dir: str, daq_template: str) -> None:

# convert cols to numeric dtypes where possible
for col in self.df.columns:
self.df[col] = pd.to_numeric(self.df[col], errors="ignore")
try:
self.df[col] = pd.to_numeric(self.df[col])
except ValueError:
continue

def get_table_name(self, tier: str, tb: str) -> str:
"""Get the table name for a tier given its table identifier.
Expand Down

0 comments on commit b7471bc

Please sign in to comment.