Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Risk index calculation error in report generation #61

Closed
yihuicai opened this issue Jul 25, 2023 · 0 comments
Closed

Risk index calculation error in report generation #61

yihuicai opened this issue Jul 25, 2023 · 0 comments

Comments

@yihuicai
Copy link
Contributor

yihuicai commented Jul 25, 2023

I also met a similar issue when generating report, seems the numpy calculations return an object which is not compatible with DataFrame object in pandas library:

Traceback (most recent call last): File "/home/alan/simglucose/sim_origin.py", line 6, in <module> simulate(start_time=datetime.combine(datetime.now().date(), datetime.min.time()),controller=BBController(),cgm_seed=123412,animate=False,parallel=True) File "/home/alan/simglucose/simglucose/simulation/user_interface.py", line 383, in simulate results, ri_per_hour, zone_stats, figs, axes = report(df, save_path) File "/home/alan/simglucose/simglucose/analysis/report.py", line 251, in report ri_per_hour, ri_mean, fig_ri, ax5 = risk_index_trace(BG, visualize=False) File "/home/alan/simglucose/simglucose/analysis/report.py", line 102, in risk_index_trace fBG_df = pd.concat(fBG, axis=1).transpose() File "/home/alan/.local/lib/python3.10/site-packages/pandas/core/reshape/concat.py", line 372, in concat op = _Concatenator( File "/home/alan/.local/lib/python3.10/site-packages/pandas/core/reshape/concat.py", line 462, in __init__ raise TypeError(msg) TypeError: cannot concatenate object of type '<class 'numpy.float64'>'; only Series and DataFrame objs are valid

My dependencies are:

pandas: 2.0.2
numpy: 1.24.3
Python: 3.10.6

Originally posted by @yihuicai in #42 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants