1
I have data with the following columns: "Date","Codproduct","Sale","Quantity" I need to create several data frames in python, filtering product and selecting the other columns and always saved with the product name, for example: dates_123, dates_324. I need something like this, wearing pandas:
dados_123 = dados.loc[dados.Codproduto==123, ['Data','Venda','Quantidade']]
The problem is that I have 50 distinct Codproduto and I needed to do this dynamically to filter each Codproduto and save now with the suffix of Codproduto.
Any idea how to do that?
Bruno, good evening! Is there a specific purpose to create several variables? tell your final goal, maybe there is a more interesting option. Hug!
– lmonferrari
Good morning! I want to make a demand projection model using Prophet, but to use it, it must contain only two variables (ds and y), date and sale, respectively. I would like to make predictions for all products, but in the prophet I did not find a function that let me set that should make one model per product, so I thought separating in several df would be better.
– brunorguima