taking some stuff about concatenating series with dictionary i wanted to concatenate the percentage info and average price info from step 7
perc_frame = pd.DataFrame(brand_sales,columns = ['percentage'])
avg_price_frame = pd.DataFrame.from_dict(avg_cost_10brands, orient = 'index', columns = ['average_price'])
the perc_frame is empty, and i don’t know why.
brand_sales = autos['brand'].value_counts(normalize=True).mul(100).head(10)
that’s where i get the percentages from, and brand_sales is a series.
Top 10 brands, and how much their sales made up the total sales:
volkswagen 21.091133
bmw 11.118456
opel 10.880487
mercedes_benz 9.371144
audi 8.798255
ford 6.998061
renault 4.814472
peugeot 3.067160
fiat 2.564781
seat 1.877314
Name: brand, dtype: float64
so pd.DataFrame should convert to a dataframe, and from there i should be able to just use pd.concat to combine them, but it doesn’t work because perc_frame is empty.