I have a question I can't get my head around, although I'm sure it's dead simple.
I import an excel file, with sales figures of cars.
I need to be able to report on it by country.
The country is not part of the file, but I have the info of all the cars of each country. (I can create another DataFrame from it, or a list, or dict...)
My idea was to create a hierarchie in the columns. I just can't figure out how.
import pandas as pd
german=['BMW','Audi','Mercedes','Volkswagen']
italian=['Fiat','Ferrari']
toclean=pd.DataFrame([['car','4','5',10,20,15,50,20,13,24]],
columns=['type','wheels','seats','BMW','Audi','Mercedes','Volkswagen','Fiat','Ferrari','SEAT'])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…