-1

if I have a table of data say 3x3, something like:

row1 'blue','red', 20
row2 'green','yellow', 15
row3 'orange', 'purple', 25

how would I add a 4th row to the bottom of the table

row4 'pink','brown', 30

so that now the table is 4 rows and three columns?

  • 4
    This question is lacking a lot of details. How is your "table of data" implemented? – gspr Sep 08 '20 at 14:47
  • Is this a pandas dataframe? If yes check here: https://stackoverflow.com/questions/10715965/add-one-row-to-pandas-dataframe – IoaTzimas Sep 08 '20 at 14:49

1 Answers1

1

with the info you have given i supose you want to do that:

Just create the table

Table=[row1,row2,row3]

Then append the fourth row

Table.append(row4)

Then your table will be this:

Table=[row1,row2,row3,row4]

So if for example you want to take the info from col 1 and row 4 just:

print(Table[4,1])

Hope it help, have a nice day,

David.