I've got some data I'm trying to reorganize in my pandas dataframe. Here is a snippet PNG:
So for each Date_Time reading there are 7 rows. What I want to do is condense those 7 rows down into one. And I want to sum all the important data columns (Voltage, Current, ChargeCapacity, DischargeCapacity, ChargeEnergy, DischargeEnergy, and dV/dt(V/s). Thank you!
How about this?
df.groupby("Date_Time")[["Voltage", "Current", "ChargeCapacity", "DischargeCapacity", "ChargeEnergy", "DischargeEnergy", "and dV/dt(V/s)"]].sum()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.