I have data in a list (numbers, numbers). I want to subtract the trailing number from this data and put it in a dataframe. The number before the comma in the list is equal to the index of the dataframe.
--------------Below is a code example. -------------
import pandas as pd
test_list=[(1,124),(2,234),(3,344)]
test_data={
'index' : [1,2,3],
'data1' : [3,5,6],
'data2' : [2,5,6]
}
test_df =pd.DataFrame(test_data)
test_df
Example Image
I want to add test_list to the last column of test_df. As an example, I made a small list and data frame with some examples. Can I put it like this?
