1
good afternoon!
I got csv down:
Nome Vendas Produto Data
Carlos 83,40 cod2 15/04/2020
Andre 70,50 cod5 10/04/2020
Cristina 100 cod7 25/04/2020
Carlos 20,80 cod1 03/04/2020
Gisele 10,50 cod9 11/04/2020
Andre 33,70 cod6 30/04/2020
I put only a piece for example and demonstrate my idea.
I need it this way: Let the columns have the names and below each name the sales value.
Carlos Andre Cristina Gisele
83,40 70,50 100 10,50
20,80 33,70
Well, the first step was trying to put that structure together. I used the code below:
import pandas as pd
import codecs
arquivo = pd.read_csv(codecs.open("C:\\Users\\Desktop\\Python\\relatorio.csv", "rU", "ansi"),sep=';',infer_datetime_format=True, index_col=False)
arquivo.columns = ['Nome','Vendas']
Nomes = arquivo[['Nome']]
Nomes = Nomes.drop_duplicates(subset = ['Nome'])
Nomes = Nomes.reset_index()
Nomes_drop = Nomes.drop(columns = ['index'])
Nomes_Colunas = Nomes_drop.T.reset_index()
Now I have no idea how to do this "procv" to bring the sales information to the respective columns. Could someone help me?
Very grateful, it worked.
– Felipe Ferreira