Use the method value_counts to count the number o...
Use the method value_counts to count the number o...
import pandas as pd
import io
data = """id,Unnamed:
0,symboling,normalized-losses,make,fuel-type,aspiration,num-of-doors,body-s
tyle,drive-wheels,engine-location,wheel-base,length,width,height,curb-weight,
engine-type,num-of-cylinders,engine-size,fuel-system,bore,stroke,compressio
n-ratio,horsepower,peak-rpm,city-mpg,highway-mpg,price
1,0,3,?,alfa-romero,gas,std,two,convertible,rwd,front,88.6,168.8,64.1,48.8,2548,d
ohc,four,130,mpfi,3.47,2.68,9.0,111,5000,21,27,13495
2,1,3,?,alfa-romero,gas,std,two,convertible,rwd,front,88.6,168.8,64.1,48.8,2548,d
ohc,four,130,mpfi,3.47,2.68,9.0,111,5000,21,27,16500
3,2,1,?,alfa-romero,gas,std,two,hatchback,rwd,front,94.5,171.2,65.5,52.4,2823,oh
cv,six,152,mpfi,2.68,3.47,9.0,154,5000,19,26,16500
4,3,2,164,audi,gas,std,four,sedan,fwd,front,99.8,176.6,66.2,54.3,2337,ohc,four,109
,mpfi,3.19,3.40,10.0,102,5500,24,30,13950
5,4,2,164,audi,gas,std,four,sedan,4wd,front,99.4,176.6,66.4,54.3,2824,ohc,five,13
6,mpfi,3.19,3.40,8.0,115,5500,18,22,17450
6,5,2,?,audi,gas,std,two,sedan,fwd,front,99.8,177.3,66.3,53.1,2507,ohc,five,136,m
pfi,3.19,3.40,8.5,110,5500,19,25,15250
7,6,1,158,audi,gas,std,four,sedan,fwd,front,105.8,192.7,71.4,55.7,2844,ohc,five,136
,mpfi,3.19,3.40,8.5,110,5500,19,25,17710
8,7,1,?,audi,gas,std,four,wagon,fwd,front,105.8,192.7,71.4,55.7,2954,ohc,five,136,
mpfi,3.19,3.40,8.5,110,5500,19,25,18920
9,8,1,158,audi,gas,turbo,four,sedan,fwd,front,105.8,192.7,71.4,55.9,3086,ohc,five,1
31,mpfi,3.13,3.40,8.3,140,5500,17,20,23875
10,9,0,?,audi,gas,turbo,two,hatchback,4wd,front,99.5,178.2,67.9,52.0,3053,ohc,fi
ve,131,mpfi,3.13,3.40,7.0,160,5500,16,22,?
"""
df = pd.read_csv(io.StringIO(data))
print(df.describe())
Fuentes
1. https://github.com/josepablocam/wranglesearch
2. https://github.com/Shaharuf/Data-analysis-with-Python