I have a Dataframe with an id column of products that I need to separate into new dataframes, saving them on separated csvs and keep the dataframe with the rows that were not used to save in another csv, excluding the one that is now in the new dataframes. What's the best way to do this?
Df_original
Id value Product_id
0 1 123 7
1 2 514 9
2 3 234 1
3 4 912 9
4 5 325 1
5 6 301 7
6 7 325 1
7 8 301 9
then i create two new dataframes for product id 7 and 9
Df_new_pd_7
Id value Product_id
0 1 123 7
5 6 301 7
Df_new_pd_9
Id value Product_id
1 2 514 9
3 4 912 9
7 8 301 9
so my original dataframe will look like this
Df_original
Id value Product_id
2 3 234 1
4 5 325 1
6 7 325 1