{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
LocationYearFuel_TypeTransmissionOwner_TypePowerModelManufacturer
0Delhi2014CNGManualFirst58.200AltoMaruti
1Coimbatore2013PetrolManualSecond47.300AltoMaruti
2Mumbai2017DieselManualFirst147.800InnovaToyota
3Hyderabad2012DieselManualFirst81.232EtiosToyota
4Mumbai2014PetrolManualFirst82.850i20Hyundai
...........................
1223Hyderabad2011DieselManualFirst103.600VentoVolkswagen
1224Mumbai2015PetrolAutomaticFirst103.600PoloVolkswagen
1225Kolkata2012DieselManualFirst63.100MicraNissan
1226Pune2013PetrolAutomaticThird103.600PoloVolkswagen
1227Kochi2014DieselAutomaticFirst170.000E-ClassMercedes-Benz
\n", "

1228 rows × 8 columns

\n", "
" ], "text/plain": [ " Location Year Fuel_Type Transmission Owner_Type Power Model \n", "0 Delhi 2014 CNG Manual First 58.200 Alto \\\n", "1 Coimbatore 2013 Petrol Manual Second 47.300 Alto \n", "2 Mumbai 2017 Diesel Manual First 147.800 Innova \n", "3 Hyderabad 2012 Diesel Manual First 81.232 Etios \n", "4 Mumbai 2014 Petrol Manual First 82.850 i20 \n", "... ... ... ... ... ... ... ... \n", "1223 Hyderabad 2011 Diesel Manual First 103.600 Vento \n", "1224 Mumbai 2015 Petrol Automatic First 103.600 Polo \n", "1225 Kolkata 2012 Diesel Manual First 63.100 Micra \n", "1226 Pune 2013 Petrol Automatic Third 103.600 Polo \n", "1227 Kochi 2014 Diesel Automatic First 170.000 E-Class \n", "\n", " Manufacturer \n", "0 Maruti \n", "1 Maruti \n", "2 Toyota \n", "3 Toyota \n", "4 Hyundai \n", "... ... \n", "1223 Volkswagen \n", "1224 Volkswagen \n", "1225 Nissan \n", "1226 Volkswagen \n", "1227 Mercedes-Benz \n", "\n", "[1228 rows x 8 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df= pd.read_csv('for_deployment.csv')\n", "df.drop(columns='Unnamed: 0',inplace=True)\n", "df" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 1228 entries, 0 to 1227\n", "Data columns (total 8 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Location 1228 non-null object \n", " 1 Year 1228 non-null object \n", " 2 Fuel_Type 1228 non-null object \n", " 3 Transmission 1228 non-null object \n", " 4 Owner_Type 1228 non-null object \n", " 5 Power 1228 non-null float64\n", " 6 Model 1228 non-null object \n", " 7 Manufacturer 1228 non-null object \n", "dtypes: float64(1), object(7)\n", "memory usage: 76.9+ KB\n" ] } ], "source": [ "df.info()" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['2014', '2013', '2017', '2012', '2016', '2015', '2011', '2007',\n", " '2008', '2009', '2019', '2010', '2005', '2006', '2018', '2003',\n", " '2004', 'less than 2003'], dtype=object)" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['Year'].unique()" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Power
count1228.000000
mean110.047419
std51.350809
min34.200000
25%75.000000
50%91.100000
75%126.320000
max616.000000
\n", "
" ], "text/plain": [ " Power\n", "count 1228.000000\n", "mean 110.047419\n", "std 51.350809\n", "min 34.200000\n", "25% 75.000000\n", "50% 91.100000\n", "75% 126.320000\n", "max 616.000000" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.describe()" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['Delhi',\n", " 'Coimbatore',\n", " 'Mumbai',\n", " 'Hyderabad',\n", " 'Pune',\n", " 'Jaipur',\n", " 'Chennai',\n", " 'Kochi',\n", " 'Bangalore',\n", " 'Kolkata',\n", " 'Ahmedabad']" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "location = df['Location'].unique()\n", "location = location.tolist()\n", "location" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['CNG', 'Petrol', 'Diesel', 'LPG'], dtype=object)" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['Fuel_Type'].unique()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['Manual', 'Automatic'], dtype=object)" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['Transmission'].unique()" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['First', 'Second', 'Third'], dtype=object)" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['Owner_Type'].unique()" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['Alto', 'Innova', 'Etios', 'i20', 'XUV500', 'Fortuner', 'EON',\n", " 'City', 'Q5', 'Grand', 'Corolla', 'Swift', 'Terrano', 'X1', '3',\n", " 'Ikon', 'Ritz', 'Micra', 'Laura', 'Civic', 'Jazz', 'Rapid', 'Polo',\n", " 'i10', 'Pajero', 'Creta', '5', 'Baleno', 'A4', 'Ertiga', 'Ciaz',\n", " 'A', 'Ecosport', 'Endeavour', 'Verna', 'Vitara', 'Indigo',\n", " 'Celerio', 'Sail', 'Scorpio', 'Ameo', 'Wagon', 'Brio', 'Santro',\n", " 'Figo', 'Tiago', 'Beat', 'Xcent', 'Camry', 'Vento', 'Teana',\n", " 'Manza', 'Fiesta', 'B', 'Accord', 'Zen', 'Elantra', 'Indica',\n", " 'Nano', 'Amaze', 'Q3', 'New', 'BRV', 'X3', 'GL-Class', 'GO',\n", " 'Ignis', 'A-Star', 'XE', 'EcoSport', 'KUV', 'Avventura', 'CR-V',\n", " 'Accent', 'XF', 'E-Class', 'M-Class', 'Xylo', 'Mobilio', 'S',\n", " 'Passat', 'Sunny', 'A8', '7', 'Duster', 'Dzire', 'A6', 'Linea',\n", " 'Sumo', 'Grande', 'Cooper', 'Thar', 'Xenon', 'Aveo', 'Tavera',\n", " 'Superb', '800', 'BR-V', 'Verito', 'Q7', 'Eeco', 'Bolero', 'Jetta',\n", " 'Elite', 'Flying', 'Tigor', 'Rover', 'XC90', 'X6', 'Land',\n", " 'Tucson', 'Omni', 'Spark', 'Cruze', 'GLC', 'SX4', 'KWID', 'Getz',\n", " 'Optra', 'Enjoy', 'TUV', 'Compass', 'GLE', 'CLA', 'S60', 'Captur',\n", " 'A3', 'Pulse', 'Punto', 'XC60', 'WRV', 'CrossPolo', 'Cayenne',\n", " 'Octavia', 'Quanto', 'S80', '370Z', '6', 'Sonata', 'Classic',\n", " 'Koleos', 'V40', 'GLA', 'Qualis', 'Freestyle', 'Abarth', 'Versa',\n", " 'redi-GO', 'SLC', 'Lodgy', '1.4Gsi', 'Zest', 'Ssangyong', 'Esteem',\n", " 'Clubman', 'X5', 'Captiva', 'Renault'], dtype=object)" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['Model'].unique()" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['Maruti', 'Toyota', 'Hyundai', 'Mahindra', 'Honda', 'Audi',\n", " 'Nissan', 'BMW', 'Ford', 'Skoda', 'Volkswagen', 'Mitsubishi',\n", " 'Mercedes-Benz', 'Tata', 'Chevrolet', 'Datsun', 'Jaguar', 'Fiat',\n", " 'Renault', 'Mini', 'Bentley', 'Land', 'Volvo', 'Jeep', 'Porsche',\n", " 'OpelCorsa'], dtype=object)" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['Manufacturer'].unique()" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "for col in df.columns:\n", " col = df[col].unique()\n", " col = col.tolist()\n", " col" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['Maruti',\n", " 'Toyota',\n", " 'Hyundai',\n", " 'Mahindra',\n", " 'Honda',\n", " 'Audi',\n", " 'Nissan',\n", " 'BMW',\n", " 'Ford',\n", " 'Skoda',\n", " 'Volkswagen',\n", " 'Mitsubishi',\n", " 'Mercedes-Benz',\n", " 'Tata',\n", " 'Chevrolet',\n", " 'Datsun',\n", " 'Jaguar',\n", " 'Fiat',\n", " 'Renault',\n", " 'Mini',\n", " 'Bentley',\n", " 'Land',\n", " 'Volvo',\n", " 'Jeep',\n", " 'Porsche',\n", " 'OpelCorsa']" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "col" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "phase1", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.3" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }