You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes a column looks like it's continuous, but fails to convert to float, like e.g. Cigarettes.per.Day which was drawn from a questionnaire which offered 0, 1, 3, 5, ... and the option Unknown. As a result of this, add_annotations will throw an error, saying it cannot convert 'Unkown' to float. This should probably be wrapped in a try/except statement that tells you which columns it had trouble converting. Not entirely sure if it'll be like in the code below, but it's just a sketch for now.
try:
self.continuous_annotations=annotations[
annotations.columns[column_types==1]
].astype(float)
exceptValueError:
forcolumninannotations.columns[column_types==1]:
ifnotcheck_column_float_convertible(annotations.loc[:,column]):
logging.error(f'{column} column cannot be converted to float, check unique values')
ValueError("Unable to convert columns to float")
The text was updated successfully, but these errors were encountered:
Sometimes a column looks like it's continuous, but fails to convert to float, like e.g.
Cigarettes.per.Day
which was drawn from a questionnaire which offered 0, 1, 3, 5, ... and the option Unknown. As a result of this,add_annotations
will throw an error, saying it cannot convert'Unkown'
to float. This should probably be wrapped in a try/except statement that tells you which columns it had trouble converting. Not entirely sure if it'll be like in the code below, but it's just a sketch for now.The text was updated successfully, but these errors were encountered: