0
I am new in python and am trying to get information from a CSV and pass to JSON.
The CSV is of this format:
QTD Produto Estoque_Limitado
20 pipoca 1
19 refrigerante 1
21 doces 0
"Stock_limited" would be a boolean, so if you have in stock would be 1, if you are 0 would need to replace
The question is as follows, as taken from csv in this dynamical way?
json is like this:
{
"indisponivel":{
"produto": "doces",
"quantidade": 21,
"Estoque": "Reposição necessária"
}
}
I’m taking by python the name of the product and the quantity already, but I need this condition to pick over the stock
Pyhton:
import pandas as pd
import json
data = pd.read_csv(r"monitoramento.csv", sep=";")
#Trazendo dados fixos
produto=data['Produto']
quantidade = data['QTD']
all products that were 0, would need to enter the json and there would be more products than those 3 that I mentioned.
Anyone who can help, thank you
I managed to pull the data this way, thank you very much! helped a lot
– Vitor Xavier