df = pd.read_csv('car data.csv')
df.head()
|
Car_Name |
Year |
Selling_Price |
Present_Price |
Kms_Driven |
Fuel_Type |
Seller_Type |
Transmission |
Owner |
0 |
ritz |
2014 |
3.35 |
5.59 |
27000 |
Petrol |
Dealer |
Manual |
0 |
1 |
sx4 |
2013 |
4.75 |
9.54 |
43000 |
Diesel |
Dealer |
Manual |
0 |
2 |
ciaz |
2017 |
7.25 |
9.85 |
6900 |
Petrol |
Dealer |
Manual |
0 |
3 |
wagon r |
2011 |
2.85 |
4.15 |
5200 |
Petrol |
Dealer |
Manual |
0 |
4 |
swift |
2014 |
4.60 |
6.87 |
42450 |
Diesel |
Dealer |
Manual |
0 |
pd.pivot_table(df, index='Fuel_Type')
|
Kms_Driven |
Owner |
Present_Price |
Selling_Price |
Year |
Fuel_Type |
|
|
|
|
|
CNG |
42749.000000 |
0.000000 |
6.415000 |
3.100000 |
2013.000000 |
Diesel |
50369.916667 |
0.016667 |
15.814500 |
10.278500 |
2014.000000 |
Petrol |
33528.937238 |
0.050209 |
5.583556 |
3.264184 |
2013.539749 |