Open yujiadeng opened 2 years ago
This might be a dependency issue. Mine is good. I feel there is some updates in pandas causing this issue, but I agree the report function is written in quite a messy way. I will need to install the latest pandas and debug more.
I also met a similar issue when generating report, seems the numpy calculations returns an object which object 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
Hi, I just installed the package from pip. I was running the tutorial and failed to get the visualizations.
Reproduce:
I found all errors raised in the plot function is regarding to
BG
which is defined byBG = df.unstack(level=0).BG
. I tried both single day/ >1 days and looks the plot functions always raise error. What shape shouldBG
be?