Skip to content

Commit cad22ac

Browse files
committed
Handle newer Pandas (ref #123)
1 parent 0d3ae68 commit cad22ac

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Pilot1/Uno/uno_data.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ def load_combo_dose_response(fraction=True):
183183
path = get_file(DATA_URL + "ComboDrugGrowth_Nov2017.csv")
184184
df = global_cache.get(path)
185185
if df is None:
186+
# Handle multiple Pandas APIs:
187+
if pd.__version__ >= "1.4.0":
188+
pandas_csv_errors = { "on_bad_lines": "warn" }
189+
else:
190+
pandas_csv_errors = { "error_bad_lines": False,
191+
"warn_bad_lines": True }
186192
df = pd.read_csv(
187193
path,
188194
sep=",",
@@ -211,8 +217,7 @@ def load_combo_dose_response(fraction=True):
211217
"SCREENER": str,
212218
"STUDY": str,
213219
},
214-
error_bad_lines=False,
215-
warn_bad_lines=True,
220+
**pandas_csv_errors
216221
)
217222
global_cache[path] = df
218223

0 commit comments

Comments
 (0)