0

I created a datafame as shown below. I have to add another name in index and update scores; how to append it to existing. data? I have to add 'Pandey' in index and Test1 = 56 and Test2 = 76

test_score = pd.DataFrame(          
                    {'Test1':[82,75,83,92,85],

                     'Test2':[85,81,75,85,91]},

                      index = ['Sachin','Dravid','virat','Rohith','Dhawan'])

My result should be

       Test1    Test2

Sachin  82       85

Dravid  75       81

virat   83       75

Rohith  92       85

Dhawan  85       91

Pandey  56       76
Roberto Caboni
  • 7,252
  • 10
  • 25
  • 39
  • Does this answer your question? [Add one row to pandas DataFrame](https://stackoverflow.com/questions/10715965/add-one-row-to-pandas-dataframe) – Qiu May 29 '20 at 12:44

1 Answers1

1
row = pd.Series({'Test1':56, 'Test2' : 76},index='pandey')
test_score= test_score.append(row)
Shafay
  • 187
  • 2
  • 7