diff --git a/student.ipynb b/student.ipynb index d3bb34af..864cd41a 100644 --- a/student.ipynb +++ b/student.ipynb @@ -16,12 +16,464 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "# Your code here - remember to use markdown cells for comments as well!\n", + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def load_data(filepath):\n", + "# read csv file\n", + " data = pd.read_csv(filepath)\n", + " \n", + " \n", + " \n", + " return data" + ] + }, + { + "cell_type": "code", + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ - "# Your code here - remember to use markdown cells for comments as well!" + "df = load_data(\"data/kc_house_data.csv\")" ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + " | id | \n", + "date | \n", + "price | \n", + "bedrooms | \n", + "bathrooms | \n", + "sqft_living | \n", + "sqft_lot | \n", + "floors | \n", + "waterfront | \n", + "view | \n", + "... | \n", + "grade | \n", + "sqft_above | \n", + "sqft_basement | \n", + "yr_built | \n", + "yr_renovated | \n", + "zipcode | \n", + "lat | \n", + "long | \n", + "sqft_living15 | \n", + "sqft_lot15 | \n", + "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", + "7129300520 | \n", + "10/13/2014 | \n", + "221900.0 | \n", + "3 | \n", + "1.00 | \n", + "1180 | \n", + "5650 | \n", + "1.0 | \n", + "NaN | \n", + "NONE | \n", + "... | \n", + "7 Average | \n", + "1180 | \n", + "0.0 | \n", + "1955 | \n", + "0.0 | \n", + "98178 | \n", + "47.5112 | \n", + "-122.257 | \n", + "1340 | \n", + "5650 | \n", + "
1 | \n", + "6414100192 | \n", + "12/9/2014 | \n", + "538000.0 | \n", + "3 | \n", + "2.25 | \n", + "2570 | \n", + "7242 | \n", + "2.0 | \n", + "NO | \n", + "NONE | \n", + "... | \n", + "7 Average | \n", + "2170 | \n", + "400.0 | \n", + "1951 | \n", + "1991.0 | \n", + "98125 | \n", + "47.7210 | \n", + "-122.319 | \n", + "1690 | \n", + "7639 | \n", + "
2 | \n", + "5631500400 | \n", + "2/25/2015 | \n", + "180000.0 | \n", + "2 | \n", + "1.00 | \n", + "770 | \n", + "10000 | \n", + "1.0 | \n", + "NO | \n", + "NONE | \n", + "... | \n", + "6 Low Average | \n", + "770 | \n", + "0.0 | \n", + "1933 | \n", + "NaN | \n", + "98028 | \n", + "47.7379 | \n", + "-122.233 | \n", + "2720 | \n", + "8062 | \n", + "
3 | \n", + "2487200875 | \n", + "12/9/2014 | \n", + "604000.0 | \n", + "4 | \n", + "3.00 | \n", + "1960 | \n", + "5000 | \n", + "1.0 | \n", + "NO | \n", + "NONE | \n", + "... | \n", + "7 Average | \n", + "1050 | \n", + "910.0 | \n", + "1965 | \n", + "0.0 | \n", + "98136 | \n", + "47.5208 | \n", + "-122.393 | \n", + "1360 | \n", + "5000 | \n", + "
4 | \n", + "1954400510 | \n", + "2/18/2015 | \n", + "510000.0 | \n", + "3 | \n", + "2.00 | \n", + "1680 | \n", + "8080 | \n", + "1.0 | \n", + "NO | \n", + "NONE | \n", + "... | \n", + "8 Good | \n", + "1680 | \n", + "0.0 | \n", + "1987 | \n", + "0.0 | \n", + "98074 | \n", + "47.6168 | \n", + "-122.045 | \n", + "1800 | \n", + "7503 | \n", + "
5 rows × 21 columns
\n", + "\n", + " | bedrooms | \n", + "bathrooms | \n", + "sqft_living | \n", + "sqft_lot | \n", + "floors | \n", + "sqft_above | \n", + "sqft_living15 | \n", + "sqft_lot15 | \n", + "
---|---|---|---|---|---|---|---|---|
count | \n", + "21597.000000 | \n", + "21597.000000 | \n", + "21597.000000 | \n", + "2.159700e+04 | \n", + "21597.000000 | \n", + "21597.000000 | \n", + "21597.000000 | \n", + "21597.000000 | \n", + "
mean | \n", + "3.373200 | \n", + "2.115826 | \n", + "2080.321850 | \n", + "1.509941e+04 | \n", + "1.494096 | \n", + "1788.596842 | \n", + "1986.620318 | \n", + "12758.283512 | \n", + "
std | \n", + "0.926299 | \n", + "0.768984 | \n", + "918.106125 | \n", + "4.141264e+04 | \n", + "0.539683 | \n", + "827.759761 | \n", + "685.230472 | \n", + "27274.441950 | \n", + "
min | \n", + "1.000000 | \n", + "0.500000 | \n", + "370.000000 | \n", + "5.200000e+02 | \n", + "1.000000 | \n", + "370.000000 | \n", + "399.000000 | \n", + "651.000000 | \n", + "
25% | \n", + "3.000000 | \n", + "1.750000 | \n", + "1430.000000 | \n", + "5.040000e+03 | \n", + "1.000000 | \n", + "1190.000000 | \n", + "1490.000000 | \n", + "5100.000000 | \n", + "
50% | \n", + "3.000000 | \n", + "2.250000 | \n", + "1910.000000 | \n", + "7.618000e+03 | \n", + "1.500000 | \n", + "1560.000000 | \n", + "1840.000000 | \n", + "7620.000000 | \n", + "
75% | \n", + "4.000000 | \n", + "2.500000 | \n", + "2550.000000 | \n", + "1.068500e+04 | \n", + "2.000000 | \n", + "2210.000000 | \n", + "2360.000000 | \n", + "10083.000000 | \n", + "
max | \n", + "33.000000 | \n", + "8.000000 | \n", + "13540.000000 | \n", + "1.651359e+06 | \n", + "3.500000 | \n", + "9410.000000 | \n", + "6210.000000 | \n", + "871200.000000 | \n", + "