Skip to content

Commit feb6b0c

Browse files
committed
The to_list() method was introduced in Pandas v0.24.0. Catch error for earlier versions.
Tests are failing on the test-deb10-i386 build because it is running an old version of Pandas.
1 parent e6b3b69 commit feb6b0c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wfdb/io/convert/csv.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,12 @@ def csv_to_wfdb(
310310
# Check if signal names are valid and set defaults
311311
if not sig_name:
312312
if header:
313-
sig_name = df_CSV.columns.to_list()
313+
try:
314+
sig_name = df_CSV.columns.to_list()
315+
except AttributeError:
316+
# to_list() was introduced in Pandas v0.24.0
317+
# https://pandas.pydata.org/pandas-docs/stable/whatsnew/v0.24.0.html#other-api-changes
318+
sig_name = df_CSV.columns.tolist()
314319
if any(map(str.isdigit, sig_name)):
315320
print(
316321
"WARNING: One or more of your signal names are numbers, this "

0 commit comments

Comments
 (0)