Home > database >  how to add new raw to the data frame during a loop and a certain condition is met?
how to add new raw to the data frame during a loop and a certain condition is met?

Time:03-14

i want to add a new row when the iteration reach the raw which has 'total charges'. FYI: as shown in code, column number 1 is where it has to be performed.

python
for row in df.itertuples():
    row[1] == 'Total Charges'

enter image description here

  • Related