{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Data Manipulation Part 1 - Groupby Operations\n", "\n", "Chapter 9 in Python for Data Analysis demonstrates a variety of methods to analyze data via data aggregation and grouping operations. Those are the focus of this session. Our overall goal for this session is to do Exploratory Data Analysis, which is essentially looking at and probing our data to learn about the patterns we can discover in them. Often this can generate a better understanding of problems in the data, as well as revealing relationships that might be worth exploring in more depth.\n", "\n", "We will use Census Summary File 1 data for much of this session to illustrate concepts using real data." ] }, { "cell_type": "raw", "metadata": {}, "source": [ "P1. POPULATION [1]\n", "Total: P0010001\n", "\n", "P3. RACE [8]\n", "Universe: Total population\n", "Total: P0030001\n", "White alone P0030002\n", "Black or African American alone P0030003\n", "American Indian and Alaska Native alone P0030004\n", "Asian alone P0030005\n", "Native Hawaiian and Other Pacific Islander alone P0030006\n", "Some Other Race alone P0030007\n", "Two or More Races P0030008\n", "\n", "P4. HISPANIC OR LATINO ORIGIN [3]\n", "Universe: Total population\n", "Total: P0040001\n", "Not Hispanic or Latino P0040002\n", "Hispanic or Latino P0040003\n", "\n", "H1. HOUSING UNITS [1]\n", "Universe: Housing units\n", "Total H00010001\n", "\n", "H3. OCCUPANCY STATUS [3]\n", "Universe: Housing units\n", "Total: H0030001\n", "Occupied H0030002\n", "Vacant H0030003\n", "\n", "H4. TENURE [4]\n", "Universe: Occupied housing units\n", "Total: H0040001\n", "Owned with a mortgage or a loan H0040002\n", "Owned free and clear H0040003\n", "Renter-occupied H0040004\n", "\n", "H5. VACANCY STATUS [8]\n", "Universe: Vacant housing units\n", "Total: H0050001\n", "For rent H0050002\n", "Rented, not occupied H0050003\n", "For sale only H0050004\n", "Sold, not occupied H0050005\n", "For seasonal, recreational, or occasional use H0050006\n", "For migrant workers H0050007\n", "Other vacant H0050008\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Below we load a table I created previously with an extract of data from the 2010 Census, Summary File 1, for the Bay Area. The file is being loaded from an HDF5 datastore - this and other file formats are covered in Chapter 6." ] }, { "cell_type": "code", "execution_count": 1, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
logrecnoblockfipsstatecountytractblkgrpblockarealandP0010001P0020001...H0050006H0050007H0050008pct_rentpct_blackpct_asianpct_whitepct_hisppct_vacantpop_sqmi
126060014271001001060014271001100179696113113...00080.00000013.2743365.30973578.7610621.7699120.0000003672.312839
3280600142710010030600142710011003195462929...00270.00000013.79310327.58620737.93103424.13793123.0769233842.712166
4290600142710010040600142710011004143642626...00075.0000000.00000038.46153834.6153850.0000000.0000004688.087441
6310600142710010060600142710011006128122...000100.0000000.00000050.0000000.000000100.0000000.0000004043.697112
7320600142710010070600142710011007190203030...00033.3333330.00000043.33333350.0000000.00000010.0000004085.154574
\n", "

5 rows × 49 columns

\n", "
" ], "text/plain": [ " logrecno blockfips state county tract blkgrp block arealand \\\n", "1 26 060014271001001 06 001 427100 1 1001 79696 \n", "3 28 060014271001003 06 001 427100 1 1003 19546 \n", "4 29 060014271001004 06 001 427100 1 1004 14364 \n", "6 31 060014271001006 06 001 427100 1 1006 1281 \n", "7 32 060014271001007 06 001 427100 1 1007 19020 \n", "\n", " P0010001 P0020001 ... H0050006 H0050007 H0050008 pct_rent \\\n", "1 113 113 ... 0 0 0 80.000000 \n", "3 29 29 ... 0 0 2 70.000000 \n", "4 26 26 ... 0 0 0 75.000000 \n", "6 2 2 ... 0 0 0 100.000000 \n", "7 30 30 ... 0 0 0 33.333333 \n", "\n", " pct_black pct_asian pct_white pct_hisp pct_vacant pop_sqmi \n", "1 13.274336 5.309735 78.761062 1.769912 0.000000 3672.312839 \n", "3 13.793103 27.586207 37.931034 24.137931 23.076923 3842.712166 \n", "4 0.000000 38.461538 34.615385 0.000000 0.000000 4688.087441 \n", "6 0.000000 50.000000 0.000000 100.000000 0.000000 4043.697112 \n", "7 0.000000 43.333333 50.000000 0.000000 10.000000 4085.154574 \n", "\n", "[5 rows x 49 columns]" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "\n", "sf1store = pd.HDFStore('data/bay_sf1_small.h5')\n", "sf1 = sf1store['sf1_extract']\n", "sf1['pct_rent'] = sf1['H0040004'] / sf1['H0040001'] * 100\n", "sf1['pct_black'] = sf1['P0030003'] / sf1['P0030001'] * 100\n", "sf1['pct_asian'] = sf1['P0030005'] / sf1['P0030001'] * 100\n", "sf1['pct_white'] = sf1['P0030002'] / sf1['P0030001'] * 100\n", "sf1['pct_hisp'] = sf1['P0040003'] / sf1['P0040001'] * 100\n", "sf1['pct_vacant'] = sf1['H0050001'] / sf1['H00010001'] * 100\n", "sf1['pop_sqmi'] = (sf1['P0010001'] / (sf1['arealand'] / 2589988))\n", "sf1 = sf1[sf1['P0030001']>0]\n", "sf1[:5]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Groupby and Aggregation Operations\n", "\n", "Groupby is a powerful method in pandas that follows the split-apply-combine approach to data. As shown in Figure 9-1 in the context of a sum operation, the data is first split into groups that share the same key values. Then an operation, in this case a sum, is applied to each group. Then the results are combined.\n", "\n", "The built-in aggregation methods available for groupby operations include:\n", "* count\n", "* sum\n", "* mean\n", "* median\n", "* std, var\n", "* min, max\n", "* first, last\n", "\n", "You can also apply your own functions as aggregation methods.\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's apply this approach to computing total population in each county in our dataset. We can do this in two steps to help explain what is happening. First we create a groupby object, using county codes to group all the census blocks in sf1 into groups that share the same county code." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grouped = sf1['P0010001'].groupby(sf1['county'])\n", "grouped" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now that we have this grouping object that represents the **split** part of the workflow in the figure above, we can **apply** operations and **combine** the results using methods like sum:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "county\n", "001 1510271\n", "013 1049025\n", "041 252409\n", "055 136484\n", "075 805235\n", "081 718451\n", "085 1781642\n", "095 413344\n", "097 483878\n", "Name: P0010001, dtype: int64" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grouped.sum()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Doing this in two steps like above is really just to clarify the two parts of the split and apply process that happen within a groupy operation. Normally we would not bother separately creating a groupby object -- we would just do this in one line:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "county\n", "001 1510271\n", "013 1049025\n", "041 252409\n", "055 136484\n", "075 805235\n", "081 718451\n", "085 1781642\n", "095 413344\n", "097 483878\n", "Name: P0010001, dtype: int64" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf1['P0010001'].groupby(sf1['county']).sum()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's add county names to the dataframe so we get more readable output, and rerun this aggregation." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "county_names = {'001': 'Alameda', '013': 'Contra Costa', '041': 'Marin', '055': 'Napa', '075': 'San Francisco',\n", " '081': 'San Mateo', '085': 'Santa Clara', '095': 'Solano', '097': 'Sonoma'}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's add county_name as a column in the dataframe. It would be easy to append it as the last column with a merge, but let's see how to insert it in a specified location so that it is easier to read when we browse the data. We can insert it as the 4th column, between county and tract, like so:" ] }, { "cell_type": "code", "execution_count": 6, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
logrecnoblockfipsstatecountycounty_nametractblkgrpblockarealandP0010001...H0050006H0050007H0050008pct_rentpct_blackpct_asianpct_whitepct_hisppct_vacantpop_sqmi
12606001427100100106001Alameda4271001100179696113...00080.00000013.2743365.30973578.7610621.7699120.0000003672.312839
32806001427100100306001Alameda427100110031954629...00270.00000013.79310327.58620737.93103424.13793123.0769233842.712166
42906001427100100406001Alameda427100110041436426...00075.0000000.00000038.46153834.6153850.0000000.0000004688.087441
63106001427100100606001Alameda4271001100612812...000100.0000000.00000050.0000000.000000100.0000000.0000004043.697112
73206001427100100706001Alameda427100110071902030...00033.3333330.00000043.33333350.0000000.00000010.0000004085.154574
\n", "

5 rows × 50 columns

\n", "
" ], "text/plain": [ " logrecno blockfips state county county_name tract blkgrp block \\\n", "1 26 060014271001001 06 001 Alameda 427100 1 1001 \n", "3 28 060014271001003 06 001 Alameda 427100 1 1003 \n", "4 29 060014271001004 06 001 Alameda 427100 1 1004 \n", "6 31 060014271001006 06 001 Alameda 427100 1 1006 \n", "7 32 060014271001007 06 001 Alameda 427100 1 1007 \n", "\n", " arealand P0010001 ... H0050006 H0050007 H0050008 pct_rent \\\n", "1 79696 113 ... 0 0 0 80.000000 \n", "3 19546 29 ... 0 0 2 70.000000 \n", "4 14364 26 ... 0 0 0 75.000000 \n", "6 1281 2 ... 0 0 0 100.000000 \n", "7 19020 30 ... 0 0 0 33.333333 \n", "\n", " pct_black pct_asian pct_white pct_hisp pct_vacant pop_sqmi \n", "1 13.274336 5.309735 78.761062 1.769912 0.000000 3672.312839 \n", "3 13.793103 27.586207 37.931034 24.137931 23.076923 3842.712166 \n", "4 0.000000 38.461538 34.615385 0.000000 0.000000 4688.087441 \n", "6 0.000000 50.000000 0.000000 100.000000 0.000000 4043.697112 \n", "7 0.000000 43.333333 50.000000 0.000000 10.000000 4085.154574 \n", "\n", "[5 rows x 50 columns]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf1.insert(4, 'county_name', sf1['county'].replace(county_names))\n", "sf1[:5]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can print the results of summing population by county_name:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total Population by County:\n", "county_name\n", "Alameda 1510271\n", "Contra Costa 1049025\n", "Marin 252409\n", "Napa 136484\n", "San Francisco 805235\n", "San Mateo 718451\n", "Santa Clara 1781642\n", "Solano 413344\n", "Sonoma 483878\n", "Name: P0010001, dtype: int64\n" ] } ], "source": [ "print('Total Population by County:')\n", "print(sf1['P0010001'].groupby(sf1['county_name']).sum())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We might want to capture the result in a DataFrame if we want to use it in other processing, like merging the results to the original DataFrame." ] }, { "cell_type": "code", "execution_count": 8, "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", "
county_nametotal_population
0Alameda1510271
1Contra Costa1049025
2Marin252409
3Napa136484
4San Francisco805235
5San Mateo718451
6Santa Clara1781642
7Solano413344
8Sonoma483878
\n", "
" ], "text/plain": [ " county_name total_population\n", "0 Alameda 1510271\n", "1 Contra Costa 1049025\n", "2 Marin 252409\n", "3 Napa 136484\n", "4 San Francisco 805235\n", "5 San Mateo 718451\n", "6 Santa Clara 1781642\n", "7 Solano 413344\n", "8 Sonoma 483878" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "county_pop = sf1['P0010001'].groupby(sf1['county_name']).sum().to_frame(name='total_population').reset_index()\n", "county_pop" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we merge the county total population with sf1 and create a new DataFrame." ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "(5, 52)" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf2 = pd.merge(sf1,county_pop, left_index=True, right_index=True)\n", "sf2.shape" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's say we wanted to compute the population per square mile by county using the groupby method. We could go ahead and create another dataframe with total area by county than then do the division of total population by total area." ] }, { "cell_type": "code", "execution_count": 10, "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", "
county_nametotal_area
0Alameda1190434861
1Contra Costa1095085515
2Marin1046029032
3Napa1556005658
4San Francisco95535946
5San Mateo884654868
6Santa Clara2378681334
7Solano1224964331
8Sonoma3206326062
\n", "
" ], "text/plain": [ " county_name total_area\n", "0 Alameda 1190434861\n", "1 Contra Costa 1095085515\n", "2 Marin 1046029032\n", "3 Napa 1556005658\n", "4 San Francisco 95535946\n", "5 San Mateo 884654868\n", "6 Santa Clara 2378681334\n", "7 Solano 1224964331\n", "8 Sonoma 3206326062" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "county_land = sf1['arealand'].groupby(sf1['county_name']).sum().to_frame(name='total_area').reset_index()\n", "county_land" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 3285.844577\n", "1 2481.050329\n", "2 624.969565\n", "3 227.179082\n", "4 21829.993454\n", "5 2103.396042\n", "6 1939.911635\n", "7 873.948750\n", "8 390.864261\n", "dtype: float64" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "county_pop_per_sqmi = county_pop['total_population'] / county_land['total_area'] * 2589988.11\n", "county_pop_per_sqmi" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Or of course we could have done this whole thing in one line:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "county_name\n", "Alameda 3285.844577\n", "Contra Costa 2481.050329\n", "Marin 624.969565\n", "Napa 227.179082\n", "San Francisco 21829.993454\n", "San Mateo 2103.396042\n", "Santa Clara 1939.911635\n", "Solano 873.948750\n", "Sonoma 390.864261\n", "dtype: float64" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf1['P0010001'].groupby(sf1['county_name']).sum() / sf1['arealand'].groupby(sf1['county_name']).sum() * 2589988.11" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Your turn to practice:\n", "\n", "Count the number of census blocks per county.\n", "\n", "Calculate total households per county.\n", "\n", "Calculate percent renters by county. (Careful not to calculate the mean percent rental across blocks in a county)\n", "\n", "Calculate percent vacant by county.\n", "\n", "Calculate mean, min and max pop_sqmi (at the block level) by county.\n", "\n", "Calculate the 90th percentile of pop_sqmi (at the block level) by county." ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of census blocks per county:\n" ] }, { "data": { "text/plain": [ "county_name\n", "Alameda 14082\n", "Contra Costa 11351\n", "Marin 2857\n", "Napa 1819\n", "San Francisco 5137\n", "San Mateo 6876\n", "Santa Clara 14947\n", "Solano 5188\n", "Sonoma 6540\n", "Name: block, dtype: int64" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('Number of census blocks per county:')\n", "sf1['block'].groupby(sf1['county_name']).count()" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total households per county\n" ] }, { "data": { "text/plain": [ "county_name\n", "Alameda 545138\n", "Contra Costa 375364\n", "Marin 103210\n", "Napa 48876\n", "San Francisco 345811\n", "San Mateo 257837\n", "Santa Clara 604204\n", "Solano 141758\n", "Sonoma 185825\n", "Name: H0030002, dtype: int64" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('Total households per county')\n", "sf1['H0030002'].groupby(sf1['county_name']).sum()" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "percent renters by county\n" ] }, { "data": { "text/plain": [ "county_name\n", "Alameda 46.6\n", "Contra Costa 32.9\n", "Marin 37.4\n", "Napa 37.4\n", "San Francisco 64.2\n", "San Mateo 40.6\n", "Santa Clara 42.4\n", "Solano 36.8\n", "Sonoma 39.6\n", "dtype: float64" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('percent renters by county') \n", "round(sf1['H0040004'].groupby(sf1['county_name']).sum() / sf1['H0040001'].groupby(sf1['county_name']).sum() * 100, 1)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Percent vacant by county\n" ] }, { "data": { "text/plain": [ "county_name\n", "Alameda 6.3\n", "Contra Costa 6.2\n", "Marin 7.1\n", "Napa 10.6\n", "San Francisco 8.1\n", "San Mateo 4.9\n", "Santa Clara 4.4\n", "Solano 7.0\n", "Sonoma 9.0\n", "dtype: float64" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('Percent vacant by county')\n", "round(sf1['H0030003'].groupby(sf1['county_name']).sum() / sf1['H0030001'].groupby(sf1['county_name']).sum() * 100, 1)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Min, Max and Mean Population per SQMI by Census Block\n" ] }, { "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", "
minmaxmean
county_name
Alameda0.2237263.172735e+0613753.632628
Contra Costa0.2666953.647259e+058081.846587
Marin0.2914994.192076e+056338.936421
Napa0.2466612.929851e+056245.985286
San Francisco4.5797135.604169e+0528395.094743
San Mateo0.4746232.736351e+0511011.638956
Santa Clara0.2404089.106351e+0510598.597995
Solano0.1959762.886576e+057203.793344
Sonoma0.2386581.685384e+055415.877218
\n", "
" ], "text/plain": [ " min max mean\n", "county_name \n", "Alameda 0.223726 3.172735e+06 13753.632628\n", "Contra Costa 0.266695 3.647259e+05 8081.846587\n", "Marin 0.291499 4.192076e+05 6338.936421\n", "Napa 0.246661 2.929851e+05 6245.985286\n", "San Francisco 4.579713 5.604169e+05 28395.094743\n", "San Mateo 0.474623 2.736351e+05 11011.638956\n", "Santa Clara 0.240408 9.106351e+05 10598.597995\n", "Solano 0.195976 2.886576e+05 7203.793344\n", "Sonoma 0.238658 1.685384e+05 5415.877218" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('Min, Max and Mean Population per SQMI by Census Block')\n", "(sf1['P0010001']/sf1['arealand']* 2589988.11).groupby(sf1['county_name']).agg(['min','max','mean'])" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "90th Percentile of Population per SQMI at block level by County\n" ] }, { "data": { "text/plain": [ "county_name\n", "Alameda 23400.814119\n", "Contra Costa 15173.977895\n", "Marin 11928.112422\n", "Napa 12409.618639\n", "San Francisco 49067.265129\n", "San Mateo 22779.855003\n", "Santa Clara 20424.779379\n", "Solano 12934.963266\n", "Sonoma 12283.580392\n", "dtype: float64" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('90th Percentile of Population per SQMI at block level by County')\n", "(sf1['P0010001']/sf1['arealand']* 2589988.11).groupby(sf1['county_name']).quantile(.9)" ] }, { "cell_type": "code", "execution_count": 19, "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", "
blockpop_sqmitotal_hh
countminmaxmeansum
county_name
Alameda140820.2237263.172735e+0613753.632044545138
Contra Costa113510.2666953.647259e+058081.846244375364
Marin28570.2914994.192076e+056338.936151103210
Napa18190.2466612.929851e+056245.98502148876
San Francisco51374.5797135.604168e+0528395.093537345811
San Mateo68760.4746232.736351e+0511011.638488257837
Santa Clara149470.2404089.106351e+0510598.597545604204
Solano51880.1959762.886576e+057203.793038141758
Sonoma65400.2386581.685384e+055415.876988185825
\n", "
" ], "text/plain": [ " block pop_sqmi total_hh\n", " count min max mean sum\n", "county_name \n", "Alameda 14082 0.223726 3.172735e+06 13753.632044 545138\n", "Contra Costa 11351 0.266695 3.647259e+05 8081.846244 375364\n", "Marin 2857 0.291499 4.192076e+05 6338.936151 103210\n", "Napa 1819 0.246661 2.929851e+05 6245.985021 48876\n", "San Francisco 5137 4.579713 5.604168e+05 28395.093537 345811\n", "San Mateo 6876 0.474623 2.736351e+05 11011.638488 257837\n", "Santa Clara 14947 0.240408 9.106351e+05 10598.597545 604204\n", "Solano 5188 0.195976 2.886576e+05 7203.793038 141758\n", "Sonoma 6540 0.238658 1.685384e+05 5415.876988 185825" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Here is a compact way to capture several of these results in one table\n", "sf1['total_hh']=sf1['H0030002']\n", "sf1.groupby(['county_name']).agg({'block': 'count',\n", " 'total_hh' : 'sum',\n", " 'pop_sqmi': ['min','max','mean']})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Transforming Data with Groupby\n", "\n", "In some cases you may want to apply a function to your data, by group. An example would be to normalize a column by a mean of each group. Say we wanted to subtract the mean population density of each county from the population density of each census block. We could write a function to subtract the mean from each value, and then use the transform operation to apply this to each group:" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def demean(arr):\n", " return arr - arr.mean()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can apply this tranformation to columns in our dataframe. As examples, let's 'demean' the pop_sqmi and pct_rent columns, subtracting the county-wide mean of these values from the block-specific values, so that the result is transformed to have a mean of zero within each county.\n", "\n", "To check the results, we print the means per county, then the original values for the first 5 rows, then the transformed results. The transformed results we should be able to calculate by subtracting the appropriate county mean from the block value." ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " pop_sqmi pct_rent\n", "county_name \n", "Alameda 13753.632044 37.484398\n", "Contra Costa 8081.846244 27.223329\n", "Marin 6338.936151 33.169454\n", "Napa 6245.985021 32.903209\n", "San Francisco 28395.093537 51.927943\n", "San Mateo 11011.638488 30.274104\n", "Santa Clara 10598.597545 29.811290\n", "Solano 7203.793038 34.598761\n", "Sonoma 5415.876988 35.121698\n" ] } ], "source": [ "normalized = sf1[['pop_sqmi', 'pct_rent']].groupby(sf1['county_name']).transform(demean)\n", "print(sf1[['pop_sqmi', 'pct_rent']].groupby(sf1['county_name']).mean())\n" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " county_name pop_sqmi pct_rent\n", "1 Alameda 3672.312839 80.000000\n", "3 Alameda 3842.712166 70.000000\n", "4 Alameda 4688.087441 75.000000\n", "6 Alameda 4043.697112 100.000000\n", "7 Alameda 4085.154574 33.333333\n", " pop_sqmi pct_rent\n", "1 -10081.319205 42.515602\n", "3 -9910.919878 32.515602\n", "4 -9065.544603 37.515602\n", "6 -9709.934932 62.515602\n", "7 -9668.477470 -4.151064\n" ] } ], "source": [ "print(sf1[['county_name','pop_sqmi', 'pct_rent']][:5])\n", "print(normalized[:5])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can merge these transformed results on to the original DataFrame, and check the means of the original variables and the tranformed ones. The transformed ones should be arbitrarily close to zero." ] }, { "cell_type": "code", "execution_count": 23, "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", "
pop_sqmi_xpop_sqmi_ypct_rent_xpct_rent_y
county_name
Alameda13753.632044-7.944529e-1137.4843986.856168e-14
Contra Costa8081.846244-7.040712e-1227.223329-3.800049e-13
Marin6338.9361511.461176e-1233.1694549.143583e-15
Napa6245.985021-1.304992e-1332.903209-1.685373e-14
San Francisco28395.0935376.833338e-1251.927943-1.349699e-15
San Mateo11011.6384888.192330e-1230.274104-7.197617e-14
Santa Clara10598.5975455.347880e-1129.811290-1.211290e-13
Solano7203.7930389.815285e-1234.598761-5.029091e-14
Sonoma5415.8769881.308518e-1135.121698-5.937600e-14
\n", "
" ], "text/plain": [ " pop_sqmi_x pop_sqmi_y pct_rent_x pct_rent_y\n", "county_name \n", "Alameda 13753.632044 -7.944529e-11 37.484398 6.856168e-14\n", "Contra Costa 8081.846244 -7.040712e-12 27.223329 -3.800049e-13\n", "Marin 6338.936151 1.461176e-12 33.169454 9.143583e-15\n", "Napa 6245.985021 -1.304992e-13 32.903209 -1.685373e-14\n", "San Francisco 28395.093537 6.833338e-12 51.927943 -1.349699e-15\n", "San Mateo 11011.638488 8.192330e-12 30.274104 -7.197617e-14\n", "Santa Clara 10598.597545 5.347880e-11 29.811290 -1.211290e-13\n", "Solano 7203.793038 9.815285e-12 34.598761 -5.029091e-14\n", "Sonoma 5415.876988 1.308518e-11 35.121698 -5.937600e-14" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf2 = pd.merge(sf1,normalized, left_index=True, right_index=True)\n", "\n", "sf2.groupby('county_name')[['pop_sqmi_x', 'pop_sqmi_y', 'pct_rent_x', 'pct_rent_y']].mean()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Apply is a method we have learned previously, which allows us to apply a function to each row in a DataFrame. We can also combine apply with groupby to apply functions based on group membership. For example, the function 'top' sorts an array and selects the top n rows from it. We provide some defaults for the arguments of how many rows, and the column to use for the selection:" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def top(df, n=5, column='pop_sqmi'):\n", " return df.sort_values(by=column, ascending=False).head(n)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Using this on the full dataset and setting the number of rows and the column to get the top values for, in this case using pct_rent to override the default argument, we get the top 10 blocks in the region in terms of percentage rental." ] }, { "cell_type": "code", "execution_count": 25, "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", " \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", "
logrecnoblockfipsstatecountycounty_nametractblkgrpblockarealandP0010001...H0050007H0050008pct_rentpct_blackpct_asianpct_whitepct_hisppct_vacantpop_sqmitotal_hh
5539959300906075035202200606075San Francisco03520222006542038...00100.00.00000018.42105368.4210532.6315797.14285718158.58745426
5528359287606075033204301106075San Francisco0332043301119179160...00100.010.00000018.12500050.62500023.75000010.00000021606.86584372
5527059286206075033204200006075San Francisco0332042200031407...00100.00.000000100.0000000.0000000.0000000.0000005773.8585993
5527159286306075033204200106075San Francisco03320422001708471480...02100.06.82432434.05405447.56756812.3648658.06451654105.074880627
5527359286606075033204300106075San Francisco033204330014619841...00100.09.75609814.63414648.78048819.5121956.2500002298.57370415
5527759287006075033204300506075San Francisco033204330051553785...00100.09.41176530.58823544.70588214.11764730.76923114169.33642345
5527859287106075033204300606075San Francisco0332043300620132...00100.00.0000000.000000100.0000000.0000000.0000002573.2617981
5527959287206075033204300706075San Francisco0332043300722700697...03100.04.30416142.46771939.88522213.19942612.74509879525.182203267
5528059287306075033204300806075San Francisco0332043300821981211...01100.05.21327026.54028447.86729919.4312808.00000024861.81101992
5528159287406075033204300906075San Francisco0332043300915863137...00100.06.56934329.92700748.17518217.51824812.12121222368.30082658
\n", "

10 rows × 51 columns

\n", "
" ], "text/plain": [ " logrecno blockfips state county county_name tract blkgrp \\\n", "55399 593009 060750352022006 06 075 San Francisco 035202 2 \n", "55283 592876 060750332043011 06 075 San Francisco 033204 3 \n", "55270 592862 060750332042000 06 075 San Francisco 033204 2 \n", "55271 592863 060750332042001 06 075 San Francisco 033204 2 \n", "55273 592866 060750332043001 06 075 San Francisco 033204 3 \n", "55277 592870 060750332043005 06 075 San Francisco 033204 3 \n", "55278 592871 060750332043006 06 075 San Francisco 033204 3 \n", "55279 592872 060750332043007 06 075 San Francisco 033204 3 \n", "55280 592873 060750332043008 06 075 San Francisco 033204 3 \n", "55281 592874 060750332043009 06 075 San Francisco 033204 3 \n", "\n", " block arealand P0010001 ... H0050007 H0050008 pct_rent \\\n", "55399 2006 5420 38 ... 0 0 100.0 \n", "55283 3011 19179 160 ... 0 0 100.0 \n", "55270 2000 3140 7 ... 0 0 100.0 \n", "55271 2001 70847 1480 ... 0 2 100.0 \n", "55273 3001 46198 41 ... 0 0 100.0 \n", "55277 3005 15537 85 ... 0 0 100.0 \n", "55278 3006 2013 2 ... 0 0 100.0 \n", "55279 3007 22700 697 ... 0 3 100.0 \n", "55280 3008 21981 211 ... 0 1 100.0 \n", "55281 3009 15863 137 ... 0 0 100.0 \n", "\n", " pct_black pct_asian pct_white pct_hisp pct_vacant pop_sqmi \\\n", "55399 0.000000 18.421053 68.421053 2.631579 7.142857 18158.587454 \n", "55283 10.000000 18.125000 50.625000 23.750000 10.000000 21606.865843 \n", "55270 0.000000 100.000000 0.000000 0.000000 0.000000 5773.858599 \n", "55271 6.824324 34.054054 47.567568 12.364865 8.064516 54105.074880 \n", "55273 9.756098 14.634146 48.780488 19.512195 6.250000 2298.573704 \n", "55277 9.411765 30.588235 44.705882 14.117647 30.769231 14169.336423 \n", "55278 0.000000 0.000000 100.000000 0.000000 0.000000 2573.261798 \n", "55279 4.304161 42.467719 39.885222 13.199426 12.745098 79525.182203 \n", "55280 5.213270 26.540284 47.867299 19.431280 8.000000 24861.811019 \n", "55281 6.569343 29.927007 48.175182 17.518248 12.121212 22368.300826 \n", "\n", " total_hh \n", "55399 26 \n", "55283 72 \n", "55270 3 \n", "55271 627 \n", "55273 15 \n", "55277 45 \n", "55278 1 \n", "55279 267 \n", "55280 92 \n", "55281 58 \n", "\n", "[10 rows x 51 columns]" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "top(sf1, n=10, column='pct_rent')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Below we apply this with groupby and use the defaults for n and column, and it applies the function within each county and concatenates the results, producing the top 5 blocks on pop_sqmi for each county in the region." ] }, { "cell_type": "code", "execution_count": 26, "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", " \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", " \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", " \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", " \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", " \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", " \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", " \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", " \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", "
logrecnoblockfipsstatecountycounty_nametractblkgrpblockarealandP0010001...H0050007H0050008pct_rentpct_blackpct_asianpct_whitepct_hisppct_vacantpop_sqmitotal_hh
county_name
Alameda8494907306001431100200306001Alameda43110022003320392...01100.00000020.66326510.71428634.43877637.2448988.7209303.172735e+06157
4786511706001441925100406001Alameda441925110041240801...13100.0000004.11985064.54432022.7215985.6179784.5918371.673049e+06374
190032024106001402800201306001Alameda40280022013941370...01100.00000039.72973014.05405436.4864868.37837817.3076921.018380e+06215
9130976606001435104202206001Alameda435104220221013246...00100.0000002.03252025.60975622.35772442.6829273.2258066.289606e+0560
97021038806001436900100406001Alameda436900110042148431...0098.8764043.7122970.00000024.59396891.8793501.1111115.196857e+0589
Contra Costa373385611606013355115103406013Contra Costa355115110342386336...00100.00000012.79761936.60714336.9047629.2261903.7267083.647259e+05155
270634501706013315000119006013Contra Costa31500011190900126...0012.5000003.17460315.07936565.87301619.8412705.8823533.625983e+0532
256284344006013313102101206013Contra Costa313102110124525568...02100.00000043.6619723.34507028.34507031.3380283.2520333.251079e+05238
270624501606013315000117006013Contra Costa31500011170932115...0118.4210531.73913011.30434877.3913047.8260877.3170733.195801e+0538
279044592106013334004201106013Contra Costa3340042201179960...0038.4615385.00000021.66666761.66666711.66666713.3333331.944922e+0526
Marin4675431622806041130202101206041Marin13020211012797129...0116.4556960.7751941.55038895.3488373.8759693.6585374.192076e+0579
4676231623606041130202102006041Marin130202110201411101...0117.5438600.0000001.98019892.0792085.9405946.5573771.853925e+0557
4674831622206041130202100606041Marin13020211006174484...0128.8461540.0000002.38095294.0476191.19047616.1290321.247471e+0552
4484631409406041122000100006041Marin122000110001039664854...00NaN40.6674911.11248539.65801419.736300NaN1.209222e+050
4503031429706041106001303706041Marin106001330373050131...00100.0000004.58015313.74045861.06870221.3740464.2253521.112421e+0568
Napa4738035551106055201003200306055Napa2010032200344250...0076.92307726.00000030.00000022.00000034.0000000.0000002.929851e+0513
4740235553306055201003202606055Napa201003220263779125...0097.22222220.00000013.60000031.20000054.4000000.0000008.567042e+0436
4819035637306055200505100206055Napa20050511002391686...0033.3333330.00000087.2093023.4883726.9767440.0000005.687921e+046
4890435716506055200301302706055Napa20030133027363962...0061.5384621.6129030.00000041.93548487.0967740.0000004.412730e+0413
4838835658806055200704300306055Napa20070433003181930...0083.33333310.0000000.00000043.33333363.3333330.0000004.271558e+0412
San Francisco5523059281806075033203100906075San Francisco033203110091502325...00100.0000005.53846238.46153844.92307710.76923111.7647065.604168e+05135
5011458716106075012501100306075San Francisco01250111003154881994...08100.00000024.37311912.18656047.69307916.0481449.9462373.334476e+05335
5637359408106075061100200306075San Francisco061100220037217765...0399.4152050.00000099.2156860.2614380.0000007.3170732.745380e+05342
4973158670906075010500200806075San Francisco010500220084426461...02499.7167142.81995724.07809169.6312365.42299318.0974482.697660e+05353
5007358711406075012401200106075San Francisco01240122001153121498...0399.8538016.20827815.15353835.64753058.9452608.9214382.533831e+05684
San Mateo6028362577206081610202104606081San Mateo610202110468954946...00NaN19.3446098.66807636.89217842.389006NaN2.736351e+050
6057362607506081610304202006081San Mateo610304220202596210...0022.1238940.00000029.04761967.1428578.5714291.7391302.095137e+05113
6037062586206081610203200606081San Mateo610203220065177262...0094.7368422.2900760.76335935.11450492.7480926.5573771.310753e+0557
6354162933506081601601100506081San Mateo601601110058475397...00100.0000005.54156242.06549131.98992424.9370284.5751631.213245e+05146
6384062966706081600800300606081San Mateo6008003300619408872...0199.76470610.55045941.85779832.22477118.9220188.4051721.163680e+05425
Santa Clara6842264676106085508001300206085Santa Clara50800133002438154...0199.2700731.94805210.38961086.3636361.29870117.9640729.106351e+05137
7247065117506085511301100506085Santa Clara511301110051653254...0079.6954310.0000004.72440994.8818900.39370114.7186153.979776e+05197
7311765185606085500200200206085Santa Clara500200220024325534...00NaN9.5505627.67790329.21348363.670412NaN3.197812e+050
7533565427606085503108400206085Santa Clara503108440024625523...00100.00000018.16443617.39961846.46271539.9617590.5780352.928786e+05172
7352065228606085500902200006085Santa Clara50090222000200822051...0083.33333311.11652922.86689450.90199917.1136030.0000002.645187e+056
Solano9076770175706095252401401206095Solano252401440123266364...0199.43181829.67033022.25274727.19780220.05494512.0000002.886576e+05176
9034770131406095252312201106095Solano252312220117742440...01100.00000017.50000014.09090949.31818213.6363644.4354841.471964e+05237
9742370880206095250900100906095Solano250900110098139293...00100.00000062.79863511.26279912.96928310.5802057.8947379.323830e+04140
9042170139206095252313304006095Solano25231333040117138...0078.1250000.0000002.63157997.3684210.00000013.5135148.404743e+0432
9116670218306095252608100706095Solano25260811007348497...0153.12500047.4226808.24742310.30927836.08247415.7894747.210931e+0432
Sonoma10692071944106097151402301306097Sonoma15140233013150698...0014.2857145.1020415.10204140.81632787.7551024.5454551.685384e+0521
10673171923106097153300102006097Sonoma15330011020129240...00100.0000000.0000000.00000085.00000025.0000005.5555568.018539e+0417
10493171728506097151602306306097Sonoma1516023306338311...000.0000000.0000000.000000100.0000000.0000000.0000007.438608e+046
10467071700206097151402500306097Sonoma151402550037555213...01100.0000001.8779345.16431961.50234730.0469483.2608707.302018e+0489
10692871945006097151402400306097Sonoma15140244003103829...00100.0000000.0000000.00000024.137931100.0000000.0000007.235997e+047
\n", "

45 rows × 51 columns

\n", "
" ], "text/plain": [ " logrecno blockfips state county county_name \\\n", "county_name \n", "Alameda 8494 9073 060014311002003 06 001 Alameda \n", " 4786 5117 060014419251004 06 001 Alameda \n", " 19003 20241 060014028002013 06 001 Alameda \n", " 9130 9766 060014351042022 06 001 Alameda \n", " 9702 10388 060014369001004 06 001 Alameda \n", "Contra Costa 37338 56116 060133551151034 06 013 Contra Costa \n", " 27063 45017 060133150001190 06 013 Contra Costa \n", " 25628 43440 060133131021012 06 013 Contra Costa \n", " 27062 45016 060133150001170 06 013 Contra Costa \n", " 27904 45921 060133340042011 06 013 Contra Costa \n", "Marin 46754 316228 060411302021012 06 041 Marin \n", " 46762 316236 060411302021020 06 041 Marin \n", " 46748 316222 060411302021006 06 041 Marin \n", " 44846 314094 060411220001000 06 041 Marin \n", " 45030 314297 060411060013037 06 041 Marin \n", "Napa 47380 355511 060552010032003 06 055 Napa \n", " 47402 355533 060552010032026 06 055 Napa \n", " 48190 356373 060552005051002 06 055 Napa \n", " 48904 357165 060552003013027 06 055 Napa \n", " 48388 356588 060552007043003 06 055 Napa \n", "San Francisco 55230 592818 060750332031009 06 075 San Francisco \n", " 50114 587161 060750125011003 06 075 San Francisco \n", " 56373 594081 060750611002003 06 075 San Francisco \n", " 49731 586709 060750105002008 06 075 San Francisco \n", " 50073 587114 060750124012001 06 075 San Francisco \n", "San Mateo 60283 625772 060816102021046 06 081 San Mateo \n", " 60573 626075 060816103042020 06 081 San Mateo \n", " 60370 625862 060816102032006 06 081 San Mateo \n", " 63541 629335 060816016011005 06 081 San Mateo \n", " 63840 629667 060816008003006 06 081 San Mateo \n", "Santa Clara 68422 646761 060855080013002 06 085 Santa Clara \n", " 72470 651175 060855113011005 06 085 Santa Clara \n", " 73117 651856 060855002002002 06 085 Santa Clara \n", " 75335 654276 060855031084002 06 085 Santa Clara \n", " 73520 652286 060855009022000 06 085 Santa Clara \n", "Solano 90767 701757 060952524014012 06 095 Solano \n", " 90347 701314 060952523122011 06 095 Solano \n", " 97423 708802 060952509001009 06 095 Solano \n", " 90421 701392 060952523133040 06 095 Solano \n", " 91166 702183 060952526081007 06 095 Solano \n", "Sonoma 106920 719441 060971514023013 06 097 Sonoma \n", " 106731 719231 060971533001020 06 097 Sonoma \n", " 104931 717285 060971516023063 06 097 Sonoma \n", " 104670 717002 060971514025003 06 097 Sonoma \n", " 106928 719450 060971514024003 06 097 Sonoma \n", "\n", " tract blkgrp block arealand P0010001 ... \\\n", "county_name ... \n", "Alameda 8494 431100 2 2003 320 392 ... \n", " 4786 441925 1 1004 1240 801 ... \n", " 19003 402800 2 2013 941 370 ... \n", " 9130 435104 2 2022 1013 246 ... \n", " 9702 436900 1 1004 2148 431 ... \n", "Contra Costa 37338 355115 1 1034 2386 336 ... \n", " 27063 315000 1 1190 900 126 ... \n", " 25628 313102 1 1012 4525 568 ... \n", " 27062 315000 1 1170 932 115 ... \n", " 27904 334004 2 2011 799 60 ... \n", "Marin 46754 130202 1 1012 797 129 ... \n", " 46762 130202 1 1020 1411 101 ... \n", " 46748 130202 1 1006 1744 84 ... \n", " 44846 122000 1 1000 103966 4854 ... \n", " 45030 106001 3 3037 3050 131 ... \n", "Napa 47380 201003 2 2003 442 50 ... \n", " 47402 201003 2 2026 3779 125 ... \n", " 48190 200505 1 1002 3916 86 ... \n", " 48904 200301 3 3027 3639 62 ... \n", " 48388 200704 3 3003 1819 30 ... \n", "San Francisco 55230 033203 1 1009 1502 325 ... \n", " 50114 012501 1 1003 15488 1994 ... \n", " 56373 061100 2 2003 7217 765 ... \n", " 49731 010500 2 2008 4426 461 ... \n", " 50073 012401 2 2001 15312 1498 ... \n", "San Mateo 60283 610202 1 1046 8954 946 ... \n", " 60573 610304 2 2020 2596 210 ... \n", " 60370 610203 2 2006 5177 262 ... \n", " 63541 601601 1 1005 8475 397 ... \n", " 63840 600800 3 3006 19408 872 ... \n", "Santa Clara 68422 508001 3 3002 438 154 ... \n", " 72470 511301 1 1005 1653 254 ... \n", " 73117 500200 2 2002 4325 534 ... \n", " 75335 503108 4 4002 4625 523 ... \n", " 73520 500902 2 2000 20082 2051 ... \n", "Solano 90767 252401 4 4012 3266 364 ... \n", " 90347 252312 2 2011 7742 440 ... \n", " 97423 250900 1 1009 8139 293 ... \n", " 90421 252313 3 3040 1171 38 ... \n", " 91166 252608 1 1007 3484 97 ... \n", "Sonoma 106920 151402 3 3013 1506 98 ... \n", " 106731 153300 1 1020 1292 40 ... \n", " 104931 151602 3 3063 383 11 ... \n", " 104670 151402 5 5003 7555 213 ... \n", " 106928 151402 4 4003 1038 29 ... \n", "\n", " H0050007 H0050008 pct_rent pct_black pct_asian \\\n", "county_name \n", "Alameda 8494 0 1 100.000000 20.663265 10.714286 \n", " 4786 1 3 100.000000 4.119850 64.544320 \n", " 19003 0 1 100.000000 39.729730 14.054054 \n", " 9130 0 0 100.000000 2.032520 25.609756 \n", " 9702 0 0 98.876404 3.712297 0.000000 \n", "Contra Costa 37338 0 0 100.000000 12.797619 36.607143 \n", " 27063 0 0 12.500000 3.174603 15.079365 \n", " 25628 0 2 100.000000 43.661972 3.345070 \n", " 27062 0 1 18.421053 1.739130 11.304348 \n", " 27904 0 0 38.461538 5.000000 21.666667 \n", "Marin 46754 0 1 16.455696 0.775194 1.550388 \n", " 46762 0 1 17.543860 0.000000 1.980198 \n", " 46748 0 1 28.846154 0.000000 2.380952 \n", " 44846 0 0 NaN 40.667491 1.112485 \n", " 45030 0 0 100.000000 4.580153 13.740458 \n", "Napa 47380 0 0 76.923077 26.000000 30.000000 \n", " 47402 0 0 97.222222 20.000000 13.600000 \n", " 48190 0 0 33.333333 0.000000 87.209302 \n", " 48904 0 0 61.538462 1.612903 0.000000 \n", " 48388 0 0 83.333333 10.000000 0.000000 \n", "San Francisco 55230 0 0 100.000000 5.538462 38.461538 \n", " 50114 0 8 100.000000 24.373119 12.186560 \n", " 56373 0 3 99.415205 0.000000 99.215686 \n", " 49731 0 24 99.716714 2.819957 24.078091 \n", " 50073 0 3 99.853801 6.208278 15.153538 \n", "San Mateo 60283 0 0 NaN 19.344609 8.668076 \n", " 60573 0 0 22.123894 0.000000 29.047619 \n", " 60370 0 0 94.736842 2.290076 0.763359 \n", " 63541 0 0 100.000000 5.541562 42.065491 \n", " 63840 0 1 99.764706 10.550459 41.857798 \n", "Santa Clara 68422 0 1 99.270073 1.948052 10.389610 \n", " 72470 0 0 79.695431 0.000000 4.724409 \n", " 73117 0 0 NaN 9.550562 7.677903 \n", " 75335 0 0 100.000000 18.164436 17.399618 \n", " 73520 0 0 83.333333 11.116529 22.866894 \n", "Solano 90767 0 1 99.431818 29.670330 22.252747 \n", " 90347 0 1 100.000000 17.500000 14.090909 \n", " 97423 0 0 100.000000 62.798635 11.262799 \n", " 90421 0 0 78.125000 0.000000 2.631579 \n", " 91166 0 1 53.125000 47.422680 8.247423 \n", "Sonoma 106920 0 0 14.285714 5.102041 5.102041 \n", " 106731 0 0 100.000000 0.000000 0.000000 \n", " 104931 0 0 0.000000 0.000000 0.000000 \n", " 104670 0 1 100.000000 1.877934 5.164319 \n", " 106928 0 0 100.000000 0.000000 0.000000 \n", "\n", " pct_white pct_hisp pct_vacant pop_sqmi \\\n", "county_name \n", "Alameda 8494 34.438776 37.244898 8.720930 3.172735e+06 \n", " 4786 22.721598 5.617978 4.591837 1.673049e+06 \n", " 19003 36.486486 8.378378 17.307692 1.018380e+06 \n", " 9130 22.357724 42.682927 3.225806 6.289606e+05 \n", " 9702 24.593968 91.879350 1.111111 5.196857e+05 \n", "Contra Costa 37338 36.904762 9.226190 3.726708 3.647259e+05 \n", " 27063 65.873016 19.841270 5.882353 3.625983e+05 \n", " 25628 28.345070 31.338028 3.252033 3.251079e+05 \n", " 27062 77.391304 7.826087 7.317073 3.195801e+05 \n", " 27904 61.666667 11.666667 13.333333 1.944922e+05 \n", "Marin 46754 95.348837 3.875969 3.658537 4.192076e+05 \n", " 46762 92.079208 5.940594 6.557377 1.853925e+05 \n", " 46748 94.047619 1.190476 16.129032 1.247471e+05 \n", " 44846 39.658014 19.736300 NaN 1.209222e+05 \n", " 45030 61.068702 21.374046 4.225352 1.112421e+05 \n", "Napa 47380 22.000000 34.000000 0.000000 2.929851e+05 \n", " 47402 31.200000 54.400000 0.000000 8.567042e+04 \n", " 48190 3.488372 6.976744 0.000000 5.687921e+04 \n", " 48904 41.935484 87.096774 0.000000 4.412730e+04 \n", " 48388 43.333333 63.333333 0.000000 4.271558e+04 \n", "San Francisco 55230 44.923077 10.769231 11.764706 5.604168e+05 \n", " 50114 47.693079 16.048144 9.946237 3.334476e+05 \n", " 56373 0.261438 0.000000 7.317073 2.745380e+05 \n", " 49731 69.631236 5.422993 18.097448 2.697660e+05 \n", " 50073 35.647530 58.945260 8.921438 2.533831e+05 \n", "San Mateo 60283 36.892178 42.389006 NaN 2.736351e+05 \n", " 60573 67.142857 8.571429 1.739130 2.095137e+05 \n", " 60370 35.114504 92.748092 6.557377 1.310753e+05 \n", " 63541 31.989924 24.937028 4.575163 1.213245e+05 \n", " 63840 32.224771 18.922018 8.405172 1.163680e+05 \n", "Santa Clara 68422 86.363636 1.298701 17.964072 9.106351e+05 \n", " 72470 94.881890 0.393701 14.718615 3.979776e+05 \n", " 73117 29.213483 63.670412 NaN 3.197812e+05 \n", " 75335 46.462715 39.961759 0.578035 2.928786e+05 \n", " 73520 50.901999 17.113603 0.000000 2.645187e+05 \n", "Solano 90767 27.197802 20.054945 12.000000 2.886576e+05 \n", " 90347 49.318182 13.636364 4.435484 1.471964e+05 \n", " 97423 12.969283 10.580205 7.894737 9.323830e+04 \n", " 90421 97.368421 0.000000 13.513514 8.404743e+04 \n", " 91166 10.309278 36.082474 15.789474 7.210931e+04 \n", "Sonoma 106920 40.816327 87.755102 4.545455 1.685384e+05 \n", " 106731 85.000000 25.000000 5.555556 8.018539e+04 \n", " 104931 100.000000 0.000000 0.000000 7.438608e+04 \n", " 104670 61.502347 30.046948 3.260870 7.302018e+04 \n", " 106928 24.137931 100.000000 0.000000 7.235997e+04 \n", "\n", " total_hh \n", "county_name \n", "Alameda 8494 157 \n", " 4786 374 \n", " 19003 215 \n", " 9130 60 \n", " 9702 89 \n", "Contra Costa 37338 155 \n", " 27063 32 \n", " 25628 238 \n", " 27062 38 \n", " 27904 26 \n", "Marin 46754 79 \n", " 46762 57 \n", " 46748 52 \n", " 44846 0 \n", " 45030 68 \n", "Napa 47380 13 \n", " 47402 36 \n", " 48190 6 \n", " 48904 13 \n", " 48388 12 \n", "San Francisco 55230 135 \n", " 50114 335 \n", " 56373 342 \n", " 49731 353 \n", " 50073 684 \n", "San Mateo 60283 0 \n", " 60573 113 \n", " 60370 57 \n", " 63541 146 \n", " 63840 425 \n", "Santa Clara 68422 137 \n", " 72470 197 \n", " 73117 0 \n", " 75335 172 \n", " 73520 6 \n", "Solano 90767 176 \n", " 90347 237 \n", " 97423 140 \n", " 90421 32 \n", " 91166 32 \n", "Sonoma 106920 21 \n", " 106731 17 \n", " 104931 6 \n", " 104670 89 \n", " 106928 7 \n", "\n", "[45 rows x 51 columns]" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf1.groupby('county_name').apply(top)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we pass arguments to the function to set n and the column to select the top value from." ] }, { "cell_type": "code", "execution_count": 27, "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", " \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", " \n", " \n", " \n", " \n", "
logrecnoblockfipsstatecountycounty_nametractblkgrpblockarealandP0010001...H0050007H0050008pct_rentpct_blackpct_asianpct_whitepct_hisppct_vacantpop_sqmitotal_hh
county_name
Alameda125441343406001430102100006001Alameda4301021100031296322166...0345.2830191.2048193.61445884.3373496.0240967.01754413.73765353
Contra Costa377895657906013355112115806013Contra Costa3551121115819441925141...0323.8095242.1276600.70922075.88652524.82269512.50000018.78354742
Marin4277331182806041132200300806041Marin1322003300848884156112...6091.6666670.0000000.89285764.28571466.07142936.8421055.93400236
Napa4706635519106055201800100006055Napa201800110009322809013...1283.3333330.0000000.00000092.3076920.00000053.8461540.3611566
San Francisco5613959383306075060400101306075San Francisco0604001101310362623...00NaN0.00000033.33333366.6666670.000000NaN7.4980690
San Mateo5766062291906081613800103506081San Mateo6138001103528976148105...0455.1724140.9523810.00000047.61904860.95238119.4444449.38526229
Santa Clara6645164461006085513500120206085Santa Clara5135001120227748316062...0116.6666673.2258060.00000082.2580651.61290314.2857140.57869924
Solano9249970362906095252702600906095Solano252702660093031807314...0033.3333330.00000035.71428664.2857140.00000014.2857141.1959816
Sonoma9963271152706097154202200006097Sonoma1542022200035658559106...0136.5853660.0000000.00000089.62264214.15094328.0701757.69909841
\n", "

9 rows × 51 columns

\n", "
" ], "text/plain": [ " logrecno blockfips state county county_name \\\n", "county_name \n", "Alameda 12544 13434 060014301021000 06 001 Alameda \n", "Contra Costa 37789 56579 060133551121158 06 013 Contra Costa \n", "Marin 42773 311828 060411322003008 06 041 Marin \n", "Napa 47066 355191 060552018001000 06 055 Napa \n", "San Francisco 56139 593833 060750604001013 06 075 San Francisco \n", "San Mateo 57660 622919 060816138001035 06 081 San Mateo \n", "Santa Clara 66451 644610 060855135001202 06 085 Santa Clara \n", "Solano 92499 703629 060952527026009 06 095 Solano \n", "Sonoma 99632 711527 060971542022000 06 097 Sonoma \n", "\n", " tract blkgrp block arealand P0010001 ... \\\n", "county_name ... \n", "Alameda 12544 430102 1 1000 31296322 166 ... \n", "Contra Costa 37789 355112 1 1158 19441925 141 ... \n", "Marin 42773 132200 3 3008 48884156 112 ... \n", "Napa 47066 201800 1 1000 93228090 13 ... \n", "San Francisco 56139 060400 1 1013 1036262 3 ... \n", "San Mateo 57660 613800 1 1035 28976148 105 ... \n", "Santa Clara 66451 513500 1 1202 277483160 62 ... \n", "Solano 92499 252702 6 6009 30318073 14 ... \n", "Sonoma 99632 154202 2 2000 35658559 106 ... \n", "\n", " H0050007 H0050008 pct_rent pct_black pct_asian \\\n", "county_name \n", "Alameda 12544 0 3 45.283019 1.204819 3.614458 \n", "Contra Costa 37789 0 3 23.809524 2.127660 0.709220 \n", "Marin 42773 6 0 91.666667 0.000000 0.892857 \n", "Napa 47066 1 2 83.333333 0.000000 0.000000 \n", "San Francisco 56139 0 0 NaN 0.000000 33.333333 \n", "San Mateo 57660 0 4 55.172414 0.952381 0.000000 \n", "Santa Clara 66451 0 1 16.666667 3.225806 0.000000 \n", "Solano 92499 0 0 33.333333 0.000000 35.714286 \n", "Sonoma 99632 0 1 36.585366 0.000000 0.000000 \n", "\n", " pct_white pct_hisp pct_vacant pop_sqmi total_hh \n", "county_name \n", "Alameda 12544 84.337349 6.024096 7.017544 13.737653 53 \n", "Contra Costa 37789 75.886525 24.822695 12.500000 18.783547 42 \n", "Marin 42773 64.285714 66.071429 36.842105 5.934002 36 \n", "Napa 47066 92.307692 0.000000 53.846154 0.361156 6 \n", "San Francisco 56139 66.666667 0.000000 NaN 7.498069 0 \n", "San Mateo 57660 47.619048 60.952381 19.444444 9.385262 29 \n", "Santa Clara 66451 82.258065 1.612903 14.285714 0.578699 24 \n", "Solano 92499 64.285714 0.000000 14.285714 1.195981 6 \n", "Sonoma 99632 89.622642 14.150943 28.070175 7.699098 41 \n", "\n", "[9 rows x 51 columns]" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf1.groupby('county_name').apply(top, n=1, column='arealand')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Experimenting with Rental Listings Merged with SF1\n", "\n", "Let's read the geocoded rental listings for the Bay Area to begin. We will make sure the fips_block column is read as a string dtype so we can merge properly with the census data. It has leading zeros and is a string in the census data." ] }, { "cell_type": "code", "execution_count": 28, "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", "
rentbedroomssqftlongitudelatitudefips_block
04500.02.01200.0-122.43830037.745000060750216002015
12650.02.01040.0-122.00813137.353699060855085053008
23100.02.01000.0-122.43974337.731584060750311005011
31850.01.0792.0-122.23429437.491715060816101001026
41325.01.0642.0-122.08775137.923448060133400021004
\n", "
" ], "text/plain": [ " rent bedrooms sqft longitude latitude fips_block\n", "0 4500.0 2.0 1200.0 -122.438300 37.745000 060750216002015\n", "1 2650.0 2.0 1040.0 -122.008131 37.353699 060855085053008\n", "2 3100.0 2.0 1000.0 -122.439743 37.731584 060750311005011\n", "3 1850.0 1.0 792.0 -122.234294 37.491715 060816101001026\n", "4 1325.0 1.0 642.0 -122.087751 37.923448 060133400021004" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals = pd.read_csv('data/sfbay_geocoded.csv', usecols=['rent', 'bedrooms', 'sqft', 'fips_block', 'longitude', 'latitude'], dtype={'fips_block': str})\n", "#rentals = pd.read_csv('sfbay_geocoded.csv')\n", " \n", "rentals[:5]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And merge it with the census data using the FIPS block codes, which are named differently in the two DataFrames." ] }, { "cell_type": "code", "execution_count": 29, "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", " \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", "
rentbedroomssqftlongitudelatitudefips_blocklogrecnoblockfipsstatecounty...H0050007H0050008pct_rentpct_blackpct_asianpct_whitepct_hisppct_vacantpop_sqmitotal_hh
04500.02.01200.0-122.43830037.74500006075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
16250.03.01215.0-122.43830037.74500006075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
26250.03.01215.0-122.43830037.74500006075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
36650.03.02900.0-122.44008837.74529606075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
42600.01.0615.0-122.44008837.74529606075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
52615.01.0615.0-122.44008837.74529606075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
62615.01.0615.0-122.44008837.74529606075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
72600.01.0615.0-122.44008837.74529606075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
83200.0NaN900.0-122.43830037.74500006075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
92600.01.0615.0-122.44008837.74529606075021600201558926106075021600201506075...0588.88888923.44582610.30195446.35879223.2682065.88235324936.524053288
\n", "

10 rows × 57 columns

\n", "
" ], "text/plain": [ " rent bedrooms sqft longitude latitude fips_block logrecno \\\n", "0 4500.0 2.0 1200.0 -122.438300 37.745000 060750216002015 589261 \n", "1 6250.0 3.0 1215.0 -122.438300 37.745000 060750216002015 589261 \n", "2 6250.0 3.0 1215.0 -122.438300 37.745000 060750216002015 589261 \n", "3 6650.0 3.0 2900.0 -122.440088 37.745296 060750216002015 589261 \n", "4 2600.0 1.0 615.0 -122.440088 37.745296 060750216002015 589261 \n", "5 2615.0 1.0 615.0 -122.440088 37.745296 060750216002015 589261 \n", "6 2615.0 1.0 615.0 -122.440088 37.745296 060750216002015 589261 \n", "7 2600.0 1.0 615.0 -122.440088 37.745296 060750216002015 589261 \n", "8 3200.0 NaN 900.0 -122.438300 37.745000 060750216002015 589261 \n", "9 2600.0 1.0 615.0 -122.440088 37.745296 060750216002015 589261 \n", "\n", " blockfips state county ... H0050007 H0050008 pct_rent \\\n", "0 060750216002015 06 075 ... 0 5 88.888889 \n", "1 060750216002015 06 075 ... 0 5 88.888889 \n", "2 060750216002015 06 075 ... 0 5 88.888889 \n", "3 060750216002015 06 075 ... 0 5 88.888889 \n", "4 060750216002015 06 075 ... 0 5 88.888889 \n", "5 060750216002015 06 075 ... 0 5 88.888889 \n", "6 060750216002015 06 075 ... 0 5 88.888889 \n", "7 060750216002015 06 075 ... 0 5 88.888889 \n", "8 060750216002015 06 075 ... 0 5 88.888889 \n", "9 060750216002015 06 075 ... 0 5 88.888889 \n", "\n", " pct_black pct_asian pct_white pct_hisp pct_vacant pop_sqmi \\\n", "0 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "1 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "2 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "3 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "4 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "5 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "6 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "7 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "8 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "9 23.445826 10.301954 46.358792 23.268206 5.882353 24936.524053 \n", "\n", " total_hh \n", "0 288 \n", "1 288 \n", "2 288 \n", "3 288 \n", "4 288 \n", "5 288 \n", "6 288 \n", "7 288 \n", "8 288 \n", "9 288 \n", "\n", "[10 rows x 57 columns]" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1 = pd.merge(rentals, sf1, left_on='fips_block', right_on='blockfips')\n", "rentals_sf1[:10]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can begin looking at this merged dataset. Let's start by computing mean rents by county." ] }, { "cell_type": "code", "execution_count": 30, "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", "
rent
county_name
San Francisco3746.737974
Marin3277.287562
San Mateo2857.011248
Santa Clara2665.584276
Alameda2235.584293
Napa2117.797398
Contra Costa1955.075348
Sonoma1805.140760
Solano1359.965551
\n", "
" ], "text/plain": [ " rent\n", "county_name \n", "San Francisco 3746.737974\n", "Marin 3277.287562\n", "San Mateo 2857.011248\n", "Santa Clara 2665.584276\n", "Alameda 2235.584293\n", "Napa 2117.797398\n", "Contra Costa 1955.075348\n", "Sonoma 1805.140760\n", "Solano 1359.965551" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "county_rents = rentals_sf1.groupby(rentals_sf1['county_name'])[['rent']].mean().sort_values(by='rent', ascending=False)\n", "county_rents" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAFGCAYAAACMtCMoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu8XHV97vHPQ4xAuShCipAgwRatEDRApAFqy0ULXkGq\nCKWGWgQVqqIeT8HWA2jTY72AQhVEQS4H4cQCB6SCQATEC2CggRAuknIpiREiolwUNOE5f6zfkGGz\nkz072Zm1Mut5v17zmrV+M2vmu3ey5zu/u2wTERHttE7dAURERH2SBCIiWixJICKixZIEIiJaLEkg\nIqLFkgQiIlosSSAiosWSBCIiWixJICKixZIEIiJa7AV1BzCSzTbbzJMnT647jIiItcrNN9/8C9sT\nRnpe45PA5MmTmTNnTt1hRESsVSQ90Mvz0hwUEdFiSQIRES2WJBAR0WKN7xOIiFgdv//971m4cCFP\nPfVU3aGsEeuttx6TJk1i/Pjxq3R9kkBEDLSFCxey0UYbMXnyZCTVHc6Yss0jjzzCwoUL2WabbVbp\nNdIcFBED7amnnmLTTTcduAQAIIlNN910tWo5SQIRMfAGMQF0rO7PliQQEdFw1157LT/60Y/WyGsP\nRJ+AThi7LO/jPGavFRHNM5afFzD6zwzb2GaddXr/Dn7ttdey4YYbsttuu402vBGlJhARsYbdf//9\nvPKVr2TGjBlMmTKFc889l1133ZWddtqJd77znTzxxBNAtULCcccdx0477cQOO+zAXXfdxf33389p\np53GSSedxNSpU7n++uvHNLYkgYiIPrjnnns48sgjue666zjjjDO4+uqrueWWW5g2bRonnnjis8/b\nbLPNuOWWW/jABz7A5z//eSZPnsz73/9+PvKRjzB37lxe97rXjWlcA9EcFBHRdFtvvTXTp0/nsssu\n44477mD33XcH4He/+x277rrrs8874IADANh555256KKL1nhcSQIREX2wwQYbAFWfwBve8AbOP//8\nYZ+37rrrAjBu3DiWLl26xuNKc1BERB9Nnz6dH/7whyxYsACAJ598kp/+9KcrvWajjTbi8ccfXyPx\nJAlERPTRhAkTOOusszj44IN59atfza677spdd9210mve+ta3cvHFF6+RjmHZzR4SOW3aNI+0n0CG\niEbEitx555286lWvqjuMNWq4n1HSzbanjXRtagIRES2WJBAR0WIjJgFJ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dKdkr4m\nab6kKyWt33XdT0q8F3ZqGiW+UyXdIOneEteZ5XXO6nrtv5T0Y0m3SPqWpA3XwK81WiZJINZKkrYH\n/gnYq2xg/mHgFOBs268GzgNO7uGldgSOBrYDXg7sbvtk4GfAnrb3BGYBb5U0vlzzHuDMlbzmtsCX\nbW8P/Ipq2RKAi2y/tsR7J3BY1zWbUC13/hHgUuAkqg2RdpA0VdJm5ed9ve2dgDnAR3v4+SJWahDn\nCUQ77AV8q9NcU5YJ2RU4oDx+LvDZHl7nJtsLAcqM8snAD7qfYPsJSd8D3iLpTmD8cOvmd7nPdmd2\n+s0sX0t/iqR/plpyeUPgu13XfNu2Jc0DHuq8vqT55fpJVInqh5KgWpTtxz38fBErlSQQbbCUUuuV\ntA7VB2jH013Hy1jx38TXgU8AdwHfGOH9hr5mZy39s4D9bd8q6W+BPYa55pkh1z9TYloGXGX74BHe\nO2JU0hwUa6vvAe+UtCmApJcAPwIOKo8fQpktTrWXxM7l+G3AeEb2OLBR58T2jcBWwF9TzUpfFRsB\ni0uz0iGjvPYGYPcy8x1JG5QJkBGrJTWBWCvZni9pJtUSIcuA/6RaLfYbkj4OLKFquwf4GnCJpFuB\nK4Ane3iL04ErJP2s9AtA1Tcw1fajqxj2J4EbS2w30pVkRmJ7Sak9nF/2x4Cqj+CnqxhLBJAhohE9\nk3QZcJLt2XXHEjFW0hwUMQJJL5b0U+C3SQAxaFITiFgFpS9iuISwt+1H+h1PxKpKEoiIaLE0B0VE\ntFiSQEREiyUJRES0WJJARESLJQlERLRYkkBERIv9f6kGzMGw+R4dAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%matplotlib inline\n", "\n", "county_rents.plot(kind='bar', color='g')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Those patterns generally conform to our expectations, with San Francisco highest and Solano lowest.\n", "\n", "Let's examine these patterns by county and number of bedrooms. We can just use two columns in the groupby to do this." ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "scrolled": false }, "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", " \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", "
rent
county_namebedrooms
Alameda1.01862.396037
2.02284.538409
3.02715.874074
4.03315.346895
5.04820.488152
6.05898.392857
7.07362.500000
8.08400.000000
Contra Costa1.01596.991079
2.01874.641106
3.02390.508197
4.02831.713831
5.03547.841808
6.03258.636364
7.07172.500000
8.03200.000000
Marin1.02209.910211
2.02998.448575
3.04476.835979
4.05837.602273
5.05145.666667
6.05250.000000
Napa1.01387.362745
2.01846.914110
3.02447.333333
4.02998.593750
5.03009.000000
San Francisco1.03099.179065
2.04225.756604
3.05151.170096
......
5.07525.666667
6.07750.000000
7.09950.000000
8.09900.000000
San Mateo1.02266.792148
2.02975.375058
3.03888.506952
4.05292.336683
5.05633.618182
6.07260.000000
Santa Clara1.02143.095373
2.02721.721386
3.03451.772947
4.04280.278307
5.05642.350211
6.06704.545455
7.06028.571429
8.02550.000000
Solano1.01143.470514
2.01277.712283
3.01640.565678
4.02043.212766
5.02491.250000
7.03000.000000
Sonoma1.01403.868078
2.01830.113469
3.02284.307937
4.02738.465347
5.03037.500000
6.03295.000000
\n", "

61 rows × 1 columns

\n", "
" ], "text/plain": [ " rent\n", "county_name bedrooms \n", "Alameda 1.0 1862.396037\n", " 2.0 2284.538409\n", " 3.0 2715.874074\n", " 4.0 3315.346895\n", " 5.0 4820.488152\n", " 6.0 5898.392857\n", " 7.0 7362.500000\n", " 8.0 8400.000000\n", "Contra Costa 1.0 1596.991079\n", " 2.0 1874.641106\n", " 3.0 2390.508197\n", " 4.0 2831.713831\n", " 5.0 3547.841808\n", " 6.0 3258.636364\n", " 7.0 7172.500000\n", " 8.0 3200.000000\n", "Marin 1.0 2209.910211\n", " 2.0 2998.448575\n", " 3.0 4476.835979\n", " 4.0 5837.602273\n", " 5.0 5145.666667\n", " 6.0 5250.000000\n", "Napa 1.0 1387.362745\n", " 2.0 1846.914110\n", " 3.0 2447.333333\n", " 4.0 2998.593750\n", " 5.0 3009.000000\n", "San Francisco 1.0 3099.179065\n", " 2.0 4225.756604\n", " 3.0 5151.170096\n", "... ...\n", " 5.0 7525.666667\n", " 6.0 7750.000000\n", " 7.0 9950.000000\n", " 8.0 9900.000000\n", "San Mateo 1.0 2266.792148\n", " 2.0 2975.375058\n", " 3.0 3888.506952\n", " 4.0 5292.336683\n", " 5.0 5633.618182\n", " 6.0 7260.000000\n", "Santa Clara 1.0 2143.095373\n", " 2.0 2721.721386\n", " 3.0 3451.772947\n", " 4.0 4280.278307\n", " 5.0 5642.350211\n", " 6.0 6704.545455\n", " 7.0 6028.571429\n", " 8.0 2550.000000\n", "Solano 1.0 1143.470514\n", " 2.0 1277.712283\n", " 3.0 1640.565678\n", " 4.0 2043.212766\n", " 5.0 2491.250000\n", " 7.0 3000.000000\n", "Sonoma 1.0 1403.868078\n", " 2.0 1830.113469\n", " 3.0 2284.307937\n", " 4.0 2738.465347\n", " 5.0 3037.500000\n", " 6.0 3295.000000\n", "\n", "[61 rows x 1 columns]" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1.groupby(['county_name', 'bedrooms'])[['rent']].mean()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "That output is a bit too long, since there are rows for many bedroom counts (and few units have > 6 bedrooms!). Let's trim this by looking only at units with less than 4 bedrooms." ] }, { "cell_type": "code", "execution_count": 33, "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", "
rent
county_namebedrooms
Alameda1.01862.396037
2.02284.538409
3.02715.874074
Contra Costa1.01596.991079
2.01874.641106
3.02390.508197
Marin1.02209.910211
2.02998.448575
3.04476.835979
Napa1.01387.362745
2.01846.914110
3.02447.333333
San Francisco1.03099.179065
2.04225.756604
3.05151.170096
San Mateo1.02266.792148
2.02975.375058
3.03888.506952
Santa Clara1.02143.095373
2.02721.721386
3.03451.772947
Solano1.01143.470514
2.01277.712283
3.01640.565678
Sonoma1.01403.868078
2.01830.113469
3.02284.307937
\n", "
" ], "text/plain": [ " rent\n", "county_name bedrooms \n", "Alameda 1.0 1862.396037\n", " 2.0 2284.538409\n", " 3.0 2715.874074\n", "Contra Costa 1.0 1596.991079\n", " 2.0 1874.641106\n", " 3.0 2390.508197\n", "Marin 1.0 2209.910211\n", " 2.0 2998.448575\n", " 3.0 4476.835979\n", "Napa 1.0 1387.362745\n", " 2.0 1846.914110\n", " 3.0 2447.333333\n", "San Francisco 1.0 3099.179065\n", " 2.0 4225.756604\n", " 3.0 5151.170096\n", "San Mateo 1.0 2266.792148\n", " 2.0 2975.375058\n", " 3.0 3888.506952\n", "Santa Clara 1.0 2143.095373\n", " 2.0 2721.721386\n", " 3.0 3451.772947\n", "Solano 1.0 1143.470514\n", " 2.0 1277.712283\n", " 3.0 1640.565678\n", "Sonoma 1.0 1403.868078\n", " 2.0 1830.113469\n", " 3.0 2284.307937" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1[rentals_sf1['bedrooms']<4].groupby(['county_name', 'bedrooms'])[['rent']].mean()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's plot a bar chart of these rents by county and bedroom." ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAFkCAYAAADG0IcVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXnYXVV5vu+HyCQCMkREAgQVtAyKECmKE6BC6wC1YKEq\nOFIEqVqtgrU/bIVqrYpiBYsDBFQQHAqoKIgEcGBIQggGiEQINcgQqQhYQQLv74+1PnJycs75zl7f\nGbOf+7r2dfZZ+332u/ZwzrvXXpMiAmOMMfVkrWFnwBhjzPBwEDDGmBrjIGCMMTXGQcAYY2qMg4Ax\nxtQYBwFjjKkxDgLGGFNjHASMMabGOAgYY0yNecKwMzAZm2++ecycOXPY2TDGmLFi3rx5v42I6ZPZ\njXwQmDlzJnPnzh12NowxZqyQdHs3dn4dZIwxNcZBwBhjaoyDgDHG1JiRrxMwxpip8Mgjj7Bs2TIe\neuihYWelL6y33nrMmDGDtddeu0jvIGCMWaNZtmwZG264ITNnzkTSsLPTUyKCe++9l2XLlrHddtsV\n7cOvg4wxazQPPfQQm2222RoXAAAksdlmm02plOMgYIxZ41kTA8AEUz02BwFjjKkxrhMwpo/MPPZ7\nbbct/firBpgTM0Gna1LCIK7jnDlzWGeddXjhC1/Y8327JGCMMQMkInjssccqaebMmcPPfvazvuTH\nQcAYY/rM0qVLedaznsVhhx3GzjvvzFlnncULXvACdtttNw4++GAefPBBIA2Tc/zxx7Pbbruxyy67\ncPPNN7N06VK+8IUvcNJJJ7Hrrrty5ZVX9jRvXQUBSUsl3SBpgaS5OW1TSZdIu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GWNMjXEQMMaYGuMgYIwxNcZBwBhjaoyDgDHG1Jj/DzpM\nQuN23TRDAAAAAElFTkSuQmCC\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "rentals_sf1[rentals_sf1['bedrooms']<4].groupby(['county_name', 'bedrooms'])[['rent']].mean().plot(kind='bar')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "That bar chart is not ideal. Too small, and it would be nicer to make it separate colors for each number of bedrooms. Notice that we have a hierarchical index (county, then bedrooms within county). We can use unstack on this to make it easier to work with for the bar charts, or even to look at as a table:" ] }, { "cell_type": "code", "execution_count": 35, "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", "
rent
bedrooms1.02.03.0
county_name
Alameda1862.3960372284.5384092715.874074
Contra Costa1596.9910791874.6411062390.508197
Marin2209.9102112998.4485754476.835979
Napa1387.3627451846.9141102447.333333
San Francisco3099.1790654225.7566045151.170096
San Mateo2266.7921482975.3750583888.506952
Santa Clara2143.0953732721.7213863451.772947
Solano1143.4705141277.7122831640.565678
Sonoma1403.8680781830.1134692284.307937
\n", "
" ], "text/plain": [ " rent \n", "bedrooms 1.0 2.0 3.0\n", "county_name \n", "Alameda 1862.396037 2284.538409 2715.874074\n", "Contra Costa 1596.991079 1874.641106 2390.508197\n", "Marin 2209.910211 2998.448575 4476.835979\n", "Napa 1387.362745 1846.914110 2447.333333\n", "San Francisco 3099.179065 4225.756604 5151.170096\n", "San Mateo 2266.792148 2975.375058 3888.506952\n", "Santa Clara 2143.095373 2721.721386 3451.772947\n", "Solano 1143.470514 1277.712283 1640.565678\n", "Sonoma 1403.868078 1830.113469 2284.307937" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1[rentals_sf1['bedrooms']<4].groupby(['county_name', 'bedrooms'])[['rent']].mean().unstack()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can plot a bar chart with the unstacked data, and add a title and set the figure size." ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAz8AAAG/CAYAAAB2emmyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3X/81/O9//Hbo19qipI4aNR8GSlFaQ2ZlkPUiXXMOmwy\nho1zmDkOO9hw2GYYhTln1JZkWCNms7HyK2atWoQaSSgUmfkZK8/vH6/X57N39anPp8/n/fm89X7d\nrpfL+/J5v56vX4/36/OW9/3zfL6e70gpIUmSJEnVrlWlC5AkSZKklmD4kSRJklQIhh9JkiRJhWD4\nkSRJklQIhh9JkiRJhWD4kSRJklQIhh9JUqNFxAURcVOl66gmEbE4Ig5qoXM9EBFfa4lzSdLHgeFH\nUlXKP9T9NSI2q3Qt5ZC/npUR8U5EvB4Rt0fEdmU69scmwETE0RExK3+dr0TEPRGxfwucN0XE/2vu\n8zRVRPwsIj7Mr8/bETE7Ij5X6bokaVNh+JFUdSKiBzAYSMDIZjpHm+Y4bj3+PaXUEfh/QEfg8grU\n0Gwi4lvAVcD3gG2BHYFraabf4Sbsh/n7YAvgOuD2iGhd7pNU6D0uSc3K8COpGh0LPAb8DBhT0xgR\nn4mIV0s/KEbEFyLiifx5q4g4JyKei4gVEXFbRGyVr+uR9w6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/7A0UcfDcBXvvIVZsyYUbvuiCOOoFWrVvTq1Ytly5YBWfi599572Wuv\nvdh7771ZsGABzz777Drna9WqFV/60pcA+PKXv8yMGTN45513ePTRR/niF79Iv379OPnkk3nllVcA\neOSRR/i3f/u32jpKDRw4sHaK6RkzZvCFL3yBzTffnI4dOzJq1Cgefvjh9bYD9OzZkz59+tCqVava\nnqiIoE+fPixevBiA/fbbj29961uMGzeON998kzZtyvvNPH7PjyRJktSCvvnNb7L33nvz1a9+tUHb\nb7bZZrXPU0q1P7/97W9z8sknb9S5I4KPPvqIzp07M3fu3PVuU5fNN998o861ttLX0apVq9rlVq1a\n1d5HdM455zB8+HB+85vfsN9++/G73/2O3XbbrUnnLWXPjySpqvSZ2KdRD0lqKVtttRVHHXUU48eP\nr23bd999ueWWWwCYPHkygwcP3uAxDjnkECZMmMA777wDwNKlS1m+fDkAQ4cOZenSpQB89NFHtfcJ\n3Xzzzey///5sscUW9OzZk1/84hdAFqQef/xxIOt5Ka1jfQYPHszUqVN57733ePfdd7njjjsYPHjw\netsb6rnnnqNPnz6cffbZ7LPPPrX3IpWL4UeSJElqYWeeeeYas75dffXV/PSnP2XPPfdk0qRJjB07\ndoP7H3zwwRx99NG1kxMceeSRvP3223z00UcsXLiQrbbaCsh6a2bOnEnv3r2ZPn063/nOd4As2Iwf\nP56+ffuyxx57cOeddwIwduxYrr32Wvr06VMboOqy9957c9xxxzFw4EA+85nP8LWvfa12CF5d7Q11\n1VVX0bt3b/bcc0/atm3LoYce2uB9GyJqus4+rgYMGJBmzZpV6TIkSZuIxvbizBszr8yVSCqy+fPn\ns/vuu7f4eZ988kkmTJjAj370oxY/d0up69pGxOyU0oD69rXnR5IkSaoSvXv3rurg01SGH0mSJEmF\nYPiRJEmSVAgNCj8RsTgi5kXE3IiYlbdtFRH3RcSz+c8uJdt/OyIWRsRfIuKQkvb++XEWRsS4WN88\nepIkSZJUZhvT8zMkpdSv5Eaic4BpKaVdgGn5MhHRCxgN7AEMA34cEa3z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yzD5DdH7TNNtsA0K5dO0aMGAFA//79ue+++1qw8sw222zDyy+/XPbjNnTCA0mSJEmbiA4d\nOrBy5co12jbffPPa5yklxowZw/e///119m3bti3ZXSrQunXrRt8jtCFdu3blzTffZNWqVbRp04Yl\nS5awww7/mAh65cqVdOjQoeznbcr3/EiSJEn6GOrSpQurV69eJwDVGDp0KFOmTGH58mzOsjfeeIMX\nXnhhg8fs1KkTb7/9du3yNddcwzXXXNOo+iKCIUOGMGXKFAAmTpxYe38SwDPPPEPv3uUfMGbPjyRJ\nktTMGjI1dbkdfPDBzJgxg4MOOmiddb169eLiiy/m4IMP5qOPPqJt27Zce+217LTTTus93ujRoznx\nxBMZN24cU6ZMYcGCBey3337rbPfqq68yYMAA3nrrLVq1asVVV13F008/zRZbbMFhhx3GDTfcwPbb\nb8+ll17K6NGjOe+889hrr7044YQTao9x//3319kr1VSRUtm+nqdZDBgwIM2aNavSZUiSNhF9JvZp\n1H7zxswrcyWSimz+/PnsvvvuFa1hzpw5XHnllUyaNKlZjj9ixAhuv/122rVrV9bjLlu2jKOPPppp\n06bVub6uaxsRs1NKA+o7tj0/kiRJUhXae++9GTJkCKtXry7Ll5yurTmmogZ48cUXueKKK5rl2IYf\nSZIkqUodf/zxlS5ho9XMQNccnPBAkiRJUiEYfiRJkiQVguFHkiRJUiEYfiRJkiQVghMeSJIkSc3t\ngi3LfLy/1bvJ+++/z7Bhw5g+fXpZZnubOnUqu+66K7169drgdpMnT+bSSy8lpUSnTp247rrr6Nu3\n7zrbPf/884wePZoVK1bQv39/Jk2aRLt27bj77ruZOXMmF110UZNrXps9P5IkSVIVmjBhAqNGjVon\n+KxatapRx5s6dSpPP/10vdv17NmTBx98kHnz5nH++edz0kkn1bnd2WefzRlnnMHChQvp0qUL48eP\nB2D48OH86le/4r333mtUnRti+JEkSZKq0OTJkzn88MMBeOCBBxg8eDAjR46s7bm56aabGDhwIP36\n9ePkk09m9erVAHTs2JFzzz2Xvn37MmjQIJYtW8ajjz7KXXfdxVlnnUW/fv147rnn1nvefffdly5d\nugAwaNAglixZss42KSWmT5/OkUceCcCYMWOYOnUqABHBgQce2CzfI2T4kSRJkqrMhx9+yKJFi+jR\no0dt25w5cxg7dizPPPMM8+fP59Zbb+WRRx5h7ty5tG7dmsmTJwPw7rvvMmjQIB5//HEOOOAArr/+\nevbdd19GjhzJZZddxty5c9l5550bVMf48eM59NBD12lfsWIFnTt3pk2b7C6c7t27s3Tp0tr1AwYM\n4OGHH27CFaib9/xIkiRJVeb111+nc+fOa7QNHDiQnj17AjBt2jRmz55d+4Wi77//Pttssw0A7dq1\nY8SIEQD079+f++67r1E13H///YwfP54ZM2Zs9L7bbLMNL7/8cqPOuyGGH0mSJKnKdOjQgZUrV67R\ntvnmm9c+TykxZswYvv/976+zb9u2bYkIAFq3bt2oe4SeeOIJvva1r3HPPffQtWvXddZ37dqVN998\nk1WrVtGmTRuWLFnCDjvsULt+5cqVdOjQYaPPWx+HvUmSJElVpkuXLqxevXqdAFRj6NChTJkyheXL\nlwPwxhtv8MILL2zwmJ06deLtt9+uXb7mmmu45ppr1tnuxRdfZNSoUUyaNIldd921zmNFBEOGDGHK\nlCkATJw4sfb+JIBnnnmG3r17b/hFNoI9P5IkSVJza8DU1OV28MEHM2PGDA466KB11vXq1YuLL76Y\ngw8+mI8++oi2bdty7bXXstNOO633eKNHj+bEE09k3LhxTJkyhQULFrDffvuts91FF13EihUrOOWU\nUwBo06YNs2bNAuCwww7jhhtuYPvtt+fSSy9l9OjRnHfeeey1116ccMIJtce4//776+yVaqpIKZX9\noOU0YMCAVHOxJEmqT5+JfRq137wx88pciaQimz9/PrvvvntFa5gzZw5XXnklkyZNapbjjxgxgttv\nv5127dqV9bjLli3j6KOPZtq0aXWur+vaRsTslNKA+o5tz48kSZJUhfbee2+GDBnC6tWry/Ilp2tr\njqmoIRs2d8UVVzTLsQ0/kiRJUpU6/vjjK13CRquZga45OOGBJEmSpEIw/EiSJEkqBMOPJEmSpEIw\n/EiSJEkqBCc8kCRJkppZY6fhX5+GTM///vvvM2zYMKZPn16W2d6mTp3KrrvuSq9evTa43Z133sn5\n559Pq1ataNOmDVdddRX777//Ots9//zzjB49mhUrVtC/f38mTZpEu3btuPvuu5k5cyYXXXRRk2te\nm+FH0nr5fSmSJG26JkyYwKhRo9YJPqtWraJNm42PAVOnTmXEiBH1hp+hQ4cycuRIIoInnniCo446\nigULFqyz3dlnn80ZZ5zB6NGj+frXv8748eP5xje+wfDhwzn//PM555xz+MQnPrHRdW6Iw94kSZKk\nKjR58mQOP/xwAB544AEGDx7MyJEja8PLTTfdxMCBA+nXrx8nn3wyq1evBqBjx46ce+659O3bl0GD\nBrFs2TIeffRR7rrrLs466yz69evHc889t97zduzYkYgA4N133619XiqlxPTp0znyyCMBGDNmDFOn\nTgUgIjjwwAOb5XuEDD+SJElSlfnwww9ZtGgRPXr0qG2bM2cOY8eO5ZlnnmH+/PnceuutPPLII8yd\nO5fWrVszefJkIAssgwYN4vHHH+eAAw7g+uuvZ99992XkyJFcdtllzJ07l5133nmD57/jjjvYbbfd\nGD58OBMmTFhn/YoVK+jcuXNtD1T37t1ZunRp7foBAwbw8MMPl+FKrMnwI0mSJFWZ119/nc6dO6/R\nNnDgQHr27AnAtGnTmD17Nvvssw/9+vVj2rRpLFq0CIB27doxYsQIAPr378/ixYs3+vxf+MIXWLBg\nAVOnTuX888/f6P232WYbXn755Y3erz7e8yNJkiRVmQ4dOrBy5co12jbffPPa5yklxowZw/e///11\n9m3btm3tULXWrVuzatWqRtdxwAEHsGjRIl5//XW23nrr2vauXbvy5ptv1t5/tGTJEnbYYYfa9StX\nrqRDhw6NPu/62PMjSZIkVZkuXbqwevXqdQJQjaFDhzJlyhSWL18OwBtvvMELL7ywwWN26tSJt99+\nu3b5mmuu4Zprrllnu4ULF5JSArKhdh988AFdu3ZdY5uIYMiQIUyZMgWAiRMn1t6fBPDMM8/Qu3fv\nBrzSjWPPjyRJktTMKjET6sEHH8yMGTM46KCD1lnXq1cvLr74Yg4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FnSLc3YXEnbNr/vcklH9x33avP1w5JulXSd\npAclfUfFF4CtgXmS5kn6c0nf7Dv+M5LOWUWmyZIWSbpE0v2S5kjauO+4nzV5Z/VWlpp8F0m6Q9Kj\nTa5Lm/e5vO+9/1DSTyXNl3StpEmj8NcaERFjIJOfiIhYa5J2Bb4KHGJ7D+CvgPOBK2zvDnwHOG8t\n3mov4FRgF2B7YKrt84CngINtHwx8F/hjSes3x5wEXLqa99wJuND2rsCLwLRm/Hrb+zV5FwEn9x3z\nbuBA4DTgRuAcYFdgN0l7Stqi+X4Ps703cDdw+lp8fxER0ULZ5yciItbFIcC1vbI0289LOhA4qnn9\nKuCstXifu2z/EkDSAmAy8J/9v8H2q5JuAT4maRGwvu17V/Oej9le0Dy+p3lPgPdL+kdgc2AS8MO+\nY75n25LuBX7de39J9zfHv48yQfuJJIANgJ+uxfcXEREtlMlPRESMlrdpKgwkTaBMHHre6Hu8lFV/\nHn0b+DvgQeCyNfx5K77nxs3jy4GP214o6c+AD6/kmHdWOP6dJtNS4Ee2j1vDnx0REQMgZW8REbEu\nbgGOkfReAEnvAf4L+GTz+gnA7c3jx4F9msdHAuuzZq8Am/ae2L4T2AY4Hpg5xMybAk835XMnrOOx\ndwBTJe0IIGmTZpPViIgYQFn5iYiItWb7fklfB26TtBT4OXAKcJmkLwLPUu7NAbgE+A9JC4HZwJK1\n+CNmALMlPdXc9wPl3p89bb8wxNhfA+5sst1J3+RqTWw/26wWzZS0YTP8VeChIWaJiIiK0uo6IiJa\nTdJNwDm259bOEhERgy1lbxER0UqSNpf0EPB6Jj4RETESsvITEREDo7nXaGUToUNtPzfWeSIiYrBk\n8hMREREREeNCyt4iIiIiImJcyOQnIiIiIiLGhUx+IiIiIiJiXMjkJyIiIiIixoVMfiIiIiIiYlzI\n5CciIiIiIsaF/wOni26xOL2slQAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "rentals_sf1[rentals_sf1['bedrooms']<4].groupby(['county_name', 'bedrooms'])[['rent']].mean().unstack().plot(kind='bar', figsize=(14,6), title='Average Rents by County and Bedrooms')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Pandas also provides a syntax for doing this that is familiar for spreadsheet users: the pivot_table. You can see below that using pivot_table achieves exactly the same result. " ] }, { "cell_type": "code", "execution_count": 37, "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", "
bedrooms1.02.03.0
county_name
Alameda1862.3960372284.5384092715.874074
Contra Costa1596.9910791874.6411062390.508197
Marin2209.9102112998.4485754476.835979
Napa1387.3627451846.9141102447.333333
San Francisco3099.1790654225.7566045151.170096
San Mateo2266.7921482975.3750583888.506952
Santa Clara2143.0953732721.7213863451.772947
Solano1143.4705141277.7122831640.565678
Sonoma1403.8680781830.1134692284.307937
\n", "
" ], "text/plain": [ "bedrooms 1.0 2.0 3.0\n", "county_name \n", "Alameda 1862.396037 2284.538409 2715.874074\n", "Contra Costa 1596.991079 1874.641106 2390.508197\n", "Marin 2209.910211 2998.448575 4476.835979\n", "Napa 1387.362745 1846.914110 2447.333333\n", "San Francisco 3099.179065 4225.756604 5151.170096\n", "San Mateo 2266.792148 2975.375058 3888.506952\n", "Santa Clara 2143.095373 2721.721386 3451.772947\n", "Solano 1143.470514 1277.712283 1640.565678\n", "Sonoma 1403.868078 1830.113469 2284.307937" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.pivot_table(rentals_sf1[rentals_sf1['bedrooms']<4], values='rent', index=['county_name'], columns=['bedrooms'])" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAz8AAAG/CAYAAAB2emmyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xu8VXWd//HXBzTxiqKkBCgYVoKIeaU0zczxUqOljVkW\nmFajXczq5/xsqkmd7NfYNKMZaTalYJralOmkeBnLzFIUSMNLhikKhKkkad4C/Pz+WOvgBg+cwzl7\nn8XZ6/V8PPbj7PXda+392etsDuu9v9/1XZGZSJIkSVK7G1B1AZIkSZLUFww/kiRJkmrB8CNJkiSp\nFgw/kiRJkmrB8CNJkiSpFgw/kiRJkmrB8CNJ6rGIOC0ivl91He0kIuZFxNv76LVujogP98VrSdK6\nwPAjqS2VB3VPRcQGVdfSDOX7eSEi/hoRT0bEjyNiWJOee50JMBHx/oiYWb7PRRExPSL26YPXzYgY\n0+rX6a2IuCgi/lbun2ciYlZE7Fd1XZLUXxh+JLWdiBgFvAVI4LAWvcZ6rXjeLnwiMzcBxgCbAP9e\nQQ0tExGfAc4GvgJsDWwLTKFFv8N+7Kzyc7AZcB7w44gY2OwXqegzLkktZfiR1I4mAbcDFwGTOxoj\nYq+IeKzxQDEi3h0Rvy3vD4iIUyPiDxGxOCKuiIgh5WOjyt6B4yPiUeBnZfsPy+f8S0TcEhHjGp57\ny4j4n4h4OiLujIgvR8StDY+/ISJujIg/R8QDEXFUd95cZi4BfgLs0vBc3al9ckQ8WvYcfb587GDg\nn4H3lr0Jd5ftx0bEQ2XvwsMRccwaShoUEZeX686OiAnlc5wSET9qXDEivhER56z6BBExGDgD+Hhm\n/jgzn83MpZn508z8p3KdDSLi7Ij4Y3k7u6Nnr6z31lWec0VvTtljMiUir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36PtDT+SJElSG1iwYAGbbropo0aNIiKqLqfpMpPFixezYMECRo8e3aPncNibJEmS1AZe\neOEFttxyy7YMPgARwZZbbtmrni3DjyRJktQm2jX4dOjt+zP8SJIkSW1q3rx57LTTTn2+7brK8CNJ\nkiSp25YtW1Z1CT1m+JEkSZLa2LJlyzjmmGPYcccdec973sNzzz3HrFmz2G+//dhtt9046KCDWLRo\nEQCzZs1iwoQJTJgwgSlTpqx4josuuojDDjuMt73tbRxwwAFkJqeccgo77bQT48eP5/LLLwdYbfvN\nN9/Mfvvtx+GHH87222/PqaeeyiWXXMKee+7J+PHj+cMf/gDAD3/4Q3baaScmTJjAvvvu2/R94Wxv\nkiRJUht74IEH+O53v8vee+/Ncccdx5QpU7jyyiu56qqrGDp0KJdffjmf//zn+d73vseHPvQhvvnN\nb7LvvvtyyimnrPQ8s2fP5re//S1DhgzhRz/6EXfddRd33303Tz75JHvssQf77rsvv/71rzttB7j7\n7ru5//77GTJkCNtvvz0f/vCHueOOOzjnnHM499xzOfvssznjjDO4/vrrGT58OEuWLGn6vrDnR5Ik\nSWpjI0eOZO+99wbgAx/4ANdffz333HMPBx54ILvssgtf/vKXWbBgAUuWLGHJkiUrwsoHP/jBlZ7n\nwAMPZMiQIQDceuutvO9972PgwIFsvfXW7Lffftx5552rbQfYY489GDZsGBtssAGvfe1r+bu/+zsA\nxo8fz7x58wDYe++9OfbYY/nOd77D8uXLm74v7PmRJEmS2tiqM6RtuummjBs3jttuu22l9q56Wjbe\neONe1bHBBhusuD9gwIAVywMGDFhxHtH555/PjBkzuOaaa9htt92YNWsWW265Za9et5HhR5LUVsZP\nHd+j7eZMntPkSiRp3fDoo49y22238aY3vYlLL72UiRMn8p3vfGdF29KlS/n973/PuHHj2Hzzzbn1\n1lvZZ599uOSSS1b7nG95y1v49re/zeTJk/nzn//MLbfcwte+9jWWLVvWafvvfve7btX6hz/8gb32\n2ou99tqL6dOnM3/+fMOPJEmSpO55/etfz5QpUzjuuOMYO3Ysn/zkJ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49XfiRJU5JkVZJfJxlLck+SeUk2NWOPJDmn+b21Sa4amPdc\n8/PiJI8muT/J3iT3puezwNnA5iSbk3wyyS0D869LsuYYmeYl2ZPkjiS7k2xMMmtg3i+avOv7V5aa\nfN9K8kSS3za57mzOs3bg3O9L8niSHUnuSzL7JfhnlSRNA4sfSdKkJVkI3AysqKrzgc8B3wTurqq3\nAvcCt07iVG8DbgDeDJwLLKuqW4GngeVVtRz4PvChJDObOZ8A7jzOOd8I3FZVC4G/Alc24w9U1ZIm\n7x7gUwNzXgksBW4EfgisARYCb0myKMlrmvd7SVVdADwJfH4S70+S1EE+50eSNBUrgPv6y9Kq6lCS\npcAVzfF7gK9P4jzbq+qPAEl2AvOAnw3+QlU9l2QT8MEke4CZVbXrOOf8XVXtbLZ/2ZwT4LwkXwXm\nALOBhwfm/KiqKsku4M/98yfZ3cx/Hb0C7bEkAKcDj0/i/UmSOsjiR5L0UvkvzQqDJKfRKxz6/jWw\nfYRjfx59B/gCsBe4a4LXG3/OWc32WuCyqhpL8nHg4qPMeWHc/BeaTEeAn1TVRyd4bUnSEHDZmyRp\nKjYBVyd5NUCSVwE/Bz7SHL8W2Nps7wPe3mxfCsxkYv8AzurvVNU24PXAx4B1J5j5LOCZZvnctVOc\n+wSwLMl8gCSvaB6yKkkaQl75kSRNWlXtTvI1YEuSI8CvgOuBu5LcBOynd28OwB3AD5KMARuAw5N4\niduBDUmebu77gd69P4uq6tkTjP0lYFuTbRsDxdVEqmp/c7VoXZIzmuGbgadOMIskqUW2upYkdVqS\nh4A1VfVI21kkScPNZW+SpE5KMifJU8DzFj6SpJPBKz+SpKHR3Gt0tEJoZVUdnO48kqThYvEjSZIk\naSS47E2SJEnSSLD4kSRJkjQSLH4kSZIkjQSLH0mSJEkjweJHkiRJ0kiw+JEkSZI0Ev4Hkqoo0rhu\nEswAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "pd.pivot_table(rentals_sf1[rentals_sf1['bedrooms']<4], values='rent', index=['county_name'], columns=['bedrooms']).plot(kind='bar', figsize=(14,6), title='Average Rents by County and Bedrooms')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In addition to providing a convenience interface to groupby, pivot_table also can add partial totals, or margins." ] }, { "cell_type": "code", "execution_count": 39, "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", "
bedrooms1.02.03.0All
county_name
Alameda1862.3960372284.5384092715.8740742161.681932
Contra Costa1596.9910791874.6411062390.5081971856.947814
Marin2209.9102112998.4485754476.8359793061.734740
Napa1387.3627451846.9141102447.3333331999.539130
San Francisco3099.1790654225.7566045151.1700963861.692972
San Mateo2266.7921482975.3750583888.5069522801.402538
Santa Clara2143.0953732721.7213863451.7729472590.512772
Solano1143.4705141277.7122831640.5656781300.941814
Sonoma1403.8680781830.1134692284.3079371775.032962
All2083.1732712547.4551543271.3945622472.355483
\n", "
" ], "text/plain": [ "bedrooms 1.0 2.0 3.0 All\n", "county_name \n", "Alameda 1862.396037 2284.538409 2715.874074 2161.681932\n", "Contra Costa 1596.991079 1874.641106 2390.508197 1856.947814\n", "Marin 2209.910211 2998.448575 4476.835979 3061.734740\n", "Napa 1387.362745 1846.914110 2447.333333 1999.539130\n", "San Francisco 3099.179065 4225.756604 5151.170096 3861.692972\n", "San Mateo 2266.792148 2975.375058 3888.506952 2801.402538\n", "Santa Clara 2143.095373 2721.721386 3451.772947 2590.512772\n", "Solano 1143.470514 1277.712283 1640.565678 1300.941814\n", "Sonoma 1403.868078 1830.113469 2284.307937 1775.032962\n", "All 2083.173271 2547.455154 3271.394562 2472.355483" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.pivot_table(rentals_sf1[rentals_sf1['bedrooms']<4], values='rent', index=['county_name'], columns=['bedrooms'], margins=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Although mean is the default type of aggregation in pivot_table, you can use other methods like len, to get a frequency crosstab with the count of observations in each cell of the table, as well as the margins. Let's remove the filter on number of bedrooms to see the full frequency distribution." ] }, { "cell_type": "code", "execution_count": 40, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
bedrooms1.02.03.04.05.06.07.08.0All
county_name
Alameda4290.04361.01350.0467.0211.028.04.01.010712.0
Contra Costa2242.03508.0976.0629.0177.033.04.01.07570.0
Marin568.0807.0378.0176.015.02.0NaNNaN1946.0
Napa102.0163.0195.064.05.0NaNNaNNaN529.0
San Francisco2245.02120.0729.0207.015.04.01.01.05322.0
San Mateo2598.02141.0935.0199.055.05.0NaNNaN5933.0
Santa Clara7413.08973.02484.0945.0237.011.07.01.020071.0
Solano797.01498.0472.0188.032.0NaN10.0NaN2997.0
Sonoma614.01225.0315.0101.04.01.0NaNNaN2260.0
All20869.024796.07834.02976.0751.084.026.04.057340.0
\n", "
" ], "text/plain": [ "bedrooms 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 \\\n", "county_name \n", "Alameda 4290.0 4361.0 1350.0 467.0 211.0 28.0 4.0 1.0 \n", "Contra Costa 2242.0 3508.0 976.0 629.0 177.0 33.0 4.0 1.0 \n", "Marin 568.0 807.0 378.0 176.0 15.0 2.0 NaN NaN \n", "Napa 102.0 163.0 195.0 64.0 5.0 NaN NaN NaN \n", "San Francisco 2245.0 2120.0 729.0 207.0 15.0 4.0 1.0 1.0 \n", "San Mateo 2598.0 2141.0 935.0 199.0 55.0 5.0 NaN NaN \n", "Santa Clara 7413.0 8973.0 2484.0 945.0 237.0 11.0 7.0 1.0 \n", "Solano 797.0 1498.0 472.0 188.0 32.0 NaN 10.0 NaN \n", "Sonoma 614.0 1225.0 315.0 101.0 4.0 1.0 NaN NaN \n", "All 20869.0 24796.0 7834.0 2976.0 751.0 84.0 26.0 4.0 \n", "\n", "bedrooms All \n", "county_name \n", "Alameda 10712.0 \n", "Contra Costa 7570.0 \n", "Marin 1946.0 \n", "Napa 529.0 \n", "San Francisco 5322.0 \n", "San Mateo 5933.0 \n", "Santa Clara 20071.0 \n", "Solano 2997.0 \n", "Sonoma 2260.0 \n", "All 57340.0 " ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.pivot_table(rentals_sf1, values='rent', index=['county_name'], columns=['bedrooms'], aggfunc=len, margins=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A simpler way to generate a crosstabulation is also built in to pandas: the crosstab method." ] }, { "cell_type": "code", "execution_count": 41, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
bedrooms1.02.03.04.05.06.07.08.0All
county_name
Alameda429043611350467211284110712
Contra Costa2242350897662917733417570
Marin568807378176152001946
Napa102163195645000529
San Francisco22452120729207154115322
San Mateo25982141935199555005933
Santa Clara741389732484945237117120071
Solano79714984721883201002997
Sonoma614122531510141002260
All2086924796783429767518426457340
\n", "
" ], "text/plain": [ "bedrooms 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 All\n", "county_name \n", "Alameda 4290 4361 1350 467 211 28 4 1 10712\n", "Contra Costa 2242 3508 976 629 177 33 4 1 7570\n", "Marin 568 807 378 176 15 2 0 0 1946\n", "Napa 102 163 195 64 5 0 0 0 529\n", "San Francisco 2245 2120 729 207 15 4 1 1 5322\n", "San Mateo 2598 2141 935 199 55 5 0 0 5933\n", "Santa Clara 7413 8973 2484 945 237 11 7 1 20071\n", "Solano 797 1498 472 188 32 0 10 0 2997\n", "Sonoma 614 1225 315 101 4 1 0 0 2260\n", "All 20869 24796 7834 2976 751 84 26 4 57340" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.crosstab(rentals_sf1['county_name'], rentals_sf1['bedrooms'], margins=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Besides the simpler syntax, the other advantage of crosstab for doing this is that you can normalize the crosstab, dividing all the cell values by the grand total. This tells us the fraction of the region's total listings that are in each combination of county and number of bedrooms." ] }, { "cell_type": "code", "execution_count": 42, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
bedrooms1.02.03.04.05.06.07.08.0All
county_name
Alameda0.0748170.0760550.0235440.0081440.0036800.0004880.0000700.0000170.186815
Contra Costa0.0391000.0611790.0170210.0109700.0030870.0005760.0000700.0000170.132020
Marin0.0099060.0140740.0065920.0030690.0002620.0000350.0000000.0000000.033938
Napa0.0017790.0028430.0034010.0011160.0000870.0000000.0000000.0000000.009226
San Francisco0.0391520.0369720.0127140.0036100.0002620.0000700.0000170.0000170.092815
San Mateo0.0453090.0373390.0163060.0034710.0009590.0000870.0000000.0000000.103471
Santa Clara0.1292810.1564880.0433210.0164810.0041330.0001920.0001220.0000170.350035
Solano0.0139000.0261250.0082320.0032790.0005580.0000000.0001740.0000000.052267
Sonoma0.0107080.0213640.0054940.0017610.0000700.0000170.0000000.0000000.039414
All0.3639520.4324380.1366240.0519010.0130970.0014650.0004530.0000701.000000
\n", "
" ], "text/plain": [ "bedrooms 1.0 2.0 3.0 4.0 5.0 6.0 \\\n", "county_name \n", "Alameda 0.074817 0.076055 0.023544 0.008144 0.003680 0.000488 \n", "Contra Costa 0.039100 0.061179 0.017021 0.010970 0.003087 0.000576 \n", "Marin 0.009906 0.014074 0.006592 0.003069 0.000262 0.000035 \n", "Napa 0.001779 0.002843 0.003401 0.001116 0.000087 0.000000 \n", "San Francisco 0.039152 0.036972 0.012714 0.003610 0.000262 0.000070 \n", "San Mateo 0.045309 0.037339 0.016306 0.003471 0.000959 0.000087 \n", "Santa Clara 0.129281 0.156488 0.043321 0.016481 0.004133 0.000192 \n", "Solano 0.013900 0.026125 0.008232 0.003279 0.000558 0.000000 \n", "Sonoma 0.010708 0.021364 0.005494 0.001761 0.000070 0.000017 \n", "All 0.363952 0.432438 0.136624 0.051901 0.013097 0.001465 \n", "\n", "bedrooms 7.0 8.0 All \n", "county_name \n", "Alameda 0.000070 0.000017 0.186815 \n", "Contra Costa 0.000070 0.000017 0.132020 \n", "Marin 0.000000 0.000000 0.033938 \n", "Napa 0.000000 0.000000 0.009226 \n", "San Francisco 0.000017 0.000017 0.092815 \n", "San Mateo 0.000000 0.000000 0.103471 \n", "Santa Clara 0.000122 0.000017 0.350035 \n", "Solano 0.000174 0.000000 0.052267 \n", "Sonoma 0.000000 0.000000 0.039414 \n", "All 0.000453 0.000070 1.000000 " ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.crosstab(rentals_sf1['county_name'], rentals_sf1['bedrooms'], margins=True, normalize=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We have the option to normalize on the index, which is the county_name in this case, so we see the fraction of the county listings that are of each number of bedrooms. The rows sum to 1." ] }, { "cell_type": "code", "execution_count": 43, "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", "
bedrooms1.02.03.04.05.06.07.08.0
county_name
Alameda0.4004850.4071140.1260270.0435960.0196980.0026140.0003730.000093
Contra Costa0.2961690.4634080.1289300.0830910.0233820.0043590.0005280.000132
Marin0.2918810.4146970.1942450.0904420.0077080.0010280.0000000.000000
Napa0.1928170.3081290.3686200.1209830.0094520.0000000.0000000.000000
San Francisco0.4218340.3983460.1369790.0388950.0028180.0007520.0001880.000188
San Mateo0.4378900.3608630.1575930.0335410.0092700.0008430.0000000.000000
Santa Clara0.3693390.4470630.1237610.0470830.0118080.0005480.0003490.000050
Solano0.2659330.4998330.1574910.0627290.0106770.0000000.0033370.000000
Sonoma0.2716810.5420350.1393810.0446900.0017700.0004420.0000000.000000
All0.3639520.4324380.1366240.0519010.0130970.0014650.0004530.000070
\n", "
" ], "text/plain": [ "bedrooms 1.0 2.0 3.0 4.0 5.0 6.0 \\\n", "county_name \n", "Alameda 0.400485 0.407114 0.126027 0.043596 0.019698 0.002614 \n", "Contra Costa 0.296169 0.463408 0.128930 0.083091 0.023382 0.004359 \n", "Marin 0.291881 0.414697 0.194245 0.090442 0.007708 0.001028 \n", "Napa 0.192817 0.308129 0.368620 0.120983 0.009452 0.000000 \n", "San Francisco 0.421834 0.398346 0.136979 0.038895 0.002818 0.000752 \n", "San Mateo 0.437890 0.360863 0.157593 0.033541 0.009270 0.000843 \n", "Santa Clara 0.369339 0.447063 0.123761 0.047083 0.011808 0.000548 \n", "Solano 0.265933 0.499833 0.157491 0.062729 0.010677 0.000000 \n", "Sonoma 0.271681 0.542035 0.139381 0.044690 0.001770 0.000442 \n", "All 0.363952 0.432438 0.136624 0.051901 0.013097 0.001465 \n", "\n", "bedrooms 7.0 8.0 \n", "county_name \n", "Alameda 0.000373 0.000093 \n", "Contra Costa 0.000528 0.000132 \n", "Marin 0.000000 0.000000 \n", "Napa 0.000000 0.000000 \n", "San Francisco 0.000188 0.000188 \n", "San Mateo 0.000000 0.000000 \n", "Santa Clara 0.000349 0.000050 \n", "Solano 0.003337 0.000000 \n", "Sonoma 0.000000 0.000000 \n", "All 0.000453 0.000070 " ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.crosstab(rentals_sf1['county_name'], rentals_sf1['bedrooms'], margins=True, normalize='index')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The counterpart is to normalize by column, in which case we see the fraction of 1 bedroom listings in the region that are in each county, and so on for different bedroom counts.\n" ] }, { "cell_type": "code", "execution_count": 44, "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", "
bedrooms1.02.03.04.05.06.07.08.0All
county_name
Alameda0.2055680.1758750.1723260.1569220.2809590.3333330.1538460.250.186815
Contra Costa0.1074320.1414740.1245850.2113580.2356860.3928570.1538460.250.132020
Marin0.0272170.0325460.0482510.0591400.0199730.0238100.0000000.000.033938
Napa0.0048880.0065740.0248910.0215050.0066580.0000000.0000000.000.009226
San Francisco0.1075760.0854980.0930560.0695560.0199730.0476190.0384620.250.092815
San Mateo0.1244910.0863450.1193520.0668680.0732360.0595240.0000000.000.103471
Santa Clara0.3552160.3618730.3170790.3175400.3155790.1309520.2692310.250.350035
Solano0.0381910.0604130.0602500.0631720.0426100.0000000.3846150.000.052267
Sonoma0.0294220.0494030.0402090.0339380.0053260.0119050.0000000.000.039414
\n", "
" ], "text/plain": [ "bedrooms 1.0 2.0 3.0 4.0 5.0 6.0 \\\n", "county_name \n", "Alameda 0.205568 0.175875 0.172326 0.156922 0.280959 0.333333 \n", "Contra Costa 0.107432 0.141474 0.124585 0.211358 0.235686 0.392857 \n", "Marin 0.027217 0.032546 0.048251 0.059140 0.019973 0.023810 \n", "Napa 0.004888 0.006574 0.024891 0.021505 0.006658 0.000000 \n", "San Francisco 0.107576 0.085498 0.093056 0.069556 0.019973 0.047619 \n", "San Mateo 0.124491 0.086345 0.119352 0.066868 0.073236 0.059524 \n", "Santa Clara 0.355216 0.361873 0.317079 0.317540 0.315579 0.130952 \n", "Solano 0.038191 0.060413 0.060250 0.063172 0.042610 0.000000 \n", "Sonoma 0.029422 0.049403 0.040209 0.033938 0.005326 0.011905 \n", "\n", "bedrooms 7.0 8.0 All \n", "county_name \n", "Alameda 0.153846 0.25 0.186815 \n", "Contra Costa 0.153846 0.25 0.132020 \n", "Marin 0.000000 0.00 0.033938 \n", "Napa 0.000000 0.00 0.009226 \n", "San Francisco 0.038462 0.25 0.092815 \n", "San Mateo 0.000000 0.00 0.103471 \n", "Santa Clara 0.269231 0.25 0.350035 \n", "Solano 0.384615 0.00 0.052267 \n", "Sonoma 0.000000 0.00 0.039414 " ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.crosstab(rentals_sf1['county_name'], rentals_sf1['bedrooms'], margins=True, normalize='columns')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What if we want to look at more statistics than just mean? We can combine several aggregation methods and compute them at one time." ] }, { "cell_type": "code", "execution_count": 45, "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", " \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", "
rent
meanstdminmax
county_namebedrooms
Alameda1.01862.396037393.300923500.04950.0
2.02284.538409534.999766800.04998.0
3.02715.874074806.606556350.07500.0
Contra Costa1.01596.991079375.069796496.03125.0
2.01874.641106505.719679689.03895.0
3.02390.508197775.568225793.05995.0
Marin1.02209.910211618.305211430.05600.0
2.02998.448575950.4487931325.09500.0
3.04476.8359791423.7684481657.09000.0
Napa1.01387.362745224.556583750.01800.0
2.01846.914110500.127260850.04050.0
3.02447.333333997.8973081250.09775.0
San Francisco1.03099.179065720.636564725.07500.0
2.04225.7566041284.521670750.09800.0
3.05151.1700961738.3742261600.010250.0
San Mateo1.02266.792148411.746679880.05000.0
2.02975.375058612.783070832.06500.0
3.03888.5069521192.5321211800.010000.0
Santa Clara1.02143.095373451.835127550.05202.0
2.02721.721386664.622785900.09065.0
3.03451.7729471013.365050650.09999.0
Solano1.01143.470514214.261987590.01849.0
2.01277.712283238.327602799.02300.0
3.01640.565678408.047945950.04500.0
Sonoma1.01403.868078280.041020550.03200.0
2.01830.113469363.751789995.04500.0
3.02284.307937545.0818411200.05000.0
\n", "
" ], "text/plain": [ " rent \n", " mean std min max\n", "county_name bedrooms \n", "Alameda 1.0 1862.396037 393.300923 500.0 4950.0\n", " 2.0 2284.538409 534.999766 800.0 4998.0\n", " 3.0 2715.874074 806.606556 350.0 7500.0\n", "Contra Costa 1.0 1596.991079 375.069796 496.0 3125.0\n", " 2.0 1874.641106 505.719679 689.0 3895.0\n", " 3.0 2390.508197 775.568225 793.0 5995.0\n", "Marin 1.0 2209.910211 618.305211 430.0 5600.0\n", " 2.0 2998.448575 950.448793 1325.0 9500.0\n", " 3.0 4476.835979 1423.768448 1657.0 9000.0\n", "Napa 1.0 1387.362745 224.556583 750.0 1800.0\n", " 2.0 1846.914110 500.127260 850.0 4050.0\n", " 3.0 2447.333333 997.897308 1250.0 9775.0\n", "San Francisco 1.0 3099.179065 720.636564 725.0 7500.0\n", " 2.0 4225.756604 1284.521670 750.0 9800.0\n", " 3.0 5151.170096 1738.374226 1600.0 10250.0\n", "San Mateo 1.0 2266.792148 411.746679 880.0 5000.0\n", " 2.0 2975.375058 612.783070 832.0 6500.0\n", " 3.0 3888.506952 1192.532121 1800.0 10000.0\n", "Santa Clara 1.0 2143.095373 451.835127 550.0 5202.0\n", " 2.0 2721.721386 664.622785 900.0 9065.0\n", " 3.0 3451.772947 1013.365050 650.0 9999.0\n", "Solano 1.0 1143.470514 214.261987 590.0 1849.0\n", " 2.0 1277.712283 238.327602 799.0 2300.0\n", " 3.0 1640.565678 408.047945 950.0 4500.0\n", "Sonoma 1.0 1403.868078 280.041020 550.0 3200.0\n", " 2.0 1830.113469 363.751789 995.0 4500.0\n", " 3.0 2284.307937 545.081841 1200.0 5000.0" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1[rentals_sf1['bedrooms']<4].groupby(['county_name', 'bedrooms'])[['rent']].agg(['mean', 'std', 'min', 'max'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Remember the 'top' function we defined earlier? We can use it here to get the top rental listing in each county, for each bedroom size." ] }, { "cell_type": "code", "execution_count": 46, "metadata": { "scrolled": false }, "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", " \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", " \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", " \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", " \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", " \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", " \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", " \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", " \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", " \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", " \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", " \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", "
rentbedroomssqftlongitudelatitudefips_blocklogrecnoblockfipsstatecounty...H0050007H0050008pct_rentpct_blackpct_asianpct_whitepct_hisppct_vacantpop_sqmitotal_hh
county_namebedrooms
Alameda1.0294834950.01.0800.0-122.28040037.8365000600142510410071851906001425104100706001...0066.66666757.14285714.28571428.5714290.0000000.0000001965.0895306
2.0368894998.02.01400.0-122.26429237.879443060014216004005209406001421600400506001...0162.2641510.00000015.84158476.2376248.91089114.51612913043.56958453
3.0585447500.03.02500.0-122.22693437.8307340600142610010002536506001426100100006001...0010.0000001.29870123.37662374.0259741.2987016.2500002159.25807730
4.0434488200.04.03247.0-122.22940037.8288170600142610010062537106001426100100606001...016.0000001.35135129.05405458.7837846.0810815.66037710261.22240150
5.0221347800.05.01856.0-122.26672337.863312060014235001001319206001423500100106001...00NaN0.0000000.000000100.0000000.000000NaN907.1761820
6.04541510200.06.02600.0-122.25518037.860126060014236011001325706001423601100106001...0168.4931514.78723412.76595772.3404265.8510643.94736821795.78084273
7.0448779200.07.02600.0-122.25000037.857100060014238003015344606001423800301506001...0010.0000000.0000005.88235394.1176470.0000000.00000010746.83817430
8.0596968400.08.03000.0-122.26618137.853644060014239011007346906001423901100706001...0258.5365857.2289167.22891679.5180726.0240966.81818214735.00610041
Contra Costa1.0278113125.01.0539.0-122.07370037.9540000601332300040164962106013323000401606013...010.0000000.00000020.68965579.3103456.89655210.0000006952.0225849
2.0216143895.02.01050.0-122.12876637.8564060601335220110004868106013352201100006013...02659.8191212.03452521.33168966.3995079.5561045.9538273136.152191774
3.0489225995.03.02800.0-122.10385337.8730580601335120030074775606013351200300706013...056.2500000.5494517.14285787.6373635.2197803.0303031547.798629256
4.0479438900.04.02014.0-122.29478037.9124240601339010030065749406013390100300606013...0327.5000004.93827213.58024771.6049386.1728406.9767444824.28892140
5.0555298500.05.05000.0-121.93372637.7788980601334511220375045606013345112203706013...007.4074072.20000045.20000048.4000004.2000001.4598542651.698323135
6.0421456400.06.04667.0-122.02450337.8696870601334610110244451406013346101102406013...009.6774190.00000012.24489884.6938781.0204080.0000002843.39865131
7.0211978630.07.05000.0-122.29850037.9156000601339010030025749006013390100300206013...0116.66666713.46153815.38461569.2307699.6153854.0000003687.82519224
8.0450483200.08.04400.0-121.86275537.9910220601331310310204350106013313103102006013...0415.47619011.87050416.00719448.56115132.5539573.4482765212.752588168
Marin1.0406345600.01.0850.0-122.58008537.86109906041131100206331131106041131100206306041...0628.0000002.6881722.68817291.9354842.15053815.966387937.628859100
2.0462069500.02.02000.0-122.45309837.87370206041124200200631606506041124200200606041...0123.2558140.0000003.26797494.1176471.30719016.5048544418.98615086
3.0582359000.03.03000.0-122.53301637.93528106041120000100831354406041120000100806041...0011.1111110.0000000.000000100.00000019.0476190.0000004554.4923809
4.05593310000.04.03000.0-122.49148437.89752506041124100401631605106041124100401606041...0015.3846159.3750006.25000084.3750000.0000007.1428573744.27901513
5.0360418000.05.02965.0-122.54723337.94472206041120000401831363906041120000401806041...0084.2696630.6849328.90411085.6164383.4246586.3157895596.74157889
6.0540105500.06.04500.0-122.61279338.10192006041103100300531256006041103100300506041...004.5454551.6216222.16216290.8108117.0270270.0000003398.88616266
Napa1.0601371800.01.0600.0-122.29036138.29944506055200202100735585906055200202100706055...0066.6666670.00000014.28571485.7142867.1428570.0000003619.8294909
2.0118684050.02.01200.0-122.47329038.49986806055201602302335778806055201602302306055...0226.0869570.0000000.00000094.23076915.38461532.3529413790.90201823
3.0561729775.03.04000.0-122.44530038.64930006055201800108735527806055201800108706055...0045.0000000.0000000.00000067.34693936.73469413.0434787.20996520
4.0593067500.04.03500.0-122.14325038.34219506055201403102335761706055201403102306055...0110.3448280.0000000.000000100.0000004.91803319.4444447.66716029
5.0602883950.05.04000.0-122.24229838.42212506055201401200035755006055201401200006055...059.6000002.7681662.42214590.3114197.26643610.71428627.513183125
San Francisco1.0534787500.01.01526.0-122.39581337.79115306075061500100959421506075061500100906075...00100.00000027.27272718.18181854.5454550.0000000.0000001371.7496272
2.0163509800.02.01900.0-122.40910037.80020006075010600300458674806075010600300406075...0091.0447761.26582346.20253247.4683543.16455712.98701351364.14007867
3.04874910250.03.03598.0-122.44878737.75900306075030500100059156306075030500100006075...027.8947370.00000015.85365978.0487806.0975619.5238109056.67445638
.....................................................................
5.03711110000.05.02700.0-122.44918337.79057206075013300100658748406075013300100606075...0114.2857140.00000011.47541088.5245901.6393443.44827610888.30241228
6.0565559850.06.01654.0-122.41755737.79842906075010900100458682006075010900100406075...0463.8157891.22950812.29508283.19672110.24590212.64367840964.352888152
7.0565539950.07.01894.0-122.41772737.79840806075010900100458682006075010900100406075...0463.8157891.22950812.29508283.19672110.24590212.64367840964.352888152
8.0498499900.08.02500.0-122.45351637.76439506075030102100059127106075030102100006075...0544.1406252.21811513.12384577.6340116.2846585.8823536726.337329256
San Mateo1.0507075000.01.01050.0-122.22097637.45523806081611300100962857306081611300100906081...0019.0476190.0000000.00000097.8260876.5217394.5454556614.44859021
2.0451756500.02.01660.0-122.19247637.42563906081613000200262501206081613000200206081...000.0000000.0000007.40740782.71604913.5802470.0000001953.07013028
3.03485010000.03.02800.0-122.18640037.43960006081612800100762493906081612800100706081...0415.9090910.00000016.00000074.40000012.0000008.3333334020.82143144
4.03487110000.04.03200.0-122.18640037.43960006081612800100762493906081612800100706081...0415.9090910.00000016.00000074.40000012.0000008.3333334020.82143144
5.03485510000.05.03000.0-122.18640037.43960006081612800100762493906081612800100706081...0415.9090910.00000016.00000074.40000012.0000008.3333334020.82143144
6.0544299500.06.03195.0-122.19215237.46612206081611500200962336006081611500200906081...000.0000000.00000018.86792575.4716980.0000006.2500001882.41359315
Santa Clara1.088335202.01.0792.0-122.01643537.33269906085508101305764698506085508101305706085...018.3333330.00000050.00000038.0952382.38095220.0000001655.75049512
2.012289065.02.02750.0-121.93560037.31630006085502101100164718106085502101100106085...0188.8888892.53164612.65822859.49367145.5696202.1739135552.18311145
3.0594259999.03.02267.0-122.13724137.43452206085511400400965139706085511400400906085...0018.1818180.0000008.33333391.6666670.0000000.0000007054.78515511
4.05005710000.04.02700.0-122.10567337.38134006085510300101864750506085510300101806085...023.1250000.00000017.55319175.5319153.1914893.0303034371.28776464
5.05907610000.05.02500.0-122.14124337.43064306085511400402465141206085511400402406085...0112.5000000.0000003.84615488.4615380.00000011.1111119717.1266968
6.02617810000.06.03485.0-122.13417437.40693906085510600300665061206085510600300606085...0131.2500000.33277929.11813665.2246264.1597342.6086964067.041311224
7.08459900.07.02000.0-122.14687537.43833906085511400101065134006085511400101006085...027.6923080.0000006.89655286.2068970.00000013.3333333187.74518313
8.0317712550.08.0774.0-122.00317437.32157406085508004100164682906085508004100106085...0120.8333334.87804957.31707325.6097566.0975614.00000013447.66770124
Solano1.0227281849.01.0862.0-122.14973338.06088606095252107100670781206095252107100606095...0269.3277317.10479612.25577365.54174111.7229137.0312506673.057886238
2.0575042300.02.01000.0-122.21557138.06672106095250604200070840706095250604200006095...0212.19512221.26436819.54023052.8735634.0229898.8888893699.49688182
3.0332864500.03.02300.0-122.18689438.21437906095252201401170315206095252201401106095...019.0909097.95454515.90909173.8636369.0909095.71428618.73805633
4.0603193495.04.03050.0-122.15406438.08622806095252104300570772806095252104300506095...016.7567576.20000022.60000058.0000008.0000001.3333332798.165950148
5.0504404000.05.04088.0-122.15904138.25036306095252201203070257506095252201203006095...000.00000012.82051312.82051371.7948720.0000000.000000537.93427215
7.0387873200.07.02518.0-121.98870038.38470006095253204100870646806095253204100806095...0127.1505387.0754726.41509467.73584918.8679254.6153851126.346001372
Sonoma1.0414293200.01.0875.0-122.55470038.41680006097150500200772120206097150500200706097...0216.3934430.0000001.60000088.00000011.2000006.1538462305.12933761
2.0571904500.02.01800.0-122.42099838.24279806097150100302572159906097150100302506097...0028.5714290.0000000.00000062.85714340.0000006.666667680.78239614
3.0432605000.03.01800.0-123.03730038.33090006097154302401771500306097154302401706097...1639.5683450.0000004.39189283.10810820.94594639.301310126.122201139
4.0583194850.04.03932.0-122.67866138.23241606097151100300171477006097151100300106097...0440.0000000.9546540.47732793.0787592.86396210.447761162.388156180
5.0419183750.05.03320.0-122.58605038.24452506097150611201271333506097150611201206097...006.2500000.7194247.19424588.4892095.0359714.0000003300.52744948
6.0605593295.06.03400.0-122.63779238.46341706097152600204371834006097152600204306097...005.2631580.00000015.94202982.6086965.0724640.0000006260.28311738
\n", "

61 rows × 57 columns

\n", "
" ], "text/plain": [ " rent bedrooms sqft longitude \\\n", "county_name bedrooms \n", "Alameda 1.0 29483 4950.0 1.0 800.0 -122.280400 \n", " 2.0 36889 4998.0 2.0 1400.0 -122.264292 \n", " 3.0 58544 7500.0 3.0 2500.0 -122.226934 \n", " 4.0 43448 8200.0 4.0 3247.0 -122.229400 \n", " 5.0 22134 7800.0 5.0 1856.0 -122.266723 \n", " 6.0 45415 10200.0 6.0 2600.0 -122.255180 \n", " 7.0 44877 9200.0 7.0 2600.0 -122.250000 \n", " 8.0 59696 8400.0 8.0 3000.0 -122.266181 \n", "Contra Costa 1.0 27811 3125.0 1.0 539.0 -122.073700 \n", " 2.0 21614 3895.0 2.0 1050.0 -122.128766 \n", " 3.0 48922 5995.0 3.0 2800.0 -122.103853 \n", " 4.0 47943 8900.0 4.0 2014.0 -122.294780 \n", " 5.0 55529 8500.0 5.0 5000.0 -121.933726 \n", " 6.0 42145 6400.0 6.0 4667.0 -122.024503 \n", " 7.0 21197 8630.0 7.0 5000.0 -122.298500 \n", " 8.0 45048 3200.0 8.0 4400.0 -121.862755 \n", "Marin 1.0 40634 5600.0 1.0 850.0 -122.580085 \n", " 2.0 46206 9500.0 2.0 2000.0 -122.453098 \n", " 3.0 58235 9000.0 3.0 3000.0 -122.533016 \n", " 4.0 55933 10000.0 4.0 3000.0 -122.491484 \n", " 5.0 36041 8000.0 5.0 2965.0 -122.547233 \n", " 6.0 54010 5500.0 6.0 4500.0 -122.612793 \n", "Napa 1.0 60137 1800.0 1.0 600.0 -122.290361 \n", " 2.0 11868 4050.0 2.0 1200.0 -122.473290 \n", " 3.0 56172 9775.0 3.0 4000.0 -122.445300 \n", " 4.0 59306 7500.0 4.0 3500.0 -122.143250 \n", " 5.0 60288 3950.0 5.0 4000.0 -122.242298 \n", "San Francisco 1.0 53478 7500.0 1.0 1526.0 -122.395813 \n", " 2.0 16350 9800.0 2.0 1900.0 -122.409100 \n", " 3.0 48749 10250.0 3.0 3598.0 -122.448787 \n", "... ... ... ... ... \n", " 5.0 37111 10000.0 5.0 2700.0 -122.449183 \n", " 6.0 56555 9850.0 6.0 1654.0 -122.417557 \n", " 7.0 56553 9950.0 7.0 1894.0 -122.417727 \n", " 8.0 49849 9900.0 8.0 2500.0 -122.453516 \n", "San Mateo 1.0 50707 5000.0 1.0 1050.0 -122.220976 \n", " 2.0 45175 6500.0 2.0 1660.0 -122.192476 \n", " 3.0 34850 10000.0 3.0 2800.0 -122.186400 \n", " 4.0 34871 10000.0 4.0 3200.0 -122.186400 \n", " 5.0 34855 10000.0 5.0 3000.0 -122.186400 \n", " 6.0 54429 9500.0 6.0 3195.0 -122.192152 \n", "Santa Clara 1.0 8833 5202.0 1.0 792.0 -122.016435 \n", " 2.0 1228 9065.0 2.0 2750.0 -121.935600 \n", " 3.0 59425 9999.0 3.0 2267.0 -122.137241 \n", " 4.0 50057 10000.0 4.0 2700.0 -122.105673 \n", " 5.0 59076 10000.0 5.0 2500.0 -122.141243 \n", " 6.0 26178 10000.0 6.0 3485.0 -122.134174 \n", " 7.0 845 9900.0 7.0 2000.0 -122.146875 \n", " 8.0 31771 2550.0 8.0 774.0 -122.003174 \n", "Solano 1.0 22728 1849.0 1.0 862.0 -122.149733 \n", " 2.0 57504 2300.0 2.0 1000.0 -122.215571 \n", " 3.0 33286 4500.0 3.0 2300.0 -122.186894 \n", " 4.0 60319 3495.0 4.0 3050.0 -122.154064 \n", " 5.0 50440 4000.0 5.0 4088.0 -122.159041 \n", " 7.0 38787 3200.0 7.0 2518.0 -121.988700 \n", "Sonoma 1.0 41429 3200.0 1.0 875.0 -122.554700 \n", " 2.0 57190 4500.0 2.0 1800.0 -122.420998 \n", " 3.0 43260 5000.0 3.0 1800.0 -123.037300 \n", " 4.0 58319 4850.0 4.0 3932.0 -122.678661 \n", " 5.0 41918 3750.0 5.0 3320.0 -122.586050 \n", " 6.0 60559 3295.0 6.0 3400.0 -122.637792 \n", "\n", " latitude fips_block logrecno \\\n", "county_name bedrooms \n", "Alameda 1.0 29483 37.836500 060014251041007 18519 \n", " 2.0 36889 37.879443 060014216004005 2094 \n", " 3.0 58544 37.830734 060014261001000 25365 \n", " 4.0 43448 37.828817 060014261001006 25371 \n", " 5.0 22134 37.863312 060014235001001 3192 \n", " 6.0 45415 37.860126 060014236011001 3257 \n", " 7.0 44877 37.857100 060014238003015 3446 \n", " 8.0 59696 37.853644 060014239011007 3469 \n", "Contra Costa 1.0 27811 37.954000 060133230004016 49621 \n", " 2.0 21614 37.856406 060133522011000 48681 \n", " 3.0 48922 37.873058 060133512003007 47756 \n", " 4.0 47943 37.912424 060133901003006 57494 \n", " 5.0 55529 37.778898 060133451122037 50456 \n", " 6.0 42145 37.869687 060133461011024 44514 \n", " 7.0 21197 37.915600 060133901003002 57490 \n", " 8.0 45048 37.991022 060133131031020 43501 \n", "Marin 1.0 40634 37.861099 060411311002063 311311 \n", " 2.0 46206 37.873702 060411242002006 316065 \n", " 3.0 58235 37.935281 060411200001008 313544 \n", " 4.0 55933 37.897525 060411241004016 316051 \n", " 5.0 36041 37.944722 060411200004018 313639 \n", " 6.0 54010 38.101920 060411031003005 312560 \n", "Napa 1.0 60137 38.299445 060552002021007 355859 \n", " 2.0 11868 38.499868 060552016023023 357788 \n", " 3.0 56172 38.649300 060552018001087 355278 \n", " 4.0 59306 38.342195 060552014031023 357617 \n", " 5.0 60288 38.422125 060552014012000 357550 \n", "San Francisco 1.0 53478 37.791153 060750615001009 594215 \n", " 2.0 16350 37.800200 060750106003004 586748 \n", " 3.0 48749 37.759003 060750305001000 591563 \n", "... ... ... ... \n", " 5.0 37111 37.790572 060750133001006 587484 \n", " 6.0 56555 37.798429 060750109001004 586820 \n", " 7.0 56553 37.798408 060750109001004 586820 \n", " 8.0 49849 37.764395 060750301021000 591271 \n", "San Mateo 1.0 50707 37.455238 060816113001009 628573 \n", " 2.0 45175 37.425639 060816130002002 625012 \n", " 3.0 34850 37.439600 060816128001007 624939 \n", " 4.0 34871 37.439600 060816128001007 624939 \n", " 5.0 34855 37.439600 060816128001007 624939 \n", " 6.0 54429 37.466122 060816115002009 623360 \n", "Santa Clara 1.0 8833 37.332699 060855081013057 646985 \n", " 2.0 1228 37.316300 060855021011001 647181 \n", " 3.0 59425 37.434522 060855114004009 651397 \n", " 4.0 50057 37.381340 060855103001018 647505 \n", " 5.0 59076 37.430643 060855114004024 651412 \n", " 6.0 26178 37.406939 060855106003006 650612 \n", " 7.0 845 37.438339 060855114001010 651340 \n", " 8.0 31771 37.321574 060855080041001 646829 \n", "Solano 1.0 22728 38.060886 060952521071006 707812 \n", " 2.0 57504 38.066721 060952506042000 708407 \n", " 3.0 33286 38.214379 060952522014011 703152 \n", " 4.0 60319 38.086228 060952521043005 707728 \n", " 5.0 50440 38.250363 060952522012030 702575 \n", " 7.0 38787 38.384700 060952532041008 706468 \n", "Sonoma 1.0 41429 38.416800 060971505002007 721202 \n", " 2.0 57190 38.242798 060971501003025 721599 \n", " 3.0 43260 38.330900 060971543024017 715003 \n", " 4.0 58319 38.232416 060971511003001 714770 \n", " 5.0 41918 38.244525 060971506112012 713335 \n", " 6.0 60559 38.463417 060971526002043 718340 \n", "\n", " blockfips state county ... H0050007 \\\n", "county_name bedrooms ... \n", "Alameda 1.0 29483 060014251041007 06 001 ... 0 \n", " 2.0 36889 060014216004005 06 001 ... 0 \n", " 3.0 58544 060014261001000 06 001 ... 0 \n", " 4.0 43448 060014261001006 06 001 ... 0 \n", " 5.0 22134 060014235001001 06 001 ... 0 \n", " 6.0 45415 060014236011001 06 001 ... 0 \n", " 7.0 44877 060014238003015 06 001 ... 0 \n", " 8.0 59696 060014239011007 06 001 ... 0 \n", "Contra Costa 1.0 27811 060133230004016 06 013 ... 0 \n", " 2.0 21614 060133522011000 06 013 ... 0 \n", " 3.0 48922 060133512003007 06 013 ... 0 \n", " 4.0 47943 060133901003006 06 013 ... 0 \n", " 5.0 55529 060133451122037 06 013 ... 0 \n", " 6.0 42145 060133461011024 06 013 ... 0 \n", " 7.0 21197 060133901003002 06 013 ... 0 \n", " 8.0 45048 060133131031020 06 013 ... 0 \n", "Marin 1.0 40634 060411311002063 06 041 ... 0 \n", " 2.0 46206 060411242002006 06 041 ... 0 \n", " 3.0 58235 060411200001008 06 041 ... 0 \n", " 4.0 55933 060411241004016 06 041 ... 0 \n", " 5.0 36041 060411200004018 06 041 ... 0 \n", " 6.0 54010 060411031003005 06 041 ... 0 \n", "Napa 1.0 60137 060552002021007 06 055 ... 0 \n", " 2.0 11868 060552016023023 06 055 ... 0 \n", " 3.0 56172 060552018001087 06 055 ... 0 \n", " 4.0 59306 060552014031023 06 055 ... 0 \n", " 5.0 60288 060552014012000 06 055 ... 0 \n", "San Francisco 1.0 53478 060750615001009 06 075 ... 0 \n", " 2.0 16350 060750106003004 06 075 ... 0 \n", " 3.0 48749 060750305001000 06 075 ... 0 \n", "... ... ... ... ... ... \n", " 5.0 37111 060750133001006 06 075 ... 0 \n", " 6.0 56555 060750109001004 06 075 ... 0 \n", " 7.0 56553 060750109001004 06 075 ... 0 \n", " 8.0 49849 060750301021000 06 075 ... 0 \n", "San Mateo 1.0 50707 060816113001009 06 081 ... 0 \n", " 2.0 45175 060816130002002 06 081 ... 0 \n", " 3.0 34850 060816128001007 06 081 ... 0 \n", " 4.0 34871 060816128001007 06 081 ... 0 \n", " 5.0 34855 060816128001007 06 081 ... 0 \n", " 6.0 54429 060816115002009 06 081 ... 0 \n", "Santa Clara 1.0 8833 060855081013057 06 085 ... 0 \n", " 2.0 1228 060855021011001 06 085 ... 0 \n", " 3.0 59425 060855114004009 06 085 ... 0 \n", " 4.0 50057 060855103001018 06 085 ... 0 \n", " 5.0 59076 060855114004024 06 085 ... 0 \n", " 6.0 26178 060855106003006 06 085 ... 0 \n", " 7.0 845 060855114001010 06 085 ... 0 \n", " 8.0 31771 060855080041001 06 085 ... 0 \n", "Solano 1.0 22728 060952521071006 06 095 ... 0 \n", " 2.0 57504 060952506042000 06 095 ... 0 \n", " 3.0 33286 060952522014011 06 095 ... 0 \n", " 4.0 60319 060952521043005 06 095 ... 0 \n", " 5.0 50440 060952522012030 06 095 ... 0 \n", " 7.0 38787 060952532041008 06 095 ... 0 \n", "Sonoma 1.0 41429 060971505002007 06 097 ... 0 \n", " 2.0 57190 060971501003025 06 097 ... 0 \n", " 3.0 43260 060971543024017 06 097 ... 1 \n", " 4.0 58319 060971511003001 06 097 ... 0 \n", " 5.0 41918 060971506112012 06 097 ... 0 \n", " 6.0 60559 060971526002043 06 097 ... 0 \n", "\n", " H0050008 pct_rent pct_black pct_asian \\\n", "county_name bedrooms \n", "Alameda 1.0 29483 0 66.666667 57.142857 14.285714 \n", " 2.0 36889 1 62.264151 0.000000 15.841584 \n", " 3.0 58544 0 10.000000 1.298701 23.376623 \n", " 4.0 43448 1 6.000000 1.351351 29.054054 \n", " 5.0 22134 0 NaN 0.000000 0.000000 \n", " 6.0 45415 1 68.493151 4.787234 12.765957 \n", " 7.0 44877 0 10.000000 0.000000 5.882353 \n", " 8.0 59696 2 58.536585 7.228916 7.228916 \n", "Contra Costa 1.0 27811 1 0.000000 0.000000 20.689655 \n", " 2.0 21614 26 59.819121 2.034525 21.331689 \n", " 3.0 48922 5 6.250000 0.549451 7.142857 \n", " 4.0 47943 3 27.500000 4.938272 13.580247 \n", " 5.0 55529 0 7.407407 2.200000 45.200000 \n", " 6.0 42145 0 9.677419 0.000000 12.244898 \n", " 7.0 21197 1 16.666667 13.461538 15.384615 \n", " 8.0 45048 4 15.476190 11.870504 16.007194 \n", "Marin 1.0 40634 6 28.000000 2.688172 2.688172 \n", " 2.0 46206 1 23.255814 0.000000 3.267974 \n", " 3.0 58235 0 11.111111 0.000000 0.000000 \n", " 4.0 55933 0 15.384615 9.375000 6.250000 \n", " 5.0 36041 0 84.269663 0.684932 8.904110 \n", " 6.0 54010 0 4.545455 1.621622 2.162162 \n", "Napa 1.0 60137 0 66.666667 0.000000 14.285714 \n", " 2.0 11868 2 26.086957 0.000000 0.000000 \n", " 3.0 56172 0 45.000000 0.000000 0.000000 \n", " 4.0 59306 1 10.344828 0.000000 0.000000 \n", " 5.0 60288 5 9.600000 2.768166 2.422145 \n", "San Francisco 1.0 53478 0 100.000000 27.272727 18.181818 \n", " 2.0 16350 0 91.044776 1.265823 46.202532 \n", " 3.0 48749 2 7.894737 0.000000 15.853659 \n", "... ... ... ... ... \n", " 5.0 37111 1 14.285714 0.000000 11.475410 \n", " 6.0 56555 4 63.815789 1.229508 12.295082 \n", " 7.0 56553 4 63.815789 1.229508 12.295082 \n", " 8.0 49849 5 44.140625 2.218115 13.123845 \n", "San Mateo 1.0 50707 0 19.047619 0.000000 0.000000 \n", " 2.0 45175 0 0.000000 0.000000 7.407407 \n", " 3.0 34850 4 15.909091 0.000000 16.000000 \n", " 4.0 34871 4 15.909091 0.000000 16.000000 \n", " 5.0 34855 4 15.909091 0.000000 16.000000 \n", " 6.0 54429 0 0.000000 0.000000 18.867925 \n", "Santa Clara 1.0 8833 1 8.333333 0.000000 50.000000 \n", " 2.0 1228 1 88.888889 2.531646 12.658228 \n", " 3.0 59425 0 18.181818 0.000000 8.333333 \n", " 4.0 50057 2 3.125000 0.000000 17.553191 \n", " 5.0 59076 1 12.500000 0.000000 3.846154 \n", " 6.0 26178 1 31.250000 0.332779 29.118136 \n", " 7.0 845 2 7.692308 0.000000 6.896552 \n", " 8.0 31771 1 20.833333 4.878049 57.317073 \n", "Solano 1.0 22728 2 69.327731 7.104796 12.255773 \n", " 2.0 57504 2 12.195122 21.264368 19.540230 \n", " 3.0 33286 1 9.090909 7.954545 15.909091 \n", " 4.0 60319 1 6.756757 6.200000 22.600000 \n", " 5.0 50440 0 0.000000 12.820513 12.820513 \n", " 7.0 38787 1 27.150538 7.075472 6.415094 \n", "Sonoma 1.0 41429 2 16.393443 0.000000 1.600000 \n", " 2.0 57190 0 28.571429 0.000000 0.000000 \n", " 3.0 43260 6 39.568345 0.000000 4.391892 \n", " 4.0 58319 4 40.000000 0.954654 0.477327 \n", " 5.0 41918 0 6.250000 0.719424 7.194245 \n", " 6.0 60559 0 5.263158 0.000000 15.942029 \n", "\n", " pct_white pct_hisp pct_vacant pop_sqmi \\\n", "county_name bedrooms \n", "Alameda 1.0 29483 28.571429 0.000000 0.000000 1965.089530 \n", " 2.0 36889 76.237624 8.910891 14.516129 13043.569584 \n", " 3.0 58544 74.025974 1.298701 6.250000 2159.258077 \n", " 4.0 43448 58.783784 6.081081 5.660377 10261.222401 \n", " 5.0 22134 100.000000 0.000000 NaN 907.176182 \n", " 6.0 45415 72.340426 5.851064 3.947368 21795.780842 \n", " 7.0 44877 94.117647 0.000000 0.000000 10746.838174 \n", " 8.0 59696 79.518072 6.024096 6.818182 14735.006100 \n", "Contra Costa 1.0 27811 79.310345 6.896552 10.000000 6952.022584 \n", " 2.0 21614 66.399507 9.556104 5.953827 3136.152191 \n", " 3.0 48922 87.637363 5.219780 3.030303 1547.798629 \n", " 4.0 47943 71.604938 6.172840 6.976744 4824.288921 \n", " 5.0 55529 48.400000 4.200000 1.459854 2651.698323 \n", " 6.0 42145 84.693878 1.020408 0.000000 2843.398651 \n", " 7.0 21197 69.230769 9.615385 4.000000 3687.825192 \n", " 8.0 45048 48.561151 32.553957 3.448276 5212.752588 \n", "Marin 1.0 40634 91.935484 2.150538 15.966387 937.628859 \n", " 2.0 46206 94.117647 1.307190 16.504854 4418.986150 \n", " 3.0 58235 100.000000 19.047619 0.000000 4554.492380 \n", " 4.0 55933 84.375000 0.000000 7.142857 3744.279015 \n", " 5.0 36041 85.616438 3.424658 6.315789 5596.741578 \n", " 6.0 54010 90.810811 7.027027 0.000000 3398.886162 \n", "Napa 1.0 60137 85.714286 7.142857 0.000000 3619.829490 \n", " 2.0 11868 94.230769 15.384615 32.352941 3790.902018 \n", " 3.0 56172 67.346939 36.734694 13.043478 7.209965 \n", " 4.0 59306 100.000000 4.918033 19.444444 7.667160 \n", " 5.0 60288 90.311419 7.266436 10.714286 27.513183 \n", "San Francisco 1.0 53478 54.545455 0.000000 0.000000 1371.749627 \n", " 2.0 16350 47.468354 3.164557 12.987013 51364.140078 \n", " 3.0 48749 78.048780 6.097561 9.523810 9056.674456 \n", "... ... ... ... ... \n", " 5.0 37111 88.524590 1.639344 3.448276 10888.302412 \n", " 6.0 56555 83.196721 10.245902 12.643678 40964.352888 \n", " 7.0 56553 83.196721 10.245902 12.643678 40964.352888 \n", " 8.0 49849 77.634011 6.284658 5.882353 6726.337329 \n", "San Mateo 1.0 50707 97.826087 6.521739 4.545455 6614.448590 \n", " 2.0 45175 82.716049 13.580247 0.000000 1953.070130 \n", " 3.0 34850 74.400000 12.000000 8.333333 4020.821431 \n", " 4.0 34871 74.400000 12.000000 8.333333 4020.821431 \n", " 5.0 34855 74.400000 12.000000 8.333333 4020.821431 \n", " 6.0 54429 75.471698 0.000000 6.250000 1882.413593 \n", "Santa Clara 1.0 8833 38.095238 2.380952 20.000000 1655.750495 \n", " 2.0 1228 59.493671 45.569620 2.173913 5552.183111 \n", " 3.0 59425 91.666667 0.000000 0.000000 7054.785155 \n", " 4.0 50057 75.531915 3.191489 3.030303 4371.287764 \n", " 5.0 59076 88.461538 0.000000 11.111111 9717.126696 \n", " 6.0 26178 65.224626 4.159734 2.608696 4067.041311 \n", " 7.0 845 86.206897 0.000000 13.333333 3187.745183 \n", " 8.0 31771 25.609756 6.097561 4.000000 13447.667701 \n", "Solano 1.0 22728 65.541741 11.722913 7.031250 6673.057886 \n", " 2.0 57504 52.873563 4.022989 8.888889 3699.496881 \n", " 3.0 33286 73.863636 9.090909 5.714286 18.738056 \n", " 4.0 60319 58.000000 8.000000 1.333333 2798.165950 \n", " 5.0 50440 71.794872 0.000000 0.000000 537.934272 \n", " 7.0 38787 67.735849 18.867925 4.615385 1126.346001 \n", "Sonoma 1.0 41429 88.000000 11.200000 6.153846 2305.129337 \n", " 2.0 57190 62.857143 40.000000 6.666667 680.782396 \n", " 3.0 43260 83.108108 20.945946 39.301310 126.122201 \n", " 4.0 58319 93.078759 2.863962 10.447761 162.388156 \n", " 5.0 41918 88.489209 5.035971 4.000000 3300.527449 \n", " 6.0 60559 82.608696 5.072464 0.000000 6260.283117 \n", "\n", " total_hh \n", "county_name bedrooms \n", "Alameda 1.0 29483 6 \n", " 2.0 36889 53 \n", " 3.0 58544 30 \n", " 4.0 43448 50 \n", " 5.0 22134 0 \n", " 6.0 45415 73 \n", " 7.0 44877 30 \n", " 8.0 59696 41 \n", "Contra Costa 1.0 27811 9 \n", " 2.0 21614 774 \n", " 3.0 48922 256 \n", " 4.0 47943 40 \n", " 5.0 55529 135 \n", " 6.0 42145 31 \n", " 7.0 21197 24 \n", " 8.0 45048 168 \n", "Marin 1.0 40634 100 \n", " 2.0 46206 86 \n", " 3.0 58235 9 \n", " 4.0 55933 13 \n", " 5.0 36041 89 \n", " 6.0 54010 66 \n", "Napa 1.0 60137 9 \n", " 2.0 11868 23 \n", " 3.0 56172 20 \n", " 4.0 59306 29 \n", " 5.0 60288 125 \n", "San Francisco 1.0 53478 2 \n", " 2.0 16350 67 \n", " 3.0 48749 38 \n", "... ... \n", " 5.0 37111 28 \n", " 6.0 56555 152 \n", " 7.0 56553 152 \n", " 8.0 49849 256 \n", "San Mateo 1.0 50707 21 \n", " 2.0 45175 28 \n", " 3.0 34850 44 \n", " 4.0 34871 44 \n", " 5.0 34855 44 \n", " 6.0 54429 15 \n", "Santa Clara 1.0 8833 12 \n", " 2.0 1228 45 \n", " 3.0 59425 11 \n", " 4.0 50057 64 \n", " 5.0 59076 8 \n", " 6.0 26178 224 \n", " 7.0 845 13 \n", " 8.0 31771 24 \n", "Solano 1.0 22728 238 \n", " 2.0 57504 82 \n", " 3.0 33286 33 \n", " 4.0 60319 148 \n", " 5.0 50440 15 \n", " 7.0 38787 372 \n", "Sonoma 1.0 41429 61 \n", " 2.0 57190 14 \n", " 3.0 43260 139 \n", " 4.0 58319 180 \n", " 5.0 41918 48 \n", " 6.0 60559 38 \n", "\n", "[61 rows x 57 columns]" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1.groupby(['county_name', 'bedrooms']).apply(top, n=1, column='rent')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exploring Correlations in the Data\n", "\n", "Pandas provides simple ways of computing correlation coefficients among the columns in your DataFrame. If you use corr() on a full DF, it will produce a large correlation table. A bit hard to navigate and you mostly would not be interested in some of these results." ] }, { "cell_type": "code", "execution_count": 47, "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", " \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", " \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", " \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", " \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", " \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", " \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", " \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", " \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", "
rentbedroomssqftlongitudelatitudelogrecnoblkgrparealandP0010001P0020001...H0050007H0050008pct_rentpct_blackpct_asianpct_whitepct_hisppct_vacantpop_sqmitotal_hh
rent1.0000000.4812340.616653-0.189488-0.2086240.185653-0.011133-0.002037-0.116857-0.116857...-0.0155960.010655-0.137076-0.2223220.0737850.191424-0.2900560.0305350.020475-0.098466
bedrooms0.4812341.0000000.8195330.0350850.065029-0.0393710.0281060.051052-0.120218-0.120218...-0.014990-0.034599-0.330290-0.000024-0.0149170.040864-0.035118-0.049176-0.125802-0.165445
sqft0.6166530.8195331.0000000.0096770.041737-0.0162250.0087020.075221-0.113589-0.113589...-0.009650-0.031854-0.331541-0.045550-0.0106800.090546-0.105976-0.018599-0.132978-0.150321
longitude-0.1894880.0350850.0096771.000000-0.548065-0.130319-0.098020-0.0434620.0944420.094442...0.030678-0.099010-0.067935-0.0231400.235135-0.2840170.156813-0.135010-0.0722330.054147
latitude-0.2086240.0650290.041737-0.5480651.000000-0.3060190.0697520.080858-0.105149-0.105149...0.0103430.072333-0.0134890.265711-0.4070350.253876-0.0035370.123641-0.011506-0.084385
logrecno0.185653-0.039371-0.016225-0.130319-0.3060191.0000000.050819-0.0115860.0203630.020363...-0.029056-0.0858170.069324-0.2458960.140300-0.0321650.055755-0.0188060.0698620.007127
blkgrp-0.0111330.0281060.008702-0.0980200.0697520.0508191.000000-0.001086-0.018809-0.018809...-0.009702-0.0239740.015964-0.0393420.0052270.018223-0.0093630.0327820.030694-0.011555
arealand-0.0020370.0510520.075221-0.0434620.080858-0.011586-0.0010861.0000000.0697810.069781...0.0115640.030822-0.084488-0.038112-0.0635350.094328-0.0262650.022772-0.0870060.056401
P0010001-0.116857-0.120218-0.1135890.094442-0.1051490.020363-0.0188090.0697811.0000001.000000...0.0861670.1757440.2789620.0183170.203882-0.2316800.0563640.0085340.2061830.921130
P0020001-0.116857-0.120218-0.1135890.094442-0.1051490.020363-0.0188090.0697811.0000001.000000...0.0861670.1757440.2789620.0183170.203882-0.2316800.0563640.0085340.2061830.921130
P0020002NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
P0020003NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
P0020004NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
P0020005NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
P0020006-0.116857-0.120218-0.1135890.094442-0.1051490.020363-0.0188090.0697811.0000001.000000...0.0861670.1757440.2789620.0183170.203882-0.2316800.0563640.0085340.2061830.921130
P0030001-0.116857-0.120218-0.1135890.094442-0.1051490.020363-0.0188090.0697811.0000001.000000...0.0861670.1757440.2789620.0183170.203882-0.2316800.0563640.0085340.2061830.921130
P0030002-0.066322-0.093093-0.073550-0.0264350.0174460.004837-0.0142630.1320310.8547420.854742...0.0473940.1856140.173508-0.083516-0.0712350.1105950.0123260.0440990.1261980.801007
P0030003-0.201005-0.064711-0.0883160.0250980.127130-0.166137-0.0085670.0085760.5370230.537023...0.0313520.1526420.2296370.520310-0.039777-0.2893300.1190650.0648290.1263770.487629
P0030004-0.165203-0.090338-0.1152620.082768-0.0524500.0511500.0400740.0245090.5986880.598688...0.0620060.0836450.2186910.069526-0.005272-0.1763320.270649-0.0299220.1253120.521462
P0030005-0.026636-0.102957-0.0885830.166245-0.2597100.080939-0.0240140.0045510.7876080.787608...0.0649700.1095260.237828-0.0715300.555367-0.424008-0.135453-0.0347320.2146670.754255
P0030006-0.143584-0.066546-0.0903800.059618-0.051114-0.0319590.0056810.0300110.4471450.447145...0.0704410.0561570.1515550.1512730.021010-0.2308840.178386-0.0364540.0704470.389712
P0030007-0.192221-0.074380-0.1065230.122080-0.0594140.0350070.0091190.0084690.6416930.641693...0.1399800.0506490.2372560.071188-0.066213-0.2152880.479125-0.0304710.1337710.501186
P0030008-0.171300-0.118709-0.1152390.094721-0.027325-0.047382-0.0381640.0496580.8922820.892282...0.0766370.1639410.2577770.1119170.080781-0.2130420.1024290.0219040.1509800.792140
P0040001-0.116857-0.120218-0.1135890.094442-0.1051490.020363-0.0188090.0697811.0000001.000000...0.0861670.1757440.2789620.0183170.203882-0.2316800.0563640.0085340.2061830.921130
P0040002-0.063643-0.117265-0.0958320.063237-0.1053630.010651-0.0247780.0800940.9569440.956944...0.0574610.1934670.247470-0.0055730.283091-0.211665-0.1217330.0209810.2042620.918629
P0040003-0.199757-0.079945-0.1120010.132892-0.0633990.0358690.0030090.0174690.7120010.712001...0.1218170.0639530.2454160.068926-0.067680-0.1892430.465083-0.0250470.1299770.565955
H00010001-0.092694-0.167299-0.1504610.041489-0.0723830.002331-0.0154190.0561350.9148330.914833...0.0703360.2641890.3435740.0240920.190429-0.173990-0.0415110.0783740.2690960.995539
H0030001-0.092694-0.167299-0.1504610.041489-0.0723830.002331-0.0154190.0561350.9148330.914833...0.0703360.2641890.3435740.0240920.190429-0.173990-0.0415110.0783740.2690960.995539
H0030002-0.098466-0.165445-0.1503210.054147-0.0843850.007127-0.0115550.0564010.9211300.921130...0.0675130.2291870.3382300.0177120.197087-0.180456-0.0350220.0170500.2643731.000000
H0030003-0.012294-0.120409-0.095463-0.0744820.049902-0.036622-0.0403490.0330870.5236540.523654...0.0665220.4435680.2574620.0657590.066542-0.057760-0.0775470.5352130.2062440.588844
H0040001-0.098466-0.165445-0.1503210.054147-0.0843850.007127-0.0115550.0564010.9211300.921130...0.0675130.2291870.3382300.0177120.197087-0.180456-0.0350220.0170500.2643731.000000
H00400020.0032800.0625300.0870090.043090-0.005836-0.054497-0.0671870.1550320.4711110.471111...-0.0036700.185045-0.328432-0.0691120.0618660.029861-0.115989-0.046065-0.0977700.494101
H00400030.0485780.0666420.089497-0.0700180.001907-0.021529-0.0182930.1758400.2924180.292418...-0.0062910.153030-0.336150-0.101425-0.0127730.124782-0.128222-0.051179-0.1305380.303376
H0040004-0.117207-0.216751-0.2097250.052274-0.0937490.0295720.012649-0.0075700.8488890.848889...0.0784260.1796230.5314630.0540460.202412-0.2265910.0134960.0404800.3466010.929069
H0050001-0.012294-0.120409-0.095463-0.0744820.049902-0.036622-0.0403490.0330870.5236540.523654...0.0665220.4435680.2574620.0657590.066542-0.057760-0.0775470.5352130.2062440.588844
H0050002-0.083147-0.128702-0.119278-0.0249620.0336840.000885-0.0326130.0062080.6159180.615918...0.0944380.2366580.3567300.0814020.054431-0.089416-0.0110100.3083670.2050730.628722
H00500030.005707-0.099994-0.0775290.006925-0.0529540.013185-0.007182-0.0026270.2802860.280286...0.0600430.1644270.222865-0.0086530.064074-0.027387-0.0606570.2037860.1031480.341604
H00500040.024617-0.014218-0.000359-0.0179590.016459-0.055300-0.0513060.0032000.0874170.087417...-0.0040860.051370-0.0192520.0470000.029440-0.026150-0.0403810.3999480.0418550.126174
H00500050.058702-0.016908-0.002828-0.0655290.0208840.002664-0.0256910.0319640.1144510.114451...-0.0021020.055245-0.088754-0.0048070.042804-0.000322-0.0748800.1820200.0676810.148416
H00500060.087468-0.078880-0.044212-0.1090020.0331560.0228540.0410220.0794380.1882820.188282...0.0141740.2058800.104297-0.0594900.0487510.055863-0.1388410.2338850.1783260.281515
H0050007-0.015596-0.014990-0.0096500.0306780.010343-0.029056-0.0097020.0115640.0861670.086167...1.000000-0.0077580.071269-0.0016340.042330-0.0523610.0137350.0416810.0104710.067513
H00500080.010655-0.034599-0.031854-0.0990100.072333-0.085817-0.0239740.0308220.1757440.175744...-0.0077581.0000000.0660340.0462490.006824-0.013860-0.0496330.3922660.0369430.229187
pct_rent-0.137076-0.330290-0.331541-0.067935-0.0134890.0693240.015964-0.0844880.2789620.278962...0.0712690.0660341.0000000.1769720.039507-0.2189810.1870860.1072430.3549590.338230
pct_black-0.222322-0.000024-0.045550-0.0231400.265711-0.245896-0.039342-0.0381120.0183170.018317...-0.0016340.0462490.1769721.000000-0.173398-0.3697450.0844770.1033430.0522450.017712
pct_asian0.073785-0.014917-0.0106800.235135-0.4070350.1403000.005227-0.0635350.2038820.203882...0.0423300.0068240.039507-0.1733981.000000-0.694488-0.325704-0.0612510.1560890.197087
pct_white0.1914240.0408640.090546-0.2840170.253876-0.0321650.0182230.094328-0.231680-0.231680...-0.052361-0.013860-0.218981-0.369745-0.6944881.000000-0.2096200.031902-0.177767-0.180456
pct_hisp-0.290056-0.035118-0.1059760.156813-0.0035370.055755-0.009363-0.0262650.0563640.056364...0.013735-0.0496330.1870860.084477-0.325704-0.2096201.000000-0.0487690.001433-0.035022
pct_vacant0.030535-0.049176-0.018599-0.1350100.123641-0.0188060.0327820.0227720.0085340.008534...0.0416810.3922660.1072430.103343-0.0612510.031902-0.0487691.0000000.0394100.017050
pop_sqmi0.020475-0.125802-0.132978-0.072233-0.0115060.0698620.030694-0.0870060.2061830.206183...0.0104710.0369430.3549590.0522450.156089-0.1777670.0014330.0394101.0000000.264373
total_hh-0.098466-0.165445-0.1503210.054147-0.0843850.007127-0.0115550.0564010.9211300.921130...0.0675130.2291870.3382300.0177120.197087-0.180456-0.0350220.0170500.2643731.000000
\n", "

50 rows × 50 columns

\n", "
" ], "text/plain": [ " rent bedrooms sqft longitude latitude logrecno \\\n", "rent 1.000000 0.481234 0.616653 -0.189488 -0.208624 0.185653 \n", "bedrooms 0.481234 1.000000 0.819533 0.035085 0.065029 -0.039371 \n", "sqft 0.616653 0.819533 1.000000 0.009677 0.041737 -0.016225 \n", "longitude -0.189488 0.035085 0.009677 1.000000 -0.548065 -0.130319 \n", "latitude -0.208624 0.065029 0.041737 -0.548065 1.000000 -0.306019 \n", "logrecno 0.185653 -0.039371 -0.016225 -0.130319 -0.306019 1.000000 \n", "blkgrp -0.011133 0.028106 0.008702 -0.098020 0.069752 0.050819 \n", "arealand -0.002037 0.051052 0.075221 -0.043462 0.080858 -0.011586 \n", "P0010001 -0.116857 -0.120218 -0.113589 0.094442 -0.105149 0.020363 \n", "P0020001 -0.116857 -0.120218 -0.113589 0.094442 -0.105149 0.020363 \n", "P0020002 NaN NaN NaN NaN NaN NaN \n", "P0020003 NaN NaN NaN NaN NaN NaN \n", "P0020004 NaN NaN NaN NaN NaN NaN \n", "P0020005 NaN NaN NaN NaN NaN NaN \n", "P0020006 -0.116857 -0.120218 -0.113589 0.094442 -0.105149 0.020363 \n", "P0030001 -0.116857 -0.120218 -0.113589 0.094442 -0.105149 0.020363 \n", "P0030002 -0.066322 -0.093093 -0.073550 -0.026435 0.017446 0.004837 \n", "P0030003 -0.201005 -0.064711 -0.088316 0.025098 0.127130 -0.166137 \n", "P0030004 -0.165203 -0.090338 -0.115262 0.082768 -0.052450 0.051150 \n", "P0030005 -0.026636 -0.102957 -0.088583 0.166245 -0.259710 0.080939 \n", "P0030006 -0.143584 -0.066546 -0.090380 0.059618 -0.051114 -0.031959 \n", "P0030007 -0.192221 -0.074380 -0.106523 0.122080 -0.059414 0.035007 \n", "P0030008 -0.171300 -0.118709 -0.115239 0.094721 -0.027325 -0.047382 \n", "P0040001 -0.116857 -0.120218 -0.113589 0.094442 -0.105149 0.020363 \n", "P0040002 -0.063643 -0.117265 -0.095832 0.063237 -0.105363 0.010651 \n", "P0040003 -0.199757 -0.079945 -0.112001 0.132892 -0.063399 0.035869 \n", "H00010001 -0.092694 -0.167299 -0.150461 0.041489 -0.072383 0.002331 \n", "H0030001 -0.092694 -0.167299 -0.150461 0.041489 -0.072383 0.002331 \n", "H0030002 -0.098466 -0.165445 -0.150321 0.054147 -0.084385 0.007127 \n", "H0030003 -0.012294 -0.120409 -0.095463 -0.074482 0.049902 -0.036622 \n", "H0040001 -0.098466 -0.165445 -0.150321 0.054147 -0.084385 0.007127 \n", "H0040002 0.003280 0.062530 0.087009 0.043090 -0.005836 -0.054497 \n", "H0040003 0.048578 0.066642 0.089497 -0.070018 0.001907 -0.021529 \n", "H0040004 -0.117207 -0.216751 -0.209725 0.052274 -0.093749 0.029572 \n", "H0050001 -0.012294 -0.120409 -0.095463 -0.074482 0.049902 -0.036622 \n", "H0050002 -0.083147 -0.128702 -0.119278 -0.024962 0.033684 0.000885 \n", "H0050003 0.005707 -0.099994 -0.077529 0.006925 -0.052954 0.013185 \n", "H0050004 0.024617 -0.014218 -0.000359 -0.017959 0.016459 -0.055300 \n", "H0050005 0.058702 -0.016908 -0.002828 -0.065529 0.020884 0.002664 \n", "H0050006 0.087468 -0.078880 -0.044212 -0.109002 0.033156 0.022854 \n", "H0050007 -0.015596 -0.014990 -0.009650 0.030678 0.010343 -0.029056 \n", "H0050008 0.010655 -0.034599 -0.031854 -0.099010 0.072333 -0.085817 \n", "pct_rent -0.137076 -0.330290 -0.331541 -0.067935 -0.013489 0.069324 \n", "pct_black -0.222322 -0.000024 -0.045550 -0.023140 0.265711 -0.245896 \n", "pct_asian 0.073785 -0.014917 -0.010680 0.235135 -0.407035 0.140300 \n", "pct_white 0.191424 0.040864 0.090546 -0.284017 0.253876 -0.032165 \n", "pct_hisp -0.290056 -0.035118 -0.105976 0.156813 -0.003537 0.055755 \n", "pct_vacant 0.030535 -0.049176 -0.018599 -0.135010 0.123641 -0.018806 \n", "pop_sqmi 0.020475 -0.125802 -0.132978 -0.072233 -0.011506 0.069862 \n", "total_hh -0.098466 -0.165445 -0.150321 0.054147 -0.084385 0.007127 \n", "\n", " blkgrp arealand P0010001 P0020001 ... H0050007 \\\n", "rent -0.011133 -0.002037 -0.116857 -0.116857 ... -0.015596 \n", "bedrooms 0.028106 0.051052 -0.120218 -0.120218 ... -0.014990 \n", "sqft 0.008702 0.075221 -0.113589 -0.113589 ... -0.009650 \n", "longitude -0.098020 -0.043462 0.094442 0.094442 ... 0.030678 \n", "latitude 0.069752 0.080858 -0.105149 -0.105149 ... 0.010343 \n", "logrecno 0.050819 -0.011586 0.020363 0.020363 ... -0.029056 \n", "blkgrp 1.000000 -0.001086 -0.018809 -0.018809 ... -0.009702 \n", "arealand -0.001086 1.000000 0.069781 0.069781 ... 0.011564 \n", "P0010001 -0.018809 0.069781 1.000000 1.000000 ... 0.086167 \n", "P0020001 -0.018809 0.069781 1.000000 1.000000 ... 0.086167 \n", "P0020002 NaN NaN NaN NaN ... NaN \n", "P0020003 NaN NaN NaN NaN ... NaN \n", "P0020004 NaN NaN NaN NaN ... NaN \n", "P0020005 NaN NaN NaN NaN ... NaN \n", "P0020006 -0.018809 0.069781 1.000000 1.000000 ... 0.086167 \n", "P0030001 -0.018809 0.069781 1.000000 1.000000 ... 0.086167 \n", "P0030002 -0.014263 0.132031 0.854742 0.854742 ... 0.047394 \n", "P0030003 -0.008567 0.008576 0.537023 0.537023 ... 0.031352 \n", "P0030004 0.040074 0.024509 0.598688 0.598688 ... 0.062006 \n", "P0030005 -0.024014 0.004551 0.787608 0.787608 ... 0.064970 \n", "P0030006 0.005681 0.030011 0.447145 0.447145 ... 0.070441 \n", "P0030007 0.009119 0.008469 0.641693 0.641693 ... 0.139980 \n", "P0030008 -0.038164 0.049658 0.892282 0.892282 ... 0.076637 \n", "P0040001 -0.018809 0.069781 1.000000 1.000000 ... 0.086167 \n", "P0040002 -0.024778 0.080094 0.956944 0.956944 ... 0.057461 \n", "P0040003 0.003009 0.017469 0.712001 0.712001 ... 0.121817 \n", "H00010001 -0.015419 0.056135 0.914833 0.914833 ... 0.070336 \n", "H0030001 -0.015419 0.056135 0.914833 0.914833 ... 0.070336 \n", "H0030002 -0.011555 0.056401 0.921130 0.921130 ... 0.067513 \n", "H0030003 -0.040349 0.033087 0.523654 0.523654 ... 0.066522 \n", "H0040001 -0.011555 0.056401 0.921130 0.921130 ... 0.067513 \n", "H0040002 -0.067187 0.155032 0.471111 0.471111 ... -0.003670 \n", "H0040003 -0.018293 0.175840 0.292418 0.292418 ... -0.006291 \n", "H0040004 0.012649 -0.007570 0.848889 0.848889 ... 0.078426 \n", "H0050001 -0.040349 0.033087 0.523654 0.523654 ... 0.066522 \n", "H0050002 -0.032613 0.006208 0.615918 0.615918 ... 0.094438 \n", "H0050003 -0.007182 -0.002627 0.280286 0.280286 ... 0.060043 \n", "H0050004 -0.051306 0.003200 0.087417 0.087417 ... -0.004086 \n", "H0050005 -0.025691 0.031964 0.114451 0.114451 ... -0.002102 \n", "H0050006 0.041022 0.079438 0.188282 0.188282 ... 0.014174 \n", "H0050007 -0.009702 0.011564 0.086167 0.086167 ... 1.000000 \n", "H0050008 -0.023974 0.030822 0.175744 0.175744 ... -0.007758 \n", "pct_rent 0.015964 -0.084488 0.278962 0.278962 ... 0.071269 \n", "pct_black -0.039342 -0.038112 0.018317 0.018317 ... -0.001634 \n", "pct_asian 0.005227 -0.063535 0.203882 0.203882 ... 0.042330 \n", "pct_white 0.018223 0.094328 -0.231680 -0.231680 ... -0.052361 \n", "pct_hisp -0.009363 -0.026265 0.056364 0.056364 ... 0.013735 \n", "pct_vacant 0.032782 0.022772 0.008534 0.008534 ... 0.041681 \n", "pop_sqmi 0.030694 -0.087006 0.206183 0.206183 ... 0.010471 \n", "total_hh -0.011555 0.056401 0.921130 0.921130 ... 0.067513 \n", "\n", " H0050008 pct_rent pct_black pct_asian pct_white pct_hisp \\\n", "rent 0.010655 -0.137076 -0.222322 0.073785 0.191424 -0.290056 \n", "bedrooms -0.034599 -0.330290 -0.000024 -0.014917 0.040864 -0.035118 \n", "sqft -0.031854 -0.331541 -0.045550 -0.010680 0.090546 -0.105976 \n", "longitude -0.099010 -0.067935 -0.023140 0.235135 -0.284017 0.156813 \n", "latitude 0.072333 -0.013489 0.265711 -0.407035 0.253876 -0.003537 \n", "logrecno -0.085817 0.069324 -0.245896 0.140300 -0.032165 0.055755 \n", "blkgrp -0.023974 0.015964 -0.039342 0.005227 0.018223 -0.009363 \n", "arealand 0.030822 -0.084488 -0.038112 -0.063535 0.094328 -0.026265 \n", "P0010001 0.175744 0.278962 0.018317 0.203882 -0.231680 0.056364 \n", "P0020001 0.175744 0.278962 0.018317 0.203882 -0.231680 0.056364 \n", "P0020002 NaN NaN NaN NaN NaN NaN \n", "P0020003 NaN NaN NaN NaN NaN NaN \n", "P0020004 NaN NaN NaN NaN NaN NaN \n", "P0020005 NaN NaN NaN NaN NaN NaN \n", "P0020006 0.175744 0.278962 0.018317 0.203882 -0.231680 0.056364 \n", "P0030001 0.175744 0.278962 0.018317 0.203882 -0.231680 0.056364 \n", "P0030002 0.185614 0.173508 -0.083516 -0.071235 0.110595 0.012326 \n", "P0030003 0.152642 0.229637 0.520310 -0.039777 -0.289330 0.119065 \n", "P0030004 0.083645 0.218691 0.069526 -0.005272 -0.176332 0.270649 \n", "P0030005 0.109526 0.237828 -0.071530 0.555367 -0.424008 -0.135453 \n", "P0030006 0.056157 0.151555 0.151273 0.021010 -0.230884 0.178386 \n", "P0030007 0.050649 0.237256 0.071188 -0.066213 -0.215288 0.479125 \n", "P0030008 0.163941 0.257777 0.111917 0.080781 -0.213042 0.102429 \n", "P0040001 0.175744 0.278962 0.018317 0.203882 -0.231680 0.056364 \n", "P0040002 0.193467 0.247470 -0.005573 0.283091 -0.211665 -0.121733 \n", "P0040003 0.063953 0.245416 0.068926 -0.067680 -0.189243 0.465083 \n", "H00010001 0.264189 0.343574 0.024092 0.190429 -0.173990 -0.041511 \n", "H0030001 0.264189 0.343574 0.024092 0.190429 -0.173990 -0.041511 \n", "H0030002 0.229187 0.338230 0.017712 0.197087 -0.180456 -0.035022 \n", "H0030003 0.443568 0.257462 0.065759 0.066542 -0.057760 -0.077547 \n", "H0040001 0.229187 0.338230 0.017712 0.197087 -0.180456 -0.035022 \n", "H0040002 0.185045 -0.328432 -0.069112 0.061866 0.029861 -0.115989 \n", "H0040003 0.153030 -0.336150 -0.101425 -0.012773 0.124782 -0.128222 \n", "H0040004 0.179623 0.531463 0.054046 0.202412 -0.226591 0.013496 \n", "H0050001 0.443568 0.257462 0.065759 0.066542 -0.057760 -0.077547 \n", "H0050002 0.236658 0.356730 0.081402 0.054431 -0.089416 -0.011010 \n", "H0050003 0.164427 0.222865 -0.008653 0.064074 -0.027387 -0.060657 \n", "H0050004 0.051370 -0.019252 0.047000 0.029440 -0.026150 -0.040381 \n", "H0050005 0.055245 -0.088754 -0.004807 0.042804 -0.000322 -0.074880 \n", "H0050006 0.205880 0.104297 -0.059490 0.048751 0.055863 -0.138841 \n", "H0050007 -0.007758 0.071269 -0.001634 0.042330 -0.052361 0.013735 \n", "H0050008 1.000000 0.066034 0.046249 0.006824 -0.013860 -0.049633 \n", "pct_rent 0.066034 1.000000 0.176972 0.039507 -0.218981 0.187086 \n", "pct_black 0.046249 0.176972 1.000000 -0.173398 -0.369745 0.084477 \n", "pct_asian 0.006824 0.039507 -0.173398 1.000000 -0.694488 -0.325704 \n", "pct_white -0.013860 -0.218981 -0.369745 -0.694488 1.000000 -0.209620 \n", "pct_hisp -0.049633 0.187086 0.084477 -0.325704 -0.209620 1.000000 \n", "pct_vacant 0.392266 0.107243 0.103343 -0.061251 0.031902 -0.048769 \n", "pop_sqmi 0.036943 0.354959 0.052245 0.156089 -0.177767 0.001433 \n", "total_hh 0.229187 0.338230 0.017712 0.197087 -0.180456 -0.035022 \n", "\n", " pct_vacant pop_sqmi total_hh \n", "rent 0.030535 0.020475 -0.098466 \n", "bedrooms -0.049176 -0.125802 -0.165445 \n", "sqft -0.018599 -0.132978 -0.150321 \n", "longitude -0.135010 -0.072233 0.054147 \n", "latitude 0.123641 -0.011506 -0.084385 \n", "logrecno -0.018806 0.069862 0.007127 \n", "blkgrp 0.032782 0.030694 -0.011555 \n", "arealand 0.022772 -0.087006 0.056401 \n", "P0010001 0.008534 0.206183 0.921130 \n", "P0020001 0.008534 0.206183 0.921130 \n", "P0020002 NaN NaN NaN \n", "P0020003 NaN NaN NaN \n", "P0020004 NaN NaN NaN \n", "P0020005 NaN NaN NaN \n", "P0020006 0.008534 0.206183 0.921130 \n", "P0030001 0.008534 0.206183 0.921130 \n", "P0030002 0.044099 0.126198 0.801007 \n", "P0030003 0.064829 0.126377 0.487629 \n", "P0030004 -0.029922 0.125312 0.521462 \n", "P0030005 -0.034732 0.214667 0.754255 \n", "P0030006 -0.036454 0.070447 0.389712 \n", "P0030007 -0.030471 0.133771 0.501186 \n", "P0030008 0.021904 0.150980 0.792140 \n", "P0040001 0.008534 0.206183 0.921130 \n", "P0040002 0.020981 0.204262 0.918629 \n", "P0040003 -0.025047 0.129977 0.565955 \n", "H00010001 0.078374 0.269096 0.995539 \n", "H0030001 0.078374 0.269096 0.995539 \n", "H0030002 0.017050 0.264373 1.000000 \n", "H0030003 0.535213 0.206244 0.588844 \n", "H0040001 0.017050 0.264373 1.000000 \n", "H0040002 -0.046065 -0.097770 0.494101 \n", "H0040003 -0.051179 -0.130538 0.303376 \n", "H0040004 0.040480 0.346601 0.929069 \n", "H0050001 0.535213 0.206244 0.588844 \n", "H0050002 0.308367 0.205073 0.628722 \n", "H0050003 0.203786 0.103148 0.341604 \n", "H0050004 0.399948 0.041855 0.126174 \n", "H0050005 0.182020 0.067681 0.148416 \n", "H0050006 0.233885 0.178326 0.281515 \n", "H0050007 0.041681 0.010471 0.067513 \n", "H0050008 0.392266 0.036943 0.229187 \n", "pct_rent 0.107243 0.354959 0.338230 \n", "pct_black 0.103343 0.052245 0.017712 \n", "pct_asian -0.061251 0.156089 0.197087 \n", "pct_white 0.031902 -0.177767 -0.180456 \n", "pct_hisp -0.048769 0.001433 -0.035022 \n", "pct_vacant 1.000000 0.039410 0.017050 \n", "pop_sqmi 0.039410 1.000000 0.264373 \n", "total_hh 0.017050 0.264373 1.000000 \n", "\n", "[50 rows x 50 columns]" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1.corr()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It is easy to compute correlation coeffients for a subset of columns." ] }, { "cell_type": "code", "execution_count": 48, "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", "
rentsqft
rent1.0000000.616653
sqft0.6166531.000000
\n", "
" ], "text/plain": [ " rent sqft\n", "rent 1.000000 0.616653\n", "sqft 0.616653 1.000000" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1[['rent', 'sqft']].corr()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And this method can be combined with groupby to compute correlation tables by group." ] }, { "cell_type": "code", "execution_count": 49, "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", "
rentsqft
county_name
Alamedarent1.0000000.784616
sqft0.7846161.000000
Contra Costarent1.0000000.688621
sqft0.6886211.000000
Marinrent1.0000000.799108
sqft0.7991081.000000
Naparent1.0000000.711565
sqft0.7115651.000000
San Franciscorent1.0000000.740660
sqft0.7406601.000000
San Mateorent1.0000000.816791
sqft0.8167911.000000
Santa Clararent1.0000000.771930
sqft0.7719301.000000
Solanorent1.0000000.816569
sqft0.8165691.000000
Sonomarent1.0000000.823559
sqft0.8235591.000000
\n", "
" ], "text/plain": [ " rent sqft\n", "county_name \n", "Alameda rent 1.000000 0.784616\n", " sqft 0.784616 1.000000\n", "Contra Costa rent 1.000000 0.688621\n", " sqft 0.688621 1.000000\n", "Marin rent 1.000000 0.799108\n", " sqft 0.799108 1.000000\n", "Napa rent 1.000000 0.711565\n", " sqft 0.711565 1.000000\n", "San Francisco rent 1.000000 0.740660\n", " sqft 0.740660 1.000000\n", "San Mateo rent 1.000000 0.816791\n", " sqft 0.816791 1.000000\n", "Santa Clara rent 1.000000 0.771930\n", " sqft 0.771930 1.000000\n", "Solano rent 1.000000 0.816569\n", " sqft 0.816569 1.000000\n", "Sonoma rent 1.000000 0.823559\n", " sqft 0.823559 1.000000" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1.groupby('county_name')[['rent', 'sqft']].corr()" ] }, { "cell_type": "code", "execution_count": 50, "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", "
rentsqft
bedrooms
1.0rent1.0000000.350723
sqft0.3507231.000000
2.0rent1.0000000.485617
sqft0.4856171.000000
3.0rent1.0000000.445744
sqft0.4457441.000000
\n", "
" ], "text/plain": [ " rent sqft\n", "bedrooms \n", "1.0 rent 1.000000 0.350723\n", " sqft 0.350723 1.000000\n", "2.0 rent 1.000000 0.485617\n", " sqft 0.485617 1.000000\n", "3.0 rent 1.000000 0.445744\n", " sqft 0.445744 1.000000" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rentals_sf1[rentals_sf1['bedrooms']<4].groupby('bedrooms')[['rent', 'sqft']].corr()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Quantile and Bucket Analysis\n", "\n", "We use below the cut method to create categories for ranges of a variable. In this example we use 4 even intevals using cut. If we used qcut instead, it would generate quantiles for us." ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 (216.064, 1455.0]\n", "1 (216.064, 1455.0]\n", "2 (216.064, 1455.0]\n", "3 (2689.0, 3923.0]\n", "4 (216.064, 1455.0]\n", "Name: sqft, dtype: category\n", "Categories (4, interval[float64]): [(216.064, 1455.0] < (1455.0, 2689.0] < (2689.0, 3923.0] < (3923.0, 5157.0]]" ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "factor = pd.cut(rentals_sf1['sqft'], 4)\n", "factor[:5]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Define a function to get grouped statistics." ] }, { "cell_type": "code", "execution_count": 52, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def get_stats(group):\n", " return{'min': group.min(), 'max': group.max(), 'count': group.count(), 'mean': group.mean()}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Apply the function to the DataFrame for a specified column." ] }, { "cell_type": "code", "execution_count": 53, "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", "
countmaxmeanmin
sqft
(216.064, 1455.0]53054.08500.02317.507521350.0
(1455.0, 2689.0]7003.010200.03742.959732295.0
(2689.0, 3923.0]983.010250.05334.371312750.0
(3923.0, 5157.0]163.010000.05913.8773011300.0
\n", "
" ], "text/plain": [ " count max mean min\n", "sqft \n", "(216.064, 1455.0] 53054.0 8500.0 2317.507521 350.0\n", "(1455.0, 2689.0] 7003.0 10200.0 3742.959732 295.0\n", "(2689.0, 3923.0] 983.0 10250.0 5334.371312 750.0\n", "(3923.0, 5157.0] 163.0 10000.0 5913.877301 1300.0" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grouped = rentals_sf1['rent'].groupby(factor)\n", "grouped.apply(get_stats).unstack()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Your turn to experiment\n", "\n", "Try practicing these techniques on your own, to do the following:\n", "\n", "* Calculate the mean sqft of rental listings by county\n", "* Calculate the standard deviation (std) of sqft of rental listings by county and bedroom\n", "* Add a new column with a normalized sqft, substracting the mean sqft by bedroom from each listing's sqft \n", "* Compute correlation coefficients among rent, sqft, pct_white, pct_black, pct_asian and pct_hisp, by county and for the region\n", "* Redo the statistical profile on rents by categories of sqft range using 10 quantiles rather than 4 equal bins\n" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mean sqft of rental listings by county\n" ] }, { "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", "
sqft
mean
county_name
Alameda994.309424
Contra Costa1093.182721
Marin1195.318408
Napa1276.574349
San Francisco993.078210
San Mateo1018.273606
Santa Clara1015.654471
Solano1036.303606
Sonoma1080.441710
\n", "
" ], "text/plain": [ " sqft\n", " mean\n", "county_name \n", "Alameda 994.309424\n", "Contra Costa 1093.182721\n", "Marin 1195.318408\n", "Napa 1276.574349\n", "San Francisco 993.078210\n", "San Mateo 1018.273606\n", "Santa Clara 1015.654471\n", "Solano 1036.303606\n", "Sonoma 1080.441710" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('Mean sqft of rental listings by county')\n", "rentals_sf1.groupby(['county_name'])[['sqft']].agg(['mean'])" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Standard deviation (std) of sqft of rental listings by county and bedroom\n" ] }, { "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", "
sqft
county_namebedrooms
Alameda1.0145.339524
2.0182.889661
3.0391.567824
Contra Costa1.0125.849542
2.0196.317132
3.0401.888005
Marin1.0151.617528
2.0262.306487
3.0377.109246
Napa1.0108.029275
2.0160.604700
3.0453.097339
San Francisco1.0197.229158
2.0275.711931
3.0430.562968
San Mateo1.0164.091809
2.0220.181812
3.0430.838329
Santa Clara1.0136.437022
2.0182.463528
3.0355.383819
Solano1.0267.559314
2.0143.200480
3.0365.966708
Sonoma1.0140.078349
2.0280.080267
3.0402.328830
\n", "
" ], "text/plain": [ " sqft\n", "county_name bedrooms \n", "Alameda 1.0 145.339524\n", " 2.0 182.889661\n", " 3.0 391.567824\n", "Contra Costa 1.0 125.849542\n", " 2.0 196.317132\n", " 3.0 401.888005\n", "Marin 1.0 151.617528\n", " 2.0 262.306487\n", " 3.0 377.109246\n", "Napa 1.0 108.029275\n", " 2.0 160.604700\n", " 3.0 453.097339\n", "San Francisco 1.0 197.229158\n", " 2.0 275.711931\n", " 3.0 430.562968\n", "San Mateo 1.0 164.091809\n", " 2.0 220.181812\n", " 3.0 430.838329\n", "Santa Clara 1.0 136.437022\n", " 2.0 182.463528\n", " 3.0 355.383819\n", "Solano 1.0 267.559314\n", " 2.0 143.200480\n", " 3.0 365.966708\n", "Sonoma 1.0 140.078349\n", " 2.0 280.080267\n", " 3.0 402.328830" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('Standard deviation (std) of sqft of rental listings by county and bedroom')\n", "\n", "# The line below does this for bedrooms < 4\n", "rentals_sf1[rentals_sf1['bedrooms']<4].groupby(['county_name', 'bedrooms'])[['sqft']].agg('std')\n", "\n", "# The line below does this for all bedrooms\n", "#rentals_sf1.groupby(['county_name', 'bedrooms'])[['sqft']].agg('std')" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "# Add a new column with a normalized sqft, substracting the mean sqft by bedroom from each listing's sqft \n", "rentals_sf1['sqft'].groupby(rentals_sf1['bedrooms']).apply()\n", "#rentals_sf1['normalized_sqft']= rentals_sf1['sqft'].groupby(rentals_sf1['bedrooms']).transform(demean)\n", "#rentals_sf1.head()" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Correlations by county\n" ] }, { "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", " \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", " \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", " \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", "
rentsqftpct_whitepct_blackpct_asianpct_hisp
county_name
Alamedarent1.0000000.7846160.170268-0.0965340.053136-0.307377
sqft0.7846161.0000000.086466-0.0650430.040900-0.142701
pct_white0.1702680.0864661.000000-0.446842-0.557046-0.192825
pct_black-0.096534-0.065043-0.4468421.000000-0.302742-0.008881
pct_asian0.0531360.040900-0.557046-0.3027421.000000-0.285257
pct_hisp-0.307377-0.142701-0.192825-0.008881-0.2852571.000000
Contra Costarent1.0000000.6886210.254659-0.2288910.059985-0.354806
sqft0.6886211.0000000.0131360.027911-0.036097-0.008240
pct_white0.2546590.0131361.000000-0.681387-0.523865-0.432210
pct_black-0.2288910.027911-0.6813871.000000-0.0726750.310377
pct_asian0.059985-0.036097-0.523865-0.0726751.000000-0.250950
pct_hisp-0.354806-0.008240-0.4322100.310377-0.2509501.000000
Marinrent1.0000000.7991080.316734-0.2367800.012182-0.302109
sqft0.7991081.0000000.229527-0.2351920.009825-0.161819
pct_white0.3167340.2295271.000000-0.539401-0.430646-0.699893
pct_black-0.236780-0.235192-0.5394011.0000000.0648100.088286
pct_asian0.0121820.009825-0.4306460.0648101.000000-0.018038
pct_hisp-0.302109-0.161819-0.6998930.088286-0.0180381.000000
Naparent1.0000000.7115650.268350-0.016171-0.095403-0.276374
sqft0.7115651.0000000.0369810.1471530.224958-0.350268
pct_white0.2683500.0369811.000000-0.382098-0.723362-0.388602
pct_black-0.0161710.147153-0.3820981.0000000.320864-0.025858
pct_asian-0.0954030.224958-0.7233620.3208641.000000-0.276874
pct_hisp-0.276374-0.350268-0.388602-0.025858-0.2768741.000000
San Franciscorent1.0000000.7406600.264373-0.038178-0.227130-0.118455
sqft0.7406601.000000-0.008948-0.0116740.0092070.001649
pct_white0.264373-0.0089481.000000-0.376206-0.810304-0.363823
pct_black-0.038178-0.011674-0.3762061.000000-0.0608720.180683
pct_asian-0.2271300.009207-0.810304-0.0608721.000000-0.066804
pct_hisp-0.1184550.001649-0.3638230.180683-0.0668041.000000
San Mateorent1.0000000.8167910.186228-0.074474-0.065291-0.174153
sqft0.8167911.0000000.095011-0.0635270.016771-0.126785
pct_white0.1862280.0950111.000000-0.393266-0.643022-0.462254
pct_black-0.074474-0.063527-0.3932661.0000000.1407990.152291
pct_asian-0.0652910.016771-0.6430220.1407991.000000-0.297553
pct_hisp-0.174153-0.126785-0.4622540.152291-0.2975531.000000
Santa Clararent1.0000000.7719300.110132-0.1805420.075833-0.286915
sqft0.7719301.0000000.066089-0.1146920.030431-0.129721
pct_white0.1101320.0660891.000000-0.051713-0.8138920.054657
pct_black-0.180542-0.114692-0.0517131.000000-0.2034720.161685
pct_asian0.0758330.030431-0.813892-0.2034721.000000-0.545422
pct_hisp-0.286915-0.1297210.0546570.161685-0.5454221.000000
Solanorent1.0000000.8165690.238070-0.2134470.093823-0.245141
sqft0.8165691.0000000.176588-0.170842-0.008864-0.124703
pct_white0.2380700.1765881.000000-0.722191-0.597865-0.045126
pct_black-0.213447-0.170842-0.7221911.0000000.256453-0.213463
pct_asian0.093823-0.008864-0.5978650.2564531.000000-0.338282
pct_hisp-0.245141-0.124703-0.045126-0.213463-0.3382821.000000
Sonomarent1.0000000.8235590.260039-0.1785400.104650-0.288495
sqft0.8235591.0000000.246950-0.1309350.081570-0.307017
pct_white0.2600390.2469501.000000-0.434451-0.301256-0.794879
pct_black-0.178540-0.130935-0.4344511.0000000.0737680.241904
pct_asian0.1046500.081570-0.3012560.0737681.000000-0.050895
pct_hisp-0.288495-0.307017-0.7948790.241904-0.0508951.000000
\n", "
" ], "text/plain": [ " rent sqft pct_white pct_black pct_asian \\\n", "county_name \n", "Alameda rent 1.000000 0.784616 0.170268 -0.096534 0.053136 \n", " sqft 0.784616 1.000000 0.086466 -0.065043 0.040900 \n", " pct_white 0.170268 0.086466 1.000000 -0.446842 -0.557046 \n", " pct_black -0.096534 -0.065043 -0.446842 1.000000 -0.302742 \n", " pct_asian 0.053136 0.040900 -0.557046 -0.302742 1.000000 \n", " pct_hisp -0.307377 -0.142701 -0.192825 -0.008881 -0.285257 \n", "Contra Costa rent 1.000000 0.688621 0.254659 -0.228891 0.059985 \n", " sqft 0.688621 1.000000 0.013136 0.027911 -0.036097 \n", " pct_white 0.254659 0.013136 1.000000 -0.681387 -0.523865 \n", " pct_black -0.228891 0.027911 -0.681387 1.000000 -0.072675 \n", " pct_asian 0.059985 -0.036097 -0.523865 -0.072675 1.000000 \n", " pct_hisp -0.354806 -0.008240 -0.432210 0.310377 -0.250950 \n", "Marin rent 1.000000 0.799108 0.316734 -0.236780 0.012182 \n", " sqft 0.799108 1.000000 0.229527 -0.235192 0.009825 \n", " pct_white 0.316734 0.229527 1.000000 -0.539401 -0.430646 \n", " pct_black -0.236780 -0.235192 -0.539401 1.000000 0.064810 \n", " pct_asian 0.012182 0.009825 -0.430646 0.064810 1.000000 \n", " pct_hisp -0.302109 -0.161819 -0.699893 0.088286 -0.018038 \n", "Napa rent 1.000000 0.711565 0.268350 -0.016171 -0.095403 \n", " sqft 0.711565 1.000000 0.036981 0.147153 0.224958 \n", " pct_white 0.268350 0.036981 1.000000 -0.382098 -0.723362 \n", " pct_black -0.016171 0.147153 -0.382098 1.000000 0.320864 \n", " pct_asian -0.095403 0.224958 -0.723362 0.320864 1.000000 \n", " pct_hisp -0.276374 -0.350268 -0.388602 -0.025858 -0.276874 \n", "San Francisco rent 1.000000 0.740660 0.264373 -0.038178 -0.227130 \n", " sqft 0.740660 1.000000 -0.008948 -0.011674 0.009207 \n", " pct_white 0.264373 -0.008948 1.000000 -0.376206 -0.810304 \n", " pct_black -0.038178 -0.011674 -0.376206 1.000000 -0.060872 \n", " pct_asian -0.227130 0.009207 -0.810304 -0.060872 1.000000 \n", " pct_hisp -0.118455 0.001649 -0.363823 0.180683 -0.066804 \n", "San Mateo rent 1.000000 0.816791 0.186228 -0.074474 -0.065291 \n", " sqft 0.816791 1.000000 0.095011 -0.063527 0.016771 \n", " pct_white 0.186228 0.095011 1.000000 -0.393266 -0.643022 \n", " pct_black -0.074474 -0.063527 -0.393266 1.000000 0.140799 \n", " pct_asian -0.065291 0.016771 -0.643022 0.140799 1.000000 \n", " pct_hisp -0.174153 -0.126785 -0.462254 0.152291 -0.297553 \n", "Santa Clara rent 1.000000 0.771930 0.110132 -0.180542 0.075833 \n", " sqft 0.771930 1.000000 0.066089 -0.114692 0.030431 \n", " pct_white 0.110132 0.066089 1.000000 -0.051713 -0.813892 \n", " pct_black -0.180542 -0.114692 -0.051713 1.000000 -0.203472 \n", " pct_asian 0.075833 0.030431 -0.813892 -0.203472 1.000000 \n", " pct_hisp -0.286915 -0.129721 0.054657 0.161685 -0.545422 \n", "Solano rent 1.000000 0.816569 0.238070 -0.213447 0.093823 \n", " sqft 0.816569 1.000000 0.176588 -0.170842 -0.008864 \n", " pct_white 0.238070 0.176588 1.000000 -0.722191 -0.597865 \n", " pct_black -0.213447 -0.170842 -0.722191 1.000000 0.256453 \n", " pct_asian 0.093823 -0.008864 -0.597865 0.256453 1.000000 \n", " pct_hisp -0.245141 -0.124703 -0.045126 -0.213463 -0.338282 \n", "Sonoma rent 1.000000 0.823559 0.260039 -0.178540 0.104650 \n", " sqft 0.823559 1.000000 0.246950 -0.130935 0.081570 \n", " pct_white 0.260039 0.246950 1.000000 -0.434451 -0.301256 \n", " pct_black -0.178540 -0.130935 -0.434451 1.000000 0.073768 \n", " pct_asian 0.104650 0.081570 -0.301256 0.073768 1.000000 \n", " pct_hisp -0.288495 -0.307017 -0.794879 0.241904 -0.050895 \n", "\n", " pct_hisp \n", "county_name \n", "Alameda rent -0.307377 \n", " sqft -0.142701 \n", " pct_white -0.192825 \n", " pct_black -0.008881 \n", " pct_asian -0.285257 \n", " pct_hisp 1.000000 \n", "Contra Costa rent -0.354806 \n", " sqft -0.008240 \n", " pct_white -0.432210 \n", " pct_black 0.310377 \n", " pct_asian -0.250950 \n", " pct_hisp 1.000000 \n", "Marin rent -0.302109 \n", " sqft -0.161819 \n", " pct_white -0.699893 \n", " pct_black 0.088286 \n", " pct_asian -0.018038 \n", " pct_hisp 1.000000 \n", "Napa rent -0.276374 \n", " sqft -0.350268 \n", " pct_white -0.388602 \n", " pct_black -0.025858 \n", " pct_asian -0.276874 \n", " pct_hisp 1.000000 \n", "San Francisco rent -0.118455 \n", " sqft 0.001649 \n", " pct_white -0.363823 \n", " pct_black 0.180683 \n", " pct_asian -0.066804 \n", " pct_hisp 1.000000 \n", "San Mateo rent -0.174153 \n", " sqft -0.126785 \n", " pct_white -0.462254 \n", " pct_black 0.152291 \n", " pct_asian -0.297553 \n", " pct_hisp 1.000000 \n", "Santa Clara rent -0.286915 \n", " sqft -0.129721 \n", " pct_white 0.054657 \n", " pct_black 0.161685 \n", " pct_asian -0.545422 \n", " pct_hisp 1.000000 \n", "Solano rent -0.245141 \n", " sqft -0.124703 \n", " pct_white -0.045126 \n", " pct_black -0.213463 \n", " pct_asian -0.338282 \n", " pct_hisp 1.000000 \n", "Sonoma rent -0.288495 \n", " sqft -0.307017 \n", " pct_white -0.794879 \n", " pct_black 0.241904 \n", " pct_asian -0.050895 \n", " pct_hisp 1.000000 " ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Compute correlation coefficients among rent, sqft, pct_white, pct_black, pct_asian and pct_hisp, by county and for the region\n", "\n", "print('Correlations by county')\n", "rentals_sf1.groupby('county_name')[['rent', 'sqft','pct_white', 'pct_black','pct_asian','pct_hisp']].corr()" ] }, { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Correlations for the region\n" ] }, { "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", "
rentsqftpct_whitepct_blackpct_asianpct_hisp
rent1.0000000.6166530.191424-0.2223220.073785-0.290056
sqft0.6166531.0000000.090546-0.045550-0.010680-0.105976
pct_white0.1914240.0905461.000000-0.369745-0.694488-0.209620
pct_black-0.222322-0.045550-0.3697451.000000-0.1733980.084477
pct_asian0.073785-0.010680-0.694488-0.1733981.000000-0.325704
pct_hisp-0.290056-0.105976-0.2096200.084477-0.3257041.000000
\n", "
" ], "text/plain": [ " rent sqft pct_white pct_black pct_asian pct_hisp\n", "rent 1.000000 0.616653 0.191424 -0.222322 0.073785 -0.290056\n", "sqft 0.616653 1.000000 0.090546 -0.045550 -0.010680 -0.105976\n", "pct_white 0.191424 0.090546 1.000000 -0.369745 -0.694488 -0.209620\n", "pct_black -0.222322 -0.045550 -0.369745 1.000000 -0.173398 0.084477\n", "pct_asian 0.073785 -0.010680 -0.694488 -0.173398 1.000000 -0.325704\n", "pct_hisp -0.290056 -0.105976 -0.209620 0.084477 -0.325704 1.000000" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('Correlations for the region')\n", "rentals_sf1[['rent', 'sqft','pct_white', 'pct_black','pct_asian','pct_hisp']].corr()" ] }, { "cell_type": "code", "execution_count": 59, "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", "
countmaxmeanmin
sqft
(220.999, 600.0]6654.03829.01776.498046445.0
(600.0, 695.0]5637.04330.01956.469399600.0
(695.0, 750.0]6431.04750.02077.531333650.0
(750.0, 830.0]5792.06000.02112.290746430.0
(830.0, 901.0]6088.06500.02141.594448650.0
(901.0, 1000.0]7051.08300.02424.039285350.0
(1000.0, 1100.0]5744.07000.02634.580084689.0
(1100.0, 1247.0]5606.08350.02909.535319500.0
(1247.0, 1600.0]6100.09250.03301.863279500.0
(1600.0, 5157.0]6100.010250.04133.284426295.0
\n", "
" ], "text/plain": [ " count max mean min\n", "sqft \n", "(220.999, 600.0] 6654.0 3829.0 1776.498046 445.0\n", "(600.0, 695.0] 5637.0 4330.0 1956.469399 600.0\n", "(695.0, 750.0] 6431.0 4750.0 2077.531333 650.0\n", "(750.0, 830.0] 5792.0 6000.0 2112.290746 430.0\n", "(830.0, 901.0] 6088.0 6500.0 2141.594448 650.0\n", "(901.0, 1000.0] 7051.0 8300.0 2424.039285 350.0\n", "(1000.0, 1100.0] 5744.0 7000.0 2634.580084 689.0\n", "(1100.0, 1247.0] 5606.0 8350.0 2909.535319 500.0\n", "(1247.0, 1600.0] 6100.0 9250.0 3301.863279 500.0\n", "(1600.0, 5157.0] 6100.0 10250.0 4133.284426 295.0" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Redo the statistical profile on rents by categories of sqft range using 10 quantiles rather than 4 equal bins\n", "\n", "q= pd.qcut(rentals_sf1['sqft'], 10)\n", "rentals_sf1['rent'].groupby(q).apply(get_stats).unstack()\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [default]", "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.5.3" } }, "nbformat": 4, "nbformat_minor": 1 }