kdavies4 / ModelicaRes

Set up, analyze, and plot Modelica simulations in Python
http://kdavies4.github.io/ModelicaRes/
Other
51 stars 20 forks source link

to_pandas() error when progressing modified simulation data #39

Open FWuellhorst opened 7 years ago

FWuellhorst commented 7 years ago

When trying to export simulation data to a dataFrame pandas raises a KeyError. The problem is that Dymola does not store the units into the *.mat-file when using Dymola functions like "writeTrajectory" or "Export Results". It would be great if the function's return line could be updated to a more dynamic one, like: return DataFrame(data).set_index('Time / '+self['Time'].unit) This way one could use to_pandas() for modified simulation data. Of course it would also be possible to change the data entry 'Time / ' to 'Time / s'.