Skip to content

Instantly share code, notes, and snippets.

@gsisko
Created January 29, 2019 02:02
Show Gist options
  • Save gsisko/68373a164af2e56e91d3e36b1baca42d to your computer and use it in GitHub Desktop.
Save gsisko/68373a164af2e56e91d3e36b1baca42d to your computer and use it in GitHub Desktop.
CarData_Analysis.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "CarData_Analysis.ipynb",
"version": "0.3.2",
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/gsisko/68373a164af2e56e91d3e36b1baca42d/untitled1.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"metadata": {
"id": "0LEe3yQPUYlV",
"colab_type": "code",
"outputId": "9f3b85b8-c4d4-4850-f6ad-542d8bd930f5",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 391
}
},
"cell_type": "code",
"source": [
"import pandas as pd\n",
"\n",
"\n",
"cardata = pd.read_csv('data.csv')\n",
"\n",
"cardata.head()\n"
],
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Make</th>\n",
" <th>Model</th>\n",
" <th>Year</th>\n",
" <th>Engine Fuel Type</th>\n",
" <th>Engine HP</th>\n",
" <th>Engine Cylinders</th>\n",
" <th>Transmission Type</th>\n",
" <th>Driven_Wheels</th>\n",
" <th>Number of Doors</th>\n",
" <th>Market Category</th>\n",
" <th>Vehicle Size</th>\n",
" <th>Vehicle Style</th>\n",
" <th>highway MPG</th>\n",
" <th>city mpg</th>\n",
" <th>Popularity</th>\n",
" <th>MSRP</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>BMW</td>\n",
" <td>1 Series M</td>\n",
" <td>2011</td>\n",
" <td>premium unleaded (required)</td>\n",
" <td>335.0</td>\n",
" <td>6.0</td>\n",
" <td>MANUAL</td>\n",
" <td>rear wheel drive</td>\n",
" <td>2.0</td>\n",
" <td>Factory Tuner,Luxury,High-Performance</td>\n",
" <td>Compact</td>\n",
" <td>Coupe</td>\n",
" <td>26</td>\n",
" <td>19</td>\n",
" <td>3916</td>\n",
" <td>46135</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>BMW</td>\n",
" <td>1 Series</td>\n",
" <td>2011</td>\n",
" <td>premium unleaded (required)</td>\n",
" <td>300.0</td>\n",
" <td>6.0</td>\n",
" <td>MANUAL</td>\n",
" <td>rear wheel drive</td>\n",
" <td>2.0</td>\n",
" <td>Luxury,Performance</td>\n",
" <td>Compact</td>\n",
" <td>Convertible</td>\n",
" <td>28</td>\n",
" <td>19</td>\n",
" <td>3916</td>\n",
" <td>40650</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>BMW</td>\n",
" <td>1 Series</td>\n",
" <td>2011</td>\n",
" <td>premium unleaded (required)</td>\n",
" <td>300.0</td>\n",
" <td>6.0</td>\n",
" <td>MANUAL</td>\n",
" <td>rear wheel drive</td>\n",
" <td>2.0</td>\n",
" <td>Luxury,High-Performance</td>\n",
" <td>Compact</td>\n",
" <td>Coupe</td>\n",
" <td>28</td>\n",
" <td>20</td>\n",
" <td>3916</td>\n",
" <td>36350</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>BMW</td>\n",
" <td>1 Series</td>\n",
" <td>2011</td>\n",
" <td>premium unleaded (required)</td>\n",
" <td>230.0</td>\n",
" <td>6.0</td>\n",
" <td>MANUAL</td>\n",
" <td>rear wheel drive</td>\n",
" <td>2.0</td>\n",
" <td>Luxury,Performance</td>\n",
" <td>Compact</td>\n",
" <td>Coupe</td>\n",
" <td>28</td>\n",
" <td>18</td>\n",
" <td>3916</td>\n",
" <td>29450</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>BMW</td>\n",
" <td>1 Series</td>\n",
" <td>2011</td>\n",
" <td>premium unleaded (required)</td>\n",
" <td>230.0</td>\n",
" <td>6.0</td>\n",
" <td>MANUAL</td>\n",
" <td>rear wheel drive</td>\n",
" <td>2.0</td>\n",
" <td>Luxury</td>\n",
" <td>Compact</td>\n",
" <td>Convertible</td>\n",
" <td>28</td>\n",
" <td>18</td>\n",
" <td>3916</td>\n",
" <td>34500</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Make Model Year Engine Fuel Type Engine HP \\\n",
"0 BMW 1 Series M 2011 premium unleaded (required) 335.0 \n",
"1 BMW 1 Series 2011 premium unleaded (required) 300.0 \n",
"2 BMW 1 Series 2011 premium unleaded (required) 300.0 \n",
"3 BMW 1 Series 2011 premium unleaded (required) 230.0 \n",
"4 BMW 1 Series 2011 premium unleaded (required) 230.0 \n",
"\n",
" Engine Cylinders Transmission Type Driven_Wheels Number of Doors \\\n",
"0 6.0 MANUAL rear wheel drive 2.0 \n",
"1 6.0 MANUAL rear wheel drive 2.0 \n",
"2 6.0 MANUAL rear wheel drive 2.0 \n",
"3 6.0 MANUAL rear wheel drive 2.0 \n",
"4 6.0 MANUAL rear wheel drive 2.0 \n",
"\n",
" Market Category Vehicle Size Vehicle Style \\\n",
"0 Factory Tuner,Luxury,High-Performance Compact Coupe \n",
"1 Luxury,Performance Compact Convertible \n",
"2 Luxury,High-Performance Compact Coupe \n",
"3 Luxury,Performance Compact Coupe \n",
"4 Luxury Compact Convertible \n",
"\n",
" highway MPG city mpg Popularity MSRP \n",
"0 26 19 3916 46135 \n",
"1 28 19 3916 40650 \n",
"2 28 20 3916 36350 \n",
"3 28 18 3916 29450 \n",
"4 28 18 3916 34500 "
]
},
"metadata": {
"tags": []
},
"execution_count": 1
}
]
},
{
"metadata": {
"id": "y22UGO6HV_wA",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment