thenineteen / Semiology-Visualisation-Tool

Data driven 3D brain visualisation of semiology. Semiology to anatomy translator based on over 4600 patients from 309 peer-reviewed articles.
MIT License
9 stars 6 forks source link

Inverse Localising Spread Values: Error cannot convert the series to <class 'float'> #196

Closed thenineteen closed 3 years ago

thenineteen commented 3 years ago

as per comment in #191 related to #190 - the tests and function were developed for a single row, hence this line worked:

float(new_inspect_result.loc[gif_indices, 'ratio'])

but during actual database query, .astype() is required rather than float()

thenineteen commented 3 years ago

problem was that the ratio by which to reduce/weigh the spread of locaisaiotn wasn't being broadcasted as expected when dealing with series and dataframes (as opposed to the tests, which were a single row)

pandas's df.multiply() was a little more tricky than expected, needing the df first (rather than the series of ratios) and the default axis was 'columns'. Changing this to 0 fixes the issue.