Skip to content

Commit

Permalink
Merge pull request #21 from seeq12/bugfix/jh/datatype-fix
Browse files Browse the repository at this point in the history
Bugfix/jh/datatype fix
  • Loading branch information
jameshiggie authored Nov 27, 2024
2 parents 90fd209 + 9dc0965 commit 78f8a9a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions seeq/addons/mps/_mps_sdl_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,17 @@ def get_worksheet_data(self, workbook_id, worksheet_id):
count += 1

for c in data_pull.columns:
if 'float64' != data_pull.dtypes[c]:
try:
signal_list.remove(c)
except:
pass
# Check if the column is not already float64
if data_pull.dtypes[c] != 'float64':
# Use to_numeric for conversion, set errors='coerce' to handle exceptions
data_pull[c] = pd.to_numeric(data_pull[c], errors='coerce')

# If after conversion column is still not float64, remove from signal_list if it exists
if data_pull.dtypes[c] != 'float64':
try:
data_pull[c] = data_pull[c].astype('float64')
except:
signal_list.remove(c)
except:
pass

Expand Down

0 comments on commit 78f8a9a

Please sign in to comment.