Skip to content

Commit

Permalink
Handle newer Pandas (ref #123)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-woz committed Sep 19, 2023
1 parent 0d3ae68 commit cad22ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Pilot1/Uno/uno_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ def load_combo_dose_response(fraction=True):
path = get_file(DATA_URL + "ComboDrugGrowth_Nov2017.csv")
df = global_cache.get(path)
if df is None:
# Handle multiple Pandas APIs:
if pd.__version__ >= "1.4.0":
pandas_csv_errors = { "on_bad_lines": "warn" }
else:
pandas_csv_errors = { "error_bad_lines": False,
"warn_bad_lines": True }
df = pd.read_csv(
path,
sep=",",
Expand Down Expand Up @@ -211,8 +217,7 @@ def load_combo_dose_response(fraction=True):
"SCREENER": str,
"STUDY": str,
},
error_bad_lines=False,
warn_bad_lines=True,
**pandas_csv_errors
)
global_cache[path] = df

Expand Down

0 comments on commit cad22ac

Please sign in to comment.