Daily Winston-Lutz App Error

After completing calculation of MV iso discrepancy but before reporting of results/statistics the following error is raised:

ValueError: style is not supported for non-unique indices


File "C:\Users\pexit\AppData\Local\pypoetry\Cache\virtualenvs\pymedphys-kNpW21K4-py3.7\lib\site-packages\streamlit\script_runner.py", line 338, in _run_script
    exec(code, module.__dict__)File "C:\Users\pexit\git\pymedphys\lib\pymedphys\_app.py", line 24, in <module>
    main()File "C:\Users\pexit\git\pymedphys\lib\pymedphys\_app.py", line 20, in main
    index.main()File "C:\Users\pexit\git\pymedphys\lib\pymedphys\_streamlit\index.py", line 167, in main
    application_function()File "C:\Users\pexit\git\pymedphys\lib\pymedphys\_experimental\streamlit\apps\daily_wlutz.py", line 60, in main
    _ui()File "C:\Users\pexit\git\pymedphys\lib\pymedphys\_experimental\streamlit\apps\daily_wlutz.py", line 153, in _ui
    styled_dataframe = statistics_collection.style.apply(File "C:\Users\pexit\AppData\Local\pypoetry\Cache\virtualenvs\pymedphys-kNpW21K4-py3.7\lib\site-packages\pandas\core\frame.py", line 901, in style
    return Styler(self)File "C:\Users\pexit\AppData\Local\pypoetry\Cache\virtualenvs\pymedphys-kNpW21K4-py3.7\lib\site-packages\pandas\io\formats\style.py", line 156, in __init__
    raise ValueError("style is not supported for non-unique indices.")

Hi @JacobMcAloney,

I just had a quick look, I reckon I can probably fix this one quickest just with a video call. Let me know when works best for you :slight_smile:


Hi @JacobMcAloney,

I’ve just undergone an initial fix within the following PR:

The fix implemented simply ignores the error, warns the user that something has occurred that means it can’t style the results as either “red” or “green”, and then it displays the results anyway and moves on.

When that warning does show up, if you could provide a screenshot of what the resulting Dataframe looks like that’d be awesome. From there I can work out what’s happened to it…