Fix TimeResponseData.to_pandas() for multi-trace responses by murrayrm · Pull Request #1088 · python-control/python-control
This PR addresses issue #1087. Multi-trace data (e.g., the output from a MIMO step response) was not being processed correctly. This PR creates a new column 'trace' for multi-trace responses and reshapes the data appropriately. Unit tests and updated documentation are included.
Thanks to @joaoantoniocardoso for finding this bug and providing a fix (modified only slightly here).
@joaoantoniocardoso: if you have time to try this out and confirm that it works for your use case, that would be great. I think the only difference is that I used 'trace' for the column label instead of 'trace_label'. I also had to do things a bit differently for the case where there were multiple traces (your example was "multi-trace" but with sys.ntrace=1 since you selected an input).