This project will process a dataset from ebay germany of cars. The data is more real-world and we will be able to see what a real data scientist deals with.

In [85]:
import pandas as pd
import numpy as np

autos = pd.read_csv('autos.csv', encoding='Latin-1')
In [5]:
autos
Out[5]:
dateCrawled name seller offerType price abtest vehicleType yearOfRegistration gearbox powerPS model odometer monthOfRegistration fuelType brand notRepairedDamage dateCreated nrOfPictures postalCode lastSeen
0 2016-03-26 17:47:46 Peugeot_807_160_NAVTECH_ON_BOARD privat Angebot $5,000 control bus 2004 manuell 158 andere 150,000km 3 lpg peugeot nein 2016-03-26 00:00:00 0 79588 2016-04-06 06:45:54
1 2016-04-04 13:38:56 BMW_740i_4_4_Liter_HAMANN_UMBAU_Mega_Optik privat Angebot $8,500 control limousine 1997 automatik 286 7er 150,000km 6 benzin bmw nein 2016-04-04 00:00:00 0 71034 2016-04-06 14:45:08
2 2016-03-26 18:57:24 Volkswagen_Golf_1.6_United privat Angebot $8,990 test limousine 2009 manuell 102 golf 70,000km 7 benzin volkswagen nein 2016-03-26 00:00:00 0 35394 2016-04-06 20:15:37
3 2016-03-12 16:58:10 Smart_smart_fortwo_coupe_softouch/F1/Klima/Pan... privat Angebot $4,350 control kleinwagen 2007 automatik 71 fortwo 70,000km 6 benzin smart nein 2016-03-12 00:00:00 0 33729 2016-03-15 03:16:28
4 2016-04-01 14:38:50 Ford_Focus_1_6_Benzin_TÜV_neu_ist_sehr_gepfleg... privat Angebot $1,350 test kombi 2003 manuell 0 focus 150,000km 7 benzin ford nein 2016-04-01 00:00:00 0 39218 2016-04-01 14:38:50
5 2016-03-21 13:47:45 Chrysler_Grand_Voyager_2.8_CRD_Aut.Limited_Sto... privat Angebot $7,900 test bus 2006 automatik 150 voyager 150,000km 4 diesel chrysler NaN 2016-03-21 00:00:00 0 22962 2016-04-06 09:45:21
6 2016-03-20 17:55:21 VW_Golf_III_GT_Special_Electronic_Green_Metall... privat Angebot $300 test limousine 1995 manuell 90 golf 150,000km 8 benzin volkswagen NaN 2016-03-20 00:00:00 0 31535 2016-03-23 02:48:59
7 2016-03-16 18:55:19 Golf_IV_1.9_TDI_90PS privat Angebot $1,990 control limousine 1998 manuell 90 golf 150,000km 12 diesel volkswagen nein 2016-03-16 00:00:00 0 53474 2016-04-07 03:17:32
8 2016-03-22 16:51:34 Seat_Arosa privat Angebot $250 test NaN 2000 manuell 0 arosa 150,000km 10 NaN seat nein 2016-03-22 00:00:00 0 7426 2016-03-26 18:18:10
9 2016-03-16 13:47:02 Renault_Megane_Scenic_1.6e_RT_Klimaanlage privat Angebot $590 control bus 1997 manuell 90 megane 150,000km 7 benzin renault nein 2016-03-16 00:00:00 0 15749 2016-04-06 10:46:35
10 2016-03-15 01:41:36 VW_Golf_Tuning_in_siber/grau privat Angebot $999 test NaN 2017 manuell 90 NaN 150,000km 4 benzin volkswagen nein 2016-03-14 00:00:00 0 86157 2016-04-07 03:16:21
11 2016-03-16 18:45:34 Mercedes_A140_Motorschaden privat Angebot $350 control NaN 2000 NaN 0 NaN 150,000km 0 benzin mercedes_benz NaN 2016-03-16 00:00:00 0 17498 2016-03-16 18:45:34
12 2016-03-31 19:48:22 Smart_smart_fortwo_coupe_softouch_pure_MHD_Pan... privat Angebot $5,299 control kleinwagen 2010 automatik 71 fortwo 50,000km 9 benzin smart nein 2016-03-31 00:00:00 0 34590 2016-04-06 14:17:52
13 2016-03-23 10:48:32 Audi_A3_1.6_tuning privat Angebot $1,350 control limousine 1999 manuell 101 a3 150,000km 11 benzin audi nein 2016-03-23 00:00:00 0 12043 2016-04-01 14:17:13
14 2016-03-23 11:50:46 Renault_Clio_3__Dynamique_1.2__16_V;_viele_Ver... privat Angebot $3,999 test kleinwagen 2007 manuell 75 clio 150,000km 9 benzin renault NaN 2016-03-23 00:00:00 0 81737 2016-04-01 15:46:47
15 2016-04-01 12:06:20 Corvette_C3_Coupe_T_Top_Crossfire_Injection privat Angebot $18,900 test coupe 1982 automatik 203 NaN 80,000km 6 benzin sonstige_autos nein 2016-04-01 00:00:00 0 61276 2016-04-02 21:10:48
16 2016-03-16 14:59:02 Opel_Vectra_B_Kombi privat Angebot $350 test kombi 1999 manuell 101 vectra 150,000km 5 benzin opel nein 2016-03-16 00:00:00 0 57299 2016-03-18 05:29:37
17 2016-03-29 11:46:22 Volkswagen_Scirocco_2_G60 privat Angebot $5,500 test coupe 1990 manuell 205 scirocco 150,000km 6 benzin volkswagen nein 2016-03-29 00:00:00 0 74821 2016-04-05 20:46:26
18 2016-03-26 19:57:44 Verkaufen_mein_bmw_e36_320_i_touring privat Angebot $300 control bus 1995 manuell 150 3er 150,000km 0 benzin bmw NaN 2016-03-26 00:00:00 0 54329 2016-04-02 12:16:41
19 2016-03-17 13:36:21 mazda_tribute_2.0_mit_gas_und_tuev_neu_2018 privat Angebot $4,150 control suv 2004 manuell 124 andere 150,000km 2 lpg mazda nein 2016-03-17 00:00:00 0 40878 2016-03-17 14:45:58
20 2016-03-05 19:57:31 Audi_A4_Avant_1.9_TDI_*6_Gang*AHK*Klimatronik*... privat Angebot $3,500 test kombi 2003 manuell 131 a4 150,000km 5 diesel audi NaN 2016-03-05 00:00:00 0 53913 2016-03-07 05:46:46
21 2016-03-06 19:07:10 Porsche_911_Carrera_4S_Cabrio privat Angebot $41,500 test cabrio 2004 manuell 320 911 150,000km 4 benzin porsche nein 2016-03-06 00:00:00 0 65428 2016-04-05 23:46:19
22 2016-03-28 20:50:54 MINI_Cooper_S_Cabrio privat Angebot $25,450 control cabrio 2015 manuell 184 cooper 10,000km 1 benzin mini nein 2016-03-28 00:00:00 0 44789 2016-04-01 06:45:30
23 2016-03-10 19:55:34 Peugeot_Boxer_2_2_HDi_120_Ps_9_Sitzer_inkl_Klima privat Angebot $7,999 control bus 2010 manuell 120 NaN 150,000km 2 diesel peugeot nein 2016-03-10 00:00:00 0 30900 2016-03-17 08:45:17
24 2016-04-03 11:57:02 BMW_535i_xDrive_Sport_Aut. privat Angebot $48,500 control limousine 2014 automatik 306 5er 30,000km 12 benzin bmw nein 2016-04-03 00:00:00 0 22547 2016-04-07 13:16:50
25 2016-03-21 21:56:18 Ford_escort_kombi_an_bastler_mit_ghia_ausstattung privat Angebot $90 control kombi 1996 manuell 116 NaN 150,000km 4 benzin ford ja 2016-03-21 00:00:00 0 27574 2016-04-01 05:16:49
26 2016-04-03 22:46:28 Volkswagen_Polo_Fox privat Angebot $777 control kleinwagen 1992 manuell 54 polo 125,000km 2 benzin volkswagen nein 2016-04-03 00:00:00 0 38110 2016-04-05 23:46:48
27 2016-03-27 18:45:01 Hat_einer_Ahnung_mit_Ford_Galaxy_HILFE privat Angebot $0 control NaN 2005 NaN 0 NaN 150,000km 0 NaN ford NaN 2016-03-27 00:00:00 0 66701 2016-03-27 18:45:01
28 2016-03-19 21:56:19 MINI_Cooper_D privat Angebot $5,250 control kleinwagen 2007 manuell 110 cooper 150,000km 7 diesel mini ja 2016-03-19 00:00:00 0 15745 2016-04-07 14:58:48
29 2016-04-02 12:45:44 Mercedes_Benz_E_320_T_CDI_Avantgarde_DPF7_Sitz... privat Angebot $4,999 test kombi 2004 automatik 204 e_klasse 150,000km 10 diesel mercedes_benz nein 2016-04-02 00:00:00 0 47638 2016-04-02 12:45:44
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
49970 2016-03-21 22:47:37 c4_Grand_Picasso_mit_Automatik_Leder_Navi_Temp... privat Angebot $15,800 control bus 2010 automatik 136 c4 60,000km 4 diesel citroen nein 2016-03-21 00:00:00 0 14947 2016-04-07 04:17:34
49971 2016-03-29 14:54:12 W.Lupo_1.0 privat Angebot $950 test kleinwagen 2001 manuell 50 lupo 150,000km 4 benzin volkswagen nein 2016-03-29 00:00:00 0 65197 2016-03-29 20:41:51
49972 2016-03-26 22:25:23 Mercedes_Benz_Vito_115_CDI_Extralang_Aut. privat Angebot $3,300 control bus 2004 automatik 150 vito 150,000km 10 diesel mercedes_benz ja 2016-03-26 00:00:00 0 65326 2016-03-28 11:28:18
49973 2016-03-27 05:32:39 Mercedes_Benz_SLK_200_Kompressor privat Angebot $6,000 control cabrio 2004 manuell 163 slk 150,000km 11 benzin mercedes_benz nein 2016-03-27 00:00:00 0 53567 2016-03-27 08:25:24
49974 2016-03-20 10:52:31 Golf_1_Cabrio_Tuev_Neu_viele_Extras_alles_eing... privat Angebot $0 control cabrio 1983 manuell 70 golf 150,000km 2 benzin volkswagen nein 2016-03-20 00:00:00 0 8209 2016-03-27 19:48:16
49975 2016-03-27 20:51:39 Honda_Jazz_1.3_DSi_i_VTEC_IMA_CVT_Comfort privat Angebot $9,700 control kleinwagen 2012 automatik 88 jazz 100,000km 11 hybrid honda nein 2016-03-27 00:00:00 0 84385 2016-04-05 19:45:34
49976 2016-03-19 18:56:05 Audi_80_Avant_2.6_E__Vollausstattung!!_Einziga... privat Angebot $5,900 test kombi 1992 automatik 150 80 150,000km 12 benzin audi nein 2016-03-19 00:00:00 0 36100 2016-04-07 06:16:44
49977 2016-03-31 18:37:18 Mercedes_Benz_C200_Cdi_W203 privat Angebot $5,500 control limousine 2003 manuell 116 c_klasse 150,000km 2 diesel mercedes_benz nein 2016-03-31 00:00:00 0 33739 2016-04-06 12:16:11
49978 2016-04-04 10:37:14 Mercedes_Benz_E_200_Classic privat Angebot $900 control limousine 1996 automatik 136 e_klasse 150,000km 9 benzin mercedes_benz ja 2016-04-04 00:00:00 0 24405 2016-04-06 12:44:20
49979 2016-03-20 18:38:40 Volkswagen_Polo_1.6_TDI_Style privat Angebot $11,000 test kleinwagen 2011 manuell 90 polo 70,000km 11 diesel volkswagen nein 2016-03-20 00:00:00 0 48455 2016-04-07 01:45:12
49980 2016-03-12 10:55:54 Ford_Escort_Turnier_16V privat Angebot $400 control kombi 1995 manuell 105 escort 125,000km 3 benzin ford NaN 2016-03-12 00:00:00 0 56218 2016-04-06 17:16:49
49981 2016-03-15 09:38:21 Opel_Astra_Kombi_mit_Anhaengerkupplung privat Angebot $2,000 control kombi 1998 manuell 115 astra 150,000km 12 benzin opel nein 2016-03-15 00:00:00 0 86859 2016-04-05 17:21:46
49982 2016-03-29 18:51:08 Skoda_Fabia_4_Tuerer_Bj:2004__85.000Tkm privat Angebot $1,950 control kleinwagen 2004 manuell 0 fabia 90,000km 7 benzin skoda NaN 2016-03-29 00:00:00 0 45884 2016-03-29 18:51:08
49983 2016-03-06 12:43:04 Ford_focus_99 privat Angebot $600 test kleinwagen 1999 manuell 101 focus 150,000km 4 benzin ford NaN 2016-03-06 00:00:00 0 52477 2016-03-09 06:16:08
49984 2016-03-31 22:48:48 Student_sucht_ein__Anfaengerauto___ab_2000_BJ_... privat Angebot $0 test NaN 2000 NaN 0 NaN 150,000km 0 NaN sonstige_autos NaN 2016-03-31 00:00:00 0 12103 2016-04-02 19:44:53
49985 2016-04-02 16:38:23 Verkaufe_meinen_vw_vento! privat Angebot $1,000 control NaN 1995 automatik 0 NaN 150,000km 0 benzin volkswagen NaN 2016-04-02 00:00:00 0 30900 2016-04-06 15:17:52
49986 2016-04-04 20:46:02 Chrysler_300C_3.0_CRD_DPF_Automatik_Voll_Ausst... privat Angebot $15,900 control limousine 2010 automatik 218 300c 125,000km 11 diesel chrysler nein 2016-04-04 00:00:00 0 73527 2016-04-06 23:16:00
49987 2016-03-22 20:47:27 Audi_A3_Limousine_2.0_TDI_DPF_Ambition__NAVI__... privat Angebot $21,990 control limousine 2013 manuell 150 a3 50,000km 11 diesel audi nein 2016-03-22 00:00:00 0 94362 2016-03-26 22:46:06
49988 2016-03-28 19:49:51 BMW_330_Ci privat Angebot $9,550 control coupe 2001 manuell 231 3er 150,000km 10 benzin bmw nein 2016-03-28 00:00:00 0 83646 2016-04-07 02:17:40
49989 2016-03-11 19:50:37 VW_Polo_zum_Ausschlachten_oder_Wiederaufbau privat Angebot $150 test kleinwagen 1997 manuell 0 polo 150,000km 5 benzin volkswagen ja 2016-03-11 00:00:00 0 21244 2016-03-12 10:17:55
49990 2016-03-21 19:54:19 Mercedes_Benz_A_200__BlueEFFICIENCY__Urban privat Angebot $17,500 test limousine 2012 manuell 156 a_klasse 30,000km 12 benzin mercedes_benz nein 2016-03-21 00:00:00 0 58239 2016-04-06 22:46:57
49991 2016-03-06 15:25:19 Kleinwagen privat Angebot $500 control NaN 2016 manuell 0 twingo 150,000km 0 benzin renault NaN 2016-03-06 00:00:00 0 61350 2016-03-06 18:24:19
49992 2016-03-10 19:37:38 Fiat_Grande_Punto_1.4_T_Jet_16V_Sport privat Angebot $4,800 control kleinwagen 2009 manuell 120 andere 125,000km 9 lpg fiat nein 2016-03-10 00:00:00 0 68642 2016-03-13 01:44:51
49993 2016-03-15 18:47:35 Audi_A3__1_8l__Silber;_schoenes_Fahrzeug privat Angebot $1,650 control kleinwagen 1997 manuell 0 NaN 150,000km 7 benzin audi NaN 2016-03-15 00:00:00 0 65203 2016-04-06 19:46:53
49994 2016-03-22 17:36:42 Audi_A6__S6__Avant_4.2_quattro_eventuell_Tausc... privat Angebot $5,000 control kombi 2001 automatik 299 a6 150,000km 1 benzin audi nein 2016-03-22 00:00:00 0 46537 2016-04-06 08:16:39
49995 2016-03-27 14:38:19 Audi_Q5_3.0_TDI_qu._S_tr.__Navi__Panorama__Xenon privat Angebot $24,900 control limousine 2011 automatik 239 q5 100,000km 1 diesel audi nein 2016-03-27 00:00:00 0 82131 2016-04-01 13:47:40
49996 2016-03-28 10:50:25 Opel_Astra_F_Cabrio_Bertone_Edition___TÜV_neu+... privat Angebot $1,980 control cabrio 1996 manuell 75 astra 150,000km 5 benzin opel nein 2016-03-28 00:00:00 0 44807 2016-04-02 14:18:02
49997 2016-04-02 14:44:48 Fiat_500_C_1.2_Dualogic_Lounge privat Angebot $13,200 test cabrio 2014 automatik 69 500 5,000km 11 benzin fiat nein 2016-04-02 00:00:00 0 73430 2016-04-04 11:47:27
49998 2016-03-08 19:25:42 Audi_A3_2.0_TDI_Sportback_Ambition privat Angebot $22,900 control kombi 2013 manuell 150 a3 40,000km 11 diesel audi nein 2016-03-08 00:00:00 0 35683 2016-04-05 16:45:07
49999 2016-03-14 00:42:12 Opel_Vectra_1.6_16V privat Angebot $1,250 control limousine 1996 manuell 101 vectra 150,000km 1 benzin opel nein 2016-03-13 00:00:00 0 45897 2016-04-06 21:18:48

50000 rows × 20 columns

In [6]:
autos.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 50000 entries, 0 to 49999
Data columns (total 20 columns):
dateCrawled            50000 non-null object
name                   50000 non-null object
seller                 50000 non-null object
offerType              50000 non-null object
price                  50000 non-null object
abtest                 50000 non-null object
vehicleType            44905 non-null object
yearOfRegistration     50000 non-null int64
gearbox                47320 non-null object
powerPS                50000 non-null int64
model                  47242 non-null object
odometer               50000 non-null object
monthOfRegistration    50000 non-null int64
fuelType               45518 non-null object
brand                  50000 non-null object
notRepairedDamage      40171 non-null object
dateCreated            50000 non-null object
nrOfPictures           50000 non-null int64
postalCode             50000 non-null int64
lastSeen               50000 non-null object
dtypes: int64(5), object(15)
memory usage: 7.6+ MB
In [7]:
autos.head()
Out[7]:
dateCrawled name seller offerType price abtest vehicleType yearOfRegistration gearbox powerPS model odometer monthOfRegistration fuelType brand notRepairedDamage dateCreated nrOfPictures postalCode lastSeen
0 2016-03-26 17:47:46 Peugeot_807_160_NAVTECH_ON_BOARD privat Angebot $5,000 control bus 2004 manuell 158 andere 150,000km 3 lpg peugeot nein 2016-03-26 00:00:00 0 79588 2016-04-06 06:45:54
1 2016-04-04 13:38:56 BMW_740i_4_4_Liter_HAMANN_UMBAU_Mega_Optik privat Angebot $8,500 control limousine 1997 automatik 286 7er 150,000km 6 benzin bmw nein 2016-04-04 00:00:00 0 71034 2016-04-06 14:45:08
2 2016-03-26 18:57:24 Volkswagen_Golf_1.6_United privat Angebot $8,990 test limousine 2009 manuell 102 golf 70,000km 7 benzin volkswagen nein 2016-03-26 00:00:00 0 35394 2016-04-06 20:15:37
3 2016-03-12 16:58:10 Smart_smart_fortwo_coupe_softouch/F1/Klima/Pan... privat Angebot $4,350 control kleinwagen 2007 automatik 71 fortwo 70,000km 6 benzin smart nein 2016-03-12 00:00:00 0 33729 2016-03-15 03:16:28
4 2016-04-01 14:38:50 Ford_Focus_1_6_Benzin_TÜV_neu_ist_sehr_gepfleg... privat Angebot $1,350 test kombi 2003 manuell 0 focus 150,000km 7 benzin ford nein 2016-04-01 00:00:00 0 39218 2016-04-01 14:38:50

The dataset has 50,000 rows of car ad data. Some of the columns are in German instead of English, and will probably have to be cleaned/mapped.

In [12]:
modified_colnames = autos.columns
modified_colnames
Out[12]:
Index(['dateCrawled', 'name', 'seller', 'offerType', 'price', 'abtest',
       'vehicleType', 'yearOfRegistration', 'gearbox', 'powerPS', 'model',
       'odometer', 'monthOfRegistration', 'fuelType', 'brand',
       'notRepairedDamage', 'dateCreated', 'nrOfPictures', 'postalCode',
       'lastSeen'],
      dtype='object')
In [86]:
autos.rename(columns = {'yearOfRegistration': 'registration_year',
                        'monthOfRegistration':'registration_month',
                        "notRepairedDamage":"unrepaired_damage",
                        'dateCreated' : 'ad_created',
                        
                        'dateCrawled': 'date_crawled',  
                        'offerType': 'offer_type', 
                        'abtest': 'ab_test',
                       'vehicleType': 'vehicle_type', 
                        'powerPS': 'power_ps', 
                        'monthOfRegistration': 'month_of_registration', 
                        'fuelType': 'fuel_type',
                       'notRepairedDamage': 'not_repaired_damage', 
                        'nrOfPictures': 'nr_of_pictures',
                        'postalCode': 'postal_code',
                       'lastSeen' : 'last_seen',
                        'odometer':'odometer_km'
                        
                        
                        
                        
                       }, inplace=True)
In [50]:
autos.columns
Out[50]:
Index(['date_crawled', 'name', 'seller', 'offer_type', 'price', 'ab_test',
       'vehicle_type', 'registration_year', 'gearbox', 'power_ps', 'model',
       'odometer_km', 'registration_month', 'fuel_type', 'brand',
       'unrepaired_damage', 'ad_created', 'nr_of_pictures', 'postal_code',
       'last_seen'],
      dtype='object')
In [24]:
autos.head()
Out[24]:
date_crawled name seller offer_type price ab_test vehicle_type registration_year gearbox power_ps model odometer registration_month fuel_type brand unrepaired_damage ad_created nr_of_pictures postal_code last_seen
0 2016-03-26 17:47:46 Peugeot_807_160_NAVTECH_ON_BOARD privat Angebot $5,000 control bus 2004 manuell 158 andere 150,000km 3 lpg peugeot nein 2016-03-26 00:00:00 0 79588 2016-04-06 06:45:54
1 2016-04-04 13:38:56 BMW_740i_4_4_Liter_HAMANN_UMBAU_Mega_Optik privat Angebot $8,500 control limousine 1997 automatik 286 7er 150,000km 6 benzin bmw nein 2016-04-04 00:00:00 0 71034 2016-04-06 14:45:08
2 2016-03-26 18:57:24 Volkswagen_Golf_1.6_United privat Angebot $8,990 test limousine 2009 manuell 102 golf 70,000km 7 benzin volkswagen nein 2016-03-26 00:00:00 0 35394 2016-04-06 20:15:37
3 2016-03-12 16:58:10 Smart_smart_fortwo_coupe_softouch/F1/Klima/Pan... privat Angebot $4,350 control kleinwagen 2007 automatik 71 fortwo 70,000km 6 benzin smart nein 2016-03-12 00:00:00 0 33729 2016-03-15 03:16:28
4 2016-04-01 14:38:50 Ford_Focus_1_6_Benzin_TÜV_neu_ist_sehr_gepfleg... privat Angebot $1,350 test kombi 2003 manuell 0 focus 150,000km 7 benzin ford nein 2016-04-01 00:00:00 0 39218 2016-04-01 14:38:50
In [87]:
autos["price"] = autos["price"].str.replace(',','').str.replace('$','')
autos["price"] = autos["price"].astype(int)

autos["odometer_km"] = autos["odometer_km"].str.replace(',','').str.replace('km','')
autos["odometer_km"] = autos["odometer_km"].astype(int)
In [52]:
autos.describe()
Out[52]:
price registration_year power_ps odometer_km registration_month nr_of_pictures postal_code
count 5.000000e+04 50000.000000 50000.000000 50000.000000 50000.000000 50000.0 50000.000000
mean 9.840044e+03 2005.073280 116.355920 125732.700000 5.723360 0.0 50813.627300
std 4.811044e+05 105.712813 209.216627 40042.211706 3.711984 0.0 25779.747957
min 0.000000e+00 1000.000000 0.000000 5000.000000 0.000000 0.0 1067.000000
25% 1.100000e+03 1999.000000 70.000000 125000.000000 3.000000 0.0 30451.000000
50% 2.950000e+03 2003.000000 105.000000 150000.000000 6.000000 0.0 49577.000000
75% 7.200000e+03 2008.000000 150.000000 150000.000000 9.000000 0.0 71540.000000
max 1.000000e+08 9999.000000 17700.000000 150000.000000 12.000000 0.0 99998.000000
In [57]:
odometer_km = autos["odometer_km"].unique()
autos["odometer_km"].describe()
Out[57]:
count     50000.000000
mean     125732.700000
std       40042.211706
min        5000.000000
25%      125000.000000
50%      150000.000000
75%      150000.000000
max      150000.000000
Name: odometer_km, dtype: float64
In [61]:
autos["odometer_km"].value_counts()
Out[61]:
150000    32424
125000     5170
100000     2169
90000      1757
80000      1436
70000      1230
60000      1164
50000      1027
5000        967
40000       819
30000       789
20000       784
10000       264
Name: odometer_km, dtype: int64
In [67]:
autos["price"].max()
Out[67]:
99999999
In [88]:
autos = autos[autos["price"] <= 1000000]
In [89]:
autos.drop('seller', axis=1)
Out[89]:
date_crawled name offer_type price ab_test vehicle_type registration_year gearbox power_ps model odometer_km month_of_registration fuel_type brand not_repaired_damage ad_created nr_of_pictures postal_code last_seen
0 2016-03-26 17:47:46 Peugeot_807_160_NAVTECH_ON_BOARD Angebot 5000 control bus 2004 manuell 158 andere 150000 3 lpg peugeot nein 2016-03-26 00:00:00 0 79588 2016-04-06 06:45:54
1 2016-04-04 13:38:56 BMW_740i_4_4_Liter_HAMANN_UMBAU_Mega_Optik Angebot 8500 control limousine 1997 automatik 286 7er 150000 6 benzin bmw nein 2016-04-04 00:00:00 0 71034 2016-04-06 14:45:08
2 2016-03-26 18:57:24 Volkswagen_Golf_1.6_United Angebot 8990 test limousine 2009 manuell 102 golf 70000 7 benzin volkswagen nein 2016-03-26 00:00:00 0 35394 2016-04-06 20:15:37
3 2016-03-12 16:58:10 Smart_smart_fortwo_coupe_softouch/F1/Klima/Pan... Angebot 4350 control kleinwagen 2007 automatik 71 fortwo 70000 6 benzin smart nein 2016-03-12 00:00:00 0 33729 2016-03-15 03:16:28
4 2016-04-01 14:38:50 Ford_Focus_1_6_Benzin_TÜV_neu_ist_sehr_gepfleg... Angebot 1350 test kombi 2003 manuell 0 focus 150000 7 benzin ford nein 2016-04-01 00:00:00 0 39218 2016-04-01 14:38:50
5 2016-03-21 13:47:45 Chrysler_Grand_Voyager_2.8_CRD_Aut.Limited_Sto... Angebot 7900 test bus 2006 automatik 150 voyager 150000 4 diesel chrysler NaN 2016-03-21 00:00:00 0 22962 2016-04-06 09:45:21
6 2016-03-20 17:55:21 VW_Golf_III_GT_Special_Electronic_Green_Metall... Angebot 300 test limousine 1995 manuell 90 golf 150000 8 benzin volkswagen NaN 2016-03-20 00:00:00 0 31535 2016-03-23 02:48:59
7 2016-03-16 18:55:19 Golf_IV_1.9_TDI_90PS Angebot 1990 control limousine 1998 manuell 90 golf 150000 12 diesel volkswagen nein 2016-03-16 00:00:00 0 53474 2016-04-07 03:17:32
8 2016-03-22 16:51:34 Seat_Arosa Angebot 250 test NaN 2000 manuell 0 arosa 150000 10 NaN seat nein 2016-03-22 00:00:00 0 7426 2016-03-26 18:18:10
9 2016-03-16 13:47:02 Renault_Megane_Scenic_1.6e_RT_Klimaanlage Angebot 590 control bus 1997 manuell 90 megane 150000 7 benzin renault nein 2016-03-16 00:00:00 0 15749 2016-04-06 10:46:35
10 2016-03-15 01:41:36 VW_Golf_Tuning_in_siber/grau Angebot 999 test NaN 2017 manuell 90 NaN 150000 4 benzin volkswagen nein 2016-03-14 00:00:00 0 86157 2016-04-07 03:16:21
11 2016-03-16 18:45:34 Mercedes_A140_Motorschaden Angebot 350 control NaN 2000 NaN 0 NaN 150000 0 benzin mercedes_benz NaN 2016-03-16 00:00:00 0 17498 2016-03-16 18:45:34
12 2016-03-31 19:48:22 Smart_smart_fortwo_coupe_softouch_pure_MHD_Pan... Angebot 5299 control kleinwagen 2010 automatik 71 fortwo 50000 9 benzin smart nein 2016-03-31 00:00:00 0 34590 2016-04-06 14:17:52
13 2016-03-23 10:48:32 Audi_A3_1.6_tuning Angebot 1350 control limousine 1999 manuell 101 a3 150000 11 benzin audi nein 2016-03-23 00:00:00 0 12043 2016-04-01 14:17:13
14 2016-03-23 11:50:46 Renault_Clio_3__Dynamique_1.2__16_V;_viele_Ver... Angebot 3999 test kleinwagen 2007 manuell 75 clio 150000 9 benzin renault NaN 2016-03-23 00:00:00 0 81737 2016-04-01 15:46:47
15 2016-04-01 12:06:20 Corvette_C3_Coupe_T_Top_Crossfire_Injection Angebot 18900 test coupe 1982 automatik 203 NaN 80000 6 benzin sonstige_autos nein 2016-04-01 00:00:00 0 61276 2016-04-02 21:10:48
16 2016-03-16 14:59:02 Opel_Vectra_B_Kombi Angebot 350 test kombi 1999 manuell 101 vectra 150000 5 benzin opel nein 2016-03-16 00:00:00 0 57299 2016-03-18 05:29:37
17 2016-03-29 11:46:22 Volkswagen_Scirocco_2_G60 Angebot 5500 test coupe 1990 manuell 205 scirocco 150000 6 benzin volkswagen nein 2016-03-29 00:00:00 0 74821 2016-04-05 20:46:26
18 2016-03-26 19:57:44 Verkaufen_mein_bmw_e36_320_i_touring Angebot 300 control bus 1995 manuell 150 3er 150000 0 benzin bmw NaN 2016-03-26 00:00:00 0 54329 2016-04-02 12:16:41
19 2016-03-17 13:36:21 mazda_tribute_2.0_mit_gas_und_tuev_neu_2018 Angebot 4150 control suv 2004 manuell 124 andere 150000 2 lpg mazda nein 2016-03-17 00:00:00 0 40878 2016-03-17 14:45:58
20 2016-03-05 19:57:31 Audi_A4_Avant_1.9_TDI_*6_Gang*AHK*Klimatronik*... Angebot 3500 test kombi 2003 manuell 131 a4 150000 5 diesel audi NaN 2016-03-05 00:00:00 0 53913 2016-03-07 05:46:46
21 2016-03-06 19:07:10 Porsche_911_Carrera_4S_Cabrio Angebot 41500 test cabrio 2004 manuell 320 911 150000 4 benzin porsche nein 2016-03-06 00:00:00 0 65428 2016-04-05 23:46:19
22 2016-03-28 20:50:54 MINI_Cooper_S_Cabrio Angebot 25450 control cabrio 2015 manuell 184 cooper 10000 1 benzin mini nein 2016-03-28 00:00:00 0 44789 2016-04-01 06:45:30
23 2016-03-10 19:55:34 Peugeot_Boxer_2_2_HDi_120_Ps_9_Sitzer_inkl_Klima Angebot 7999 control bus 2010 manuell 120 NaN 150000 2 diesel peugeot nein 2016-03-10 00:00:00 0 30900 2016-03-17 08:45:17
24 2016-04-03 11:57:02 BMW_535i_xDrive_Sport_Aut. Angebot 48500 control limousine 2014 automatik 306 5er 30000 12 benzin bmw nein 2016-04-03 00:00:00 0 22547 2016-04-07 13:16:50
25 2016-03-21 21:56:18 Ford_escort_kombi_an_bastler_mit_ghia_ausstattung Angebot 90 control kombi 1996 manuell 116 NaN 150000 4 benzin ford ja 2016-03-21 00:00:00 0 27574 2016-04-01 05:16:49
26 2016-04-03 22:46:28 Volkswagen_Polo_Fox Angebot 777 control kleinwagen 1992 manuell 54 polo 125000 2 benzin volkswagen nein 2016-04-03 00:00:00 0 38110 2016-04-05 23:46:48
27 2016-03-27 18:45:01 Hat_einer_Ahnung_mit_Ford_Galaxy_HILFE Angebot 0 control NaN 2005 NaN 0 NaN 150000 0 NaN ford NaN 2016-03-27 00:00:00 0 66701 2016-03-27 18:45:01
28 2016-03-19 21:56:19 MINI_Cooper_D Angebot 5250 control kleinwagen 2007 manuell 110 cooper 150000 7 diesel mini ja 2016-03-19 00:00:00 0 15745 2016-04-07 14:58:48
29 2016-04-02 12:45:44 Mercedes_Benz_E_320_T_CDI_Avantgarde_DPF7_Sitz... Angebot 4999 test kombi 2004 automatik 204 e_klasse 150000 10 diesel mercedes_benz nein 2016-04-02 00:00:00 0 47638 2016-04-02 12:45:44
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
49970 2016-03-21 22:47:37 c4_Grand_Picasso_mit_Automatik_Leder_Navi_Temp... Angebot 15800 control bus 2010 automatik 136 c4 60000 4 diesel citroen nein 2016-03-21 00:00:00 0 14947 2016-04-07 04:17:34
49971 2016-03-29 14:54:12 W.Lupo_1.0 Angebot 950 test kleinwagen 2001 manuell 50 lupo 150000 4 benzin volkswagen nein 2016-03-29 00:00:00 0 65197 2016-03-29 20:41:51
49972 2016-03-26 22:25:23 Mercedes_Benz_Vito_115_CDI_Extralang_Aut. Angebot 3300 control bus 2004 automatik 150 vito 150000 10 diesel mercedes_benz ja 2016-03-26 00:00:00 0 65326 2016-03-28 11:28:18
49973 2016-03-27 05:32:39 Mercedes_Benz_SLK_200_Kompressor Angebot 6000 control cabrio 2004 manuell 163 slk 150000 11 benzin mercedes_benz nein 2016-03-27 00:00:00 0 53567 2016-03-27 08:25:24
49974 2016-03-20 10:52:31 Golf_1_Cabrio_Tuev_Neu_viele_Extras_alles_eing... Angebot 0 control cabrio 1983 manuell 70 golf 150000 2 benzin volkswagen nein 2016-03-20 00:00:00 0 8209 2016-03-27 19:48:16
49975 2016-03-27 20:51:39 Honda_Jazz_1.3_DSi_i_VTEC_IMA_CVT_Comfort Angebot 9700 control kleinwagen 2012 automatik 88 jazz 100000 11 hybrid honda nein 2016-03-27 00:00:00 0 84385 2016-04-05 19:45:34
49976 2016-03-19 18:56:05 Audi_80_Avant_2.6_E__Vollausstattung!!_Einziga... Angebot 5900 test kombi 1992 automatik 150 80 150000 12 benzin audi nein 2016-03-19 00:00:00 0 36100 2016-04-07 06:16:44
49977 2016-03-31 18:37:18 Mercedes_Benz_C200_Cdi_W203 Angebot 5500 control limousine 2003 manuell 116 c_klasse 150000 2 diesel mercedes_benz nein 2016-03-31 00:00:00 0 33739 2016-04-06 12:16:11
49978 2016-04-04 10:37:14 Mercedes_Benz_E_200_Classic Angebot 900 control limousine 1996 automatik 136 e_klasse 150000 9 benzin mercedes_benz ja 2016-04-04 00:00:00 0 24405 2016-04-06 12:44:20
49979 2016-03-20 18:38:40 Volkswagen_Polo_1.6_TDI_Style Angebot 11000 test kleinwagen 2011 manuell 90 polo 70000 11 diesel volkswagen nein 2016-03-20 00:00:00 0 48455 2016-04-07 01:45:12
49980 2016-03-12 10:55:54 Ford_Escort_Turnier_16V Angebot 400 control kombi 1995 manuell 105 escort 125000 3 benzin ford NaN 2016-03-12 00:00:00 0 56218 2016-04-06 17:16:49
49981 2016-03-15 09:38:21 Opel_Astra_Kombi_mit_Anhaengerkupplung Angebot 2000 control kombi 1998 manuell 115 astra 150000 12 benzin opel nein 2016-03-15 00:00:00 0 86859 2016-04-05 17:21:46
49982 2016-03-29 18:51:08 Skoda_Fabia_4_Tuerer_Bj:2004__85.000Tkm Angebot 1950 control kleinwagen 2004 manuell 0 fabia 90000 7 benzin skoda NaN 2016-03-29 00:00:00 0 45884 2016-03-29 18:51:08
49983 2016-03-06 12:43:04 Ford_focus_99 Angebot 600 test kleinwagen 1999 manuell 101 focus 150000 4 benzin ford NaN 2016-03-06 00:00:00 0 52477 2016-03-09 06:16:08
49984 2016-03-31 22:48:48 Student_sucht_ein__Anfaengerauto___ab_2000_BJ_... Angebot 0 test NaN 2000 NaN 0 NaN 150000 0 NaN sonstige_autos NaN 2016-03-31 00:00:00 0 12103 2016-04-02 19:44:53
49985 2016-04-02 16:38:23 Verkaufe_meinen_vw_vento! Angebot 1000 control NaN 1995 automatik 0 NaN 150000 0 benzin volkswagen NaN 2016-04-02 00:00:00 0 30900 2016-04-06 15:17:52
49986 2016-04-04 20:46:02 Chrysler_300C_3.0_CRD_DPF_Automatik_Voll_Ausst... Angebot 15900 control limousine 2010 automatik 218 300c 125000 11 diesel chrysler nein 2016-04-04 00:00:00 0 73527 2016-04-06 23:16:00
49987 2016-03-22 20:47:27 Audi_A3_Limousine_2.0_TDI_DPF_Ambition__NAVI__... Angebot 21990 control limousine 2013 manuell 150 a3 50000 11 diesel audi nein 2016-03-22 00:00:00 0 94362 2016-03-26 22:46:06
49988 2016-03-28 19:49:51 BMW_330_Ci Angebot 9550 control coupe 2001 manuell 231 3er 150000 10 benzin bmw nein 2016-03-28 00:00:00 0 83646 2016-04-07 02:17:40
49989 2016-03-11 19:50:37 VW_Polo_zum_Ausschlachten_oder_Wiederaufbau Angebot 150 test kleinwagen 1997 manuell 0 polo 150000 5 benzin volkswagen ja 2016-03-11 00:00:00 0 21244 2016-03-12 10:17:55
49990 2016-03-21 19:54:19 Mercedes_Benz_A_200__BlueEFFICIENCY__Urban Angebot 17500 test limousine 2012 manuell 156 a_klasse 30000 12 benzin mercedes_benz nein 2016-03-21 00:00:00 0 58239 2016-04-06 22:46:57
49991 2016-03-06 15:25:19 Kleinwagen Angebot 500 control NaN 2016 manuell 0 twingo 150000 0 benzin renault NaN 2016-03-06 00:00:00 0 61350 2016-03-06 18:24:19
49992 2016-03-10 19:37:38 Fiat_Grande_Punto_1.4_T_Jet_16V_Sport Angebot 4800 control kleinwagen 2009 manuell 120 andere 125000 9 lpg fiat nein 2016-03-10 00:00:00 0 68642 2016-03-13 01:44:51
49993 2016-03-15 18:47:35 Audi_A3__1_8l__Silber;_schoenes_Fahrzeug Angebot 1650 control kleinwagen 1997 manuell 0 NaN 150000 7 benzin audi NaN 2016-03-15 00:00:00 0 65203 2016-04-06 19:46:53
49994 2016-03-22 17:36:42 Audi_A6__S6__Avant_4.2_quattro_eventuell_Tausc... Angebot 5000 control kombi 2001 automatik 299 a6 150000 1 benzin audi nein 2016-03-22 00:00:00 0 46537 2016-04-06 08:16:39
49995 2016-03-27 14:38:19 Audi_Q5_3.0_TDI_qu._S_tr.__Navi__Panorama__Xenon Angebot 24900 control limousine 2011 automatik 239 q5 100000 1 diesel audi nein 2016-03-27 00:00:00 0 82131 2016-04-01 13:47:40
49996 2016-03-28 10:50:25 Opel_Astra_F_Cabrio_Bertone_Edition___TÜV_neu+... Angebot 1980 control cabrio 1996 manuell 75 astra 150000 5 benzin opel nein 2016-03-28 00:00:00 0 44807 2016-04-02 14:18:02
49997 2016-04-02 14:44:48 Fiat_500_C_1.2_Dualogic_Lounge Angebot 13200 test cabrio 2014 automatik 69 500 5000 11 benzin fiat nein 2016-04-02 00:00:00 0 73430 2016-04-04 11:47:27
49998 2016-03-08 19:25:42 Audi_A3_2.0_TDI_Sportback_Ambition Angebot 22900 control kombi 2013 manuell 150 a3 40000 11 diesel audi nein 2016-03-08 00:00:00 0 35683 2016-04-05 16:45:07
49999 2016-03-14 00:42:12 Opel_Vectra_1.6_16V Angebot 1250 control limousine 1996 manuell 101 vectra 150000 1 benzin opel nein 2016-03-13 00:00:00 0 45897 2016-04-06 21:18:48

49989 rows × 19 columns

In [76]:
autos.value_counts()
AttributeErrorTraceback (most recent call last)
<ipython-input-76-ca00d24329b3> in <module>()
----> 1 autos.value_counts()

/dataquest/system/env/python3/lib/python3.4/site-packages/pandas/core/generic.py in __getattr__(self, name)
   3612             if name in self._info_axis:
   3613                 return self[name]
-> 3614             return object.__getattribute__(self, name)
   3615 
   3616     def __setattr__(self, name, value):

AttributeError: 'DataFrame' object has no attribute 'value_counts'
In [77]:
autos.describe()
Out[77]:
price registration_year power_ps odometer_km registration_month nr_of_pictures postal_code
count 49989.000000 49989.000000 49989.000000 49989.000000 49989.000000 49989.0 49989.000000
mean 5781.194763 2005.074916 116.339855 125737.462242 5.723719 0.0 50813.017144
std 11833.263624 105.724083 209.211849 40037.226230 3.711901 0.0 25778.144060
min 0.000000 1000.000000 0.000000 5000.000000 0.000000 0.0 1067.000000
25% 1100.000000 1999.000000 70.000000 125000.000000 3.000000 0.0 30451.000000
50% 2950.000000 2003.000000 105.000000 150000.000000 6.000000 0.0 49577.000000
75% 7200.000000 2008.000000 150.000000 150000.000000 9.000000 0.0 71522.000000
max 999999.000000 9999.000000 17700.000000 150000.000000 12.000000 0.0 99998.000000
In [79]:
autos["price"].value_counts().sort_index(ascending=False)
Out[79]:
999999       2
999990       1
350000       1
345000       1
299000       1
295000       1
265000       1
259000       1
250000       1
220000       1
198000       1
197000       1
194000       1
190000       1
180000       1
175000       1
169999       1
169000       1
163991       1
163500       1
155000       1
151990       1
145000       1
139997       1
137999       1
135000       1
130000       1
129000       1
128000       1
120000       2
          ... 
66           1
65           5
60           9
59           1
55           2
50          49
49           4
47           1
45           4
40           6
35           1
30           7
29           1
25           5
20           4
18           1
17           3
15           2
14           1
13           2
12           3
11           2
10           7
9            1
8            1
5            2
3            1
2            3
1          156
0         1421
Name: price, Length: 2349, dtype: int64
In [90]:
autos[autos["price"] > 100000]
Out[90]:
date_crawled name seller offer_type price ab_test vehicle_type registration_year gearbox power_ps model odometer_km month_of_registration fuel_type brand not_repaired_damage ad_created nr_of_pictures postal_code last_seen
514 2016-03-17 09:53:08 Ford_Focus_Turnier_1.6_16V_Style privat Angebot 999999 test kombi 2009 manuell 101 focus 125000 4 benzin ford nein 2016-03-17 00:00:00 0 12205 2016-04-06 07:17:35
1878 2016-03-12 16:58:37 Porsche_911_Turbo privat Angebot 129000 control coupe 1995 manuell 408 911 125000 9 benzin porsche nein 2016-03-12 00:00:00 0 70180 2016-04-05 04:49:19
2454 2016-03-21 22:51:29 Porsche_911_GT3 privat Angebot 137999 control coupe 2010 manuell 435 911 20000 7 benzin porsche nein 2016-03-21 00:00:00 0 80636 2016-04-07 05:45:39
2751 2016-03-15 10:52:35 Porsche_911___993_4S privat Angebot 120000 control coupe 1998 manuell 286 911 125000 3 benzin porsche nein 2016-03-15 00:00:00 0 25488 2016-04-05 19:47:31
7402 2016-03-22 19:48:09 Porsche_911_Carrera_4S_Cabrio_PDK__BOSE__NEU__... privat Angebot 115000 test cabrio 2016 automatik 400 911 5000 3 benzin porsche nein 2016-03-22 00:00:00 0 51379 2016-03-26 21:46:46
8232 2016-04-01 21:50:47 Porsche_993_S_Schalter_BRD_neuwertig privat Angebot 128000 test coupe 1997 manuell 286 911 100000 4 benzin porsche nein 2016-04-01 00:00:00 0 81543 2016-04-05 19:46:23
10500 2016-03-17 12:56:38 Porsche_991 privat Angebot 155000 test coupe 2013 NaN 476 911 20000 11 NaN porsche nein 2016-03-17 00:00:00 0 90768 2016-03-26 23:16:41
11433 2016-03-30 21:44:21 Audi_R8_V10_plus_5.2_FSI_quattro_S_tronic_Akra... privat Angebot 175000 test coupe 2016 automatik 610 andere 5000 1 benzin audi nein 2016-03-30 00:00:00 0 94244 2016-04-05 11:46:33
12682 2016-03-28 22:48:01 Porsche_GT3_RS__PCCB__Lift___grosser_Exklusiv_... privat Angebot 265000 control coupe 2016 automatik 500 911 5000 3 benzin porsche nein 2016-03-28 00:00:00 0 70193 2016-04-05 03:44:51
14268 2016-04-01 12:52:27 Porsche_997_GT3_Approved_Lift_Unfallfrei_Mj.2011 privat Angebot 135000 test coupe 2010 manuell 435 911 30000 7 benzin porsche nein 2016-04-01 00:00:00 0 83684 2016-04-07 09:44:21
14715 2016-03-30 08:37:24 Rolls_Royce_Phantom_Drophead_Coupe privat Angebot 345000 control cabrio 2012 automatik 460 NaN 20000 8 benzin sonstige_autos nein 2016-03-30 00:00:00 0 73525 2016-04-07 00:16:26
16964 2016-04-01 16:46:18 Bentley_Continental_Supersports privat Angebot 105000 control coupe 2010 automatik 630 NaN 80000 1 benzin sonstige_autos nein 2016-04-01 00:00:00 0 70192 2016-04-05 11:49:31
17140 2016-03-05 17:39:22 Mercedes_Benz_SLS_AMG_Roadster_AMG_SPEEDSHIFT_DCT privat Angebot 180000 test cabrio 2012 automatik 571 andere 50000 2 benzin mercedes_benz nein 2016-03-05 00:00:00 0 14193 2016-03-20 19:44:36
17540 2016-03-30 00:49:49 Porsche_930_Turbo_classic_analytics_Gutachten_2+ privat Angebot 105000 test coupe 1988 manuell 300 911 150000 6 benzin porsche nein 2016-03-29 00:00:00 0 76829 2016-04-06 21:18:20
18509 2016-03-27 18:43:02 Porsche_991_GT3 privat Angebot 169000 control coupe 2013 automatik 476 911 20000 9 benzin porsche nein 2016-03-27 00:00:00 0 83629 2016-04-05 15:15:29
20351 2016-03-22 17:47:59 BMW_Z8_roadster privat Angebot 190000 control cabrio 2000 manuell 400 z_reihe 60000 9 benzin bmw nein 2016-03-22 00:00:00 0 14473 2016-04-02 11:44:28
21783 2016-03-26 22:06:24 Porsche_911_Carrera_4S_Cabriolet_PDK privat Angebot 115991 test cabrio 2013 automatik 400 911 10000 5 benzin porsche nein 2016-03-26 00:00:00 0 65843 2016-04-07 00:17:34
22060 2016-03-09 00:58:24 Tesla_Model_X90D_Autopilot_Leder_AHK_Kaltwette... privat Angebot 114400 test suv 2016 automatik 0 NaN 5000 3 elektro sonstige_autos nein 2016-03-08 00:00:00 0 33335 2016-03-24 09:46:27
22673 2016-03-05 18:40:13 Porsche_911_991_GT3_LED_Licht_Chrono_Navi_Club... privat Angebot 163991 test coupe 2014 automatik 476 911 10000 6 benzin porsche nein 2016-03-05 00:00:00 0 51702 2016-03-09 16:45:30
28090 2016-03-08 19:50:06 Tesla_Model_X_P90D_Signature_Sondermodel__Neuw... privat Angebot 194000 test suv 2016 automatik 0 NaN 5000 3 elektro sonstige_autos nein 2016-03-08 00:00:00 0 97990 2016-03-16 04:15:31
29286 2016-03-22 15:58:56 Porsche_911_Turbo_PDK__Sport_Chrono_Garantie_D... privat Angebot 104900 control coupe 2011 automatik 500 911 30000 1 benzin porsche nein 2016-03-22 00:00:00 0 42111 2016-04-06 05:45:48
32185 2016-03-25 12:42:09 Porsche_997_GT3_MKII_EIN_SAMMLERSTÜCK_IN_VOLLA... privat Angebot 139997 test coupe 2010 manuell 435 911 20000 3 benzin porsche nein 2016-03-25 00:00:00 0 71159 2016-04-06 13:45:07
32840 2016-03-22 08:55:27 Mercedes_Benz_G_500_7G_TRONIC_Cabrio_Desingno_... privat Angebot 169999 control cabrio 2012 automatik 387 g_klasse 40000 3 benzin mercedes_benz nein 2016-03-22 00:00:00 0 42655 2016-04-05 20:47:17
33638 2016-03-24 12:54:19 Porsche_911_GT3_RS privat Angebot 151990 test coupe 2007 manuell 415 911 20000 10 benzin porsche nein 2016-03-24 00:00:00 0 40479 2016-04-07 03:46:46
33884 2016-03-26 21:55:12 Porsche_911_Carrera_4S_Cabriolet_PDK privat Angebot 116000 control cabrio 2013 automatik 430 911 30000 4 benzin porsche nein 2016-03-26 00:00:00 0 4808 2016-03-26 22:46:40
34723 2016-03-23 16:37:29 Porsche_Porsche_911/930_Turbo_3.0__deutsche_Au... privat Angebot 299000 test coupe 1977 manuell 260 911 100000 7 benzin porsche nein 2016-03-23 00:00:00 0 61462 2016-04-06 16:44:50
35923 2016-04-03 07:56:23 Porsche_911_Targa_Exclusive_Edition__1_von_15_... privat Angebot 295000 test cabrio 2015 automatik 400 911 5000 6 benzin porsche nein 2016-04-03 00:00:00 0 74078 2016-04-03 08:56:20
36818 2016-03-27 18:37:37 Porsche_991 privat Angebot 350000 control coupe 2016 manuell 500 911 5000 3 benzin porsche nein 2016-03-27 00:00:00 0 70499 2016-03-27 18:37:37
37585 2016-03-29 11:38:54 Volkswagen_Jetta_GT privat Angebot 999990 test limousine 1985 manuell 111 jetta 150000 12 benzin volkswagen ja 2016-03-29 00:00:00 0 50997 2016-03-29 11:38:54
37840 2016-03-21 10:50:12 Porsche_997 privat Angebot 220000 test coupe 2008 manuell 415 911 30000 7 benzin porsche nein 2016-03-21 00:00:00 0 69198 2016-04-06 04:46:14
38299 2016-03-28 22:25:25 Glas_BMW_mit_Wasser privat Angebot 250000 test NaN 2015 NaN 0 x_reihe 5000 0 NaN bmw NaN 2016-03-28 00:00:00 0 60489 2016-03-28 22:25:25
38814 2016-03-22 16:53:44 Porsche_Porsche_964_TURBO_S_X33_WLS_ab_Werk_35... privat Angebot 119500 test coupe 1992 manuell 355 911 150000 6 benzin porsche nein 2016-03-22 00:00:00 0 52062 2016-03-24 00:47:12
40918 2016-03-20 18:40:05 Porsche_911_991_GT3_RS privat Angebot 198000 test coupe 2015 automatik 500 911 5000 6 benzin porsche nein 2016-03-20 00:00:00 0 51491 2016-03-21 21:46:36
43049 2016-03-21 19:53:52 2_VW_Busse_T3 privat Angebot 999999 test bus 1981 manuell 70 transporter 150000 1 benzin volkswagen NaN 2016-03-21 00:00:00 0 99880 2016-03-28 17:18:28
43282 2016-04-03 18:42:28 Porsche_911_Carrera_4S_Cabriolet_PDK privat Angebot 119900 control cabrio 2014 automatik 400 911 30000 2 benzin porsche nein 2016-04-03 00:00:00 0 51465 2016-04-05 18:46:32
43668 2016-03-16 18:47:26 Porsche_993/911_Turbo_WLS_II_Exclusive_S_deuts... privat Angebot 197000 control coupe 1998 manuell 450 911 150000 3 NaN porsche nein 2016-03-16 00:00:00 0 46147 2016-04-07 02:44:47
44406 2016-03-15 14:47:26 Mercedes_Benz_170_S_Cabriolet_A__Startklar_fue... privat Angebot 120000 control cabrio 1951 manuell 52 andere 20000 5 benzin mercedes_benz nein 2016-03-15 00:00:00 0 1067 2016-04-06 05:15:50
45387 2016-03-18 16:41:22 Porsche_911_GT3__Clubsp._Lift_nur_bis_25.03._v... privat Angebot 163500 test coupe 2015 automatik 476 911 10000 9 benzin porsche nein 2016-03-18 00:00:00 0 74078 2016-03-18 16:41:22
47337 2016-04-05 10:25:38 BMW_Z8_roadster privat Angebot 259000 test cabrio 2001 manuell 400 z_reihe 20000 6 benzin bmw nein 2016-04-05 00:00:00 0 61462 2016-04-05 12:07:32
49391 2016-03-18 00:55:16 Lamborghini_Gallardo_LP560_4_E_Gear_"Callisto_... privat Angebot 109999 test coupe 2008 automatik 560 NaN 30000 9 benzin sonstige_autos nein 2016-03-17 00:00:00 0 96052 2016-04-05 21:46:24
49668 2016-03-31 13:45:02 Porsche_911__993__Carrera_S_"SONDERMODELL" privat Angebot 145000 control coupe 1998 manuell 286 911 60000 7 benzin porsche nein 2016-03-31 00:00:00 0 63179 2016-04-06 06:16:03
49815 2016-03-08 10:06:22 SUCHE_TIPPS___Ford_Mustang_Shelby_GT_350_500_K... privat Angebot 130000 control coupe 1968 NaN 0 mustang 50000 7 benzin ford NaN 2016-03-08 00:00:00 0 56070 2016-03-23 23:15:17
In [92]:
autos = autos[autos["price"] <= 500000]
In [96]:
autos.describe()
Out[96]:
price registration_year power_ps odometer_km month_of_registration nr_of_pictures postal_code
count 49986.000000 49986.000000 49986.000000 49986.000000 49986.000000 49986.0 49986.000000
mean 5721.525167 2005.075721 116.341196 125736.506222 5.723723 0.0 50812.804225
std 8983.617820 105.727161 209.218012 40038.133399 3.711839 0.0 25777.404967
min 0.000000 1000.000000 0.000000 5000.000000 0.000000 0.0 1067.000000
25% 1100.000000 1999.000000 70.000000 125000.000000 3.000000 0.0 30451.000000
50% 2950.000000 2003.000000 105.000000 150000.000000 6.000000 0.0 49571.000000
75% 7200.000000 2008.000000 150.000000 150000.000000 9.000000 0.0 71522.000000
max 350000.000000 9999.000000 17700.000000 150000.000000 12.000000 0.0 99998.000000
In [95]:
autos["price"].value_counts(ascending = False)
Out[95]:
0         1421
500        781
1500       734
2500       643
1000       639
1200       639
600        531
3500       498
800        498
2000       460
999        434
750        433
900        420
650        419
850        410
700        395
4500       394
300        384
2200       382
950        379
1100       376
1300       371
3000       365
550        356
1800       355
5500       340
350        335
1250       335
1600       327
1999       322
          ... 
2001         1
3760         1
250000       1
27280        1
22299        1
3952         1
40990        1
14199        1
20480        1
299000       1
22499        1
36800        1
44996        1
46911        1
2033         1
1385         1
24290        1
18           1
28700        1
34890        1
3449         1
9773         1
4895         1
1432         1
1545         1
19968        1
3560         1
12349        1
44444        1
8180         1
Name: price, Length: 2347, dtype: int64
In [98]:
len(autos[autos["registration_year"] >= 2020])
Out[98]:
18
In [99]:
autos = autos[autos["registration_year"] <= 2020]
In [100]:
autos.describe()
Out[100]:
price registration_year power_ps odometer_km month_of_registration nr_of_pictures postal_code
count 49968.000000 49968.000000 49968.000000 49968.000000 49968.000000 49968.0 49968.000000
mean 5720.952610 2003.292587 116.364974 125776.196766 5.724824 0.0 50813.547010
std 8982.905875 11.046784 209.242638 39985.868230 3.711288 0.0 25778.887434
min 0.000000 1000.000000 0.000000 5000.000000 0.000000 0.0 1067.000000
25% 1100.000000 1999.000000 70.000000 125000.000000 3.000000 0.0 30451.000000
50% 2950.000000 2003.000000 105.000000 150000.000000 6.000000 0.0 49577.000000
75% 7200.000000 2008.000000 150.000000 150000.000000 9.000000 0.0 71540.000000
max 350000.000000 2019.000000 17700.000000 150000.000000 12.000000 0.0 99998.000000
In [103]:
autos = autos[autos["registration_year"] >= 1900]
In [ ]:
print(autos['date_crawled'].str[:10].value_counts(normalize=True, dropna=False).describe())
In [ ]:
print(autos['date_crawled','ad_created', 'last_seen'].value_counts(normalize=True, dropna=False).describe()) 
In [ ]:
 
In [ ]:
print(autos[['date_crawled','ad_created','last_seen']][0:5])
In [ ]: