I want to create a self updating dataframe but am having trouble specifying the row

I have two dataframes,


And let’s say I have this: [0,'Sprite',34,2500,'Yes',3000] row in stock
I want to make it so if a row like this: [0,'2020/10/23','Sprite',45] is entered into the restocks dataframe, it automatically updates the column stock in stock. I’ve already taken care of the auto-update part, but I want to make sure that if the correct thing is updated.

Because if I put this: [0,'2020/10/23','Coke',32] row in restocks, it will update this: [0,'Sprite',34,2500,'Yes',3000] row which is not what I want to happen.

Basically checking to see if the item in the stock row matches the item in the restocks before I update the stock column.

sounds like you have to write a function and/or use .compare() to compare the DFs.

Or, add a date col to the stocks df(?)

1 Like

Can you elaborate on this?

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.