Skip to content

Commit

Permalink
The to_list() method was introduced in Pandas v0.24.0. Catch error fo…
Browse files Browse the repository at this point in the history
…r earlier versions.

Tests are failing on the test-deb10-i386 build because it is running an old version of Pandas.
  • Loading branch information
tompollard committed Jul 9, 2024
1 parent e6b3b69 commit feb6b0c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wfdb/io/convert/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,12 @@ def csv_to_wfdb(
# Check if signal names are valid and set defaults
if not sig_name:
if header:
sig_name = df_CSV.columns.to_list()
try:
sig_name = df_CSV.columns.to_list()
except AttributeError:
# to_list() was introduced in Pandas v0.24.0
# https://pandas.pydata.org/pandas-docs/stable/whatsnew/v0.24.0.html#other-api-changes
sig_name = df_CSV.columns.tolist()
if any(map(str.isdigit, sig_name)):
print(
"WARNING: One or more of your signal names are numbers, this "
Expand Down

0 comments on commit feb6b0c

Please sign in to comment.