Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
The to_list() method was introduced in Pandas v0.24.0. Catch error fo…
…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
commit feb6b0c99ac390ec301309b43d6753a9a5e764f8
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