Here's my code:
inv_power = inv_power.set_axis(['Timestamp', 'Time', 'INV1','INV2','INV3','INV4','INV5','INV6','INV7','INV8','INV9','INV10', 'INV11','INV12','INV13','INV14','INV15','INV16','INV17','INV18','INV19','INV20'], axis=1)
inv_power = inv_power.replace('', np.nan).set_index('Timestamp').stack().reset_index(name='AC_Power').drop('level_1', 1)
inv_power['Slot No.']= pd.np.tile(inverter, len(inv_power) // len(inverter)).tolist() + inverter[:len(inv_power)%len(inverter)]
try this... this works
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.