Try it
Download notebook
In [ ]:
# Install required packages
!pip install --quiet pandas

import os
import urllib.request
import zipfile

# Download and extract data files
url = 'https://github.com/jsoma/workshop-newsroom-ai-infra/raw/main/docs/04-transfer-data/04-transfers-data.zip'
print(f'Downloading data from {url}...')
urllib.request.urlretrieve(url, '04-transfers-data.zip')

print('Extracting 04-transfers-data.zip...')
with zipfile.ZipFile('04-transfers-data.zip', 'r') as zip_ref:
    zip_ref.extractall('.')

os.remove('04-transfers-data.zip')
print('✓ Data files extracted!')

Analyzing real estate transfers

We aren't doing anything fancy here! But it's just some data analysis we don't want to have to do for other people.

In [2]:
import pandas as pd
pd.options.display.max_columns = None

df = pd.read_csv("data/transfers.csv")
df.head()
/var/folders/25/h3prywj14qb0mlkl2s8bxq5m0000gn/T/ipykernel_81007/422507928.py:4: DtypeWarning: Columns (0: instrument_prefix) have mixed types. Specify dtype option on import or set low_memory=False.
  df = pd.read_csv("data/transfers.csv")
Out[2]:
source_document_id source_title source_url source_period_type source_year source_start_month source_end_month source_schema transfer_date transfer_date_parsed transfer_year transfer_month parcel_id grantor grantee owner owner_or_c_o consideration selling_price transfer_code transfer_description deed_type sale_type physical_address city_state zip instrument_id acreage acreage_units assessment_land assessment_building assessment_improvements assessment_total legal_description_1 legal_description_2 parcel_part_1 parcel_part_2 parcel_part_3 parcel_part_4 parcel_part_5 parcel_part_6 address_number address_unit street_name street_suffix address_extra instrument_prefix instrument_number
0 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 22E1-67- Otis A Bristow III or Wendy D Bristow Otis A Bristow III NaN NaN 0 NaN Q Quitclaim NaN NaN 810 Kilarney DR Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-97 0.00 Acres 75000 62400 11600 149000 Chancellor Green Lot 67 Sec 1 22 E 1 - 67 - 810 NaN Kilarney DR NaN 0.0 97
1 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 22T20-31- Marjorie G Schrader Jannie M Hillian NaN NaN 219900 NaN S Sale NaN NaN 12114 Meadow Branch WAY Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-65 3740.00 Sq.Ft 70000 125900 10500 206400 Oakview (Salem Fields) Lot 31 Sec 3 22 T 20 - 31 - 12114 NaN Meadow Branch WAY NaN 0.0 65
2 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 23C2E1- Joan Coleman & Theresa Coleman Trs The Coleman... Christopher M Alward or Michael G Larson NaN NaN 142000 NaN M Multiple Transfer NaN NaN 5704 Ross DR Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-26 0.21 Acres 55000 38700 10100 103800 Thomas Ross Lot 1 Block E 23 C 2 E 1 - 5704 NaN Ross DR NaN 0.0 26
3 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 23C2E2- Joan Coleman & Theresa Coleman Trs The Coleman... Christopher M Alward or Michael G Larson NaN NaN 142000 NaN M Multiple Transfer NaN NaN 5706 Ross DR Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-26 0.21 Acres 27500 0 0 27500 Thomas Ross Lot 2 Block E 23 C 2 E 2 - 5706 NaN Ross DR NaN 0.0 26
4 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 23H7-61- Walter L Brown or Nedra G Brown Paula J Kelly NaN NaN 209000 NaN S Sale NaN NaN 11517 Sturbridge CT Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-68 5009.00 Sq.Ft 85000 102900 10900 198800 Summerlake Lot 61 Sec 2 23 H 7 - 61 - 11517 NaN Sturbridge CT NaN 0.0 68
In [4]:
df[df['source_year'] == 2017].head()
Out[4]:
source_document_id source_title source_url source_period_type source_year source_start_month source_end_month source_schema transfer_date transfer_date_parsed transfer_year transfer_month parcel_id grantor grantee owner owner_or_c_o consideration selling_price transfer_code transfer_description deed_type sale_type physical_address city_state zip instrument_id acreage acreage_units assessment_land assessment_building assessment_improvements assessment_total legal_description_1 legal_description_2 parcel_part_1 parcel_part_2 parcel_part_3 parcel_part_4 parcel_part_5 parcel_part_6 address_number address_unit street_name street_suffix address_extra instrument_prefix instrument_number
0 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 22E1-67- Otis A Bristow III or Wendy D Bristow Otis A Bristow III NaN NaN 0 NaN Q Quitclaim NaN NaN 810 Kilarney DR Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-97 0.00 Acres 75000 62400 11600 149000 Chancellor Green Lot 67 Sec 1 22 E 1 - 67 - 810 NaN Kilarney DR NaN 0.0 97
1 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 22T20-31- Marjorie G Schrader Jannie M Hillian NaN NaN 219900 NaN S Sale NaN NaN 12114 Meadow Branch WAY Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-65 3740.00 Sq.Ft 70000 125900 10500 206400 Oakview (Salem Fields) Lot 31 Sec 3 22 T 20 - 31 - 12114 NaN Meadow Branch WAY NaN 0.0 65
2 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 23C2E1- Joan Coleman & Theresa Coleman Trs The Coleman... Christopher M Alward or Michael G Larson NaN NaN 142000 NaN M Multiple Transfer NaN NaN 5704 Ross DR Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-26 0.21 Acres 55000 38700 10100 103800 Thomas Ross Lot 1 Block E 23 C 2 E 1 - 5704 NaN Ross DR NaN 0.0 26
3 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 23C2E2- Joan Coleman & Theresa Coleman Trs The Coleman... Christopher M Alward or Michael G Larson NaN NaN 142000 NaN M Multiple Transfer NaN NaN 5706 Ross DR Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-26 0.21 Acres 27500 0 0 27500 Thomas Ross Lot 2 Block E 23 C 2 E 2 - 5706 NaN Ross DR NaN 0.0 26
4 2446 2017 All Transfers XLSX https://www.spotsylvania.va.us/DocumentCenter/... aggregate 2017 1 12 grantor_grantee 01/03/17 2017-01-03 2017 1 23H7-61- Walter L Brown or Nedra G Brown Paula J Kelly NaN NaN 209000 NaN S Sale NaN NaN 11517 Sturbridge CT Fredericksburg, VA 22407 Fredericksburg, VA 22407.0 0000-68 5009.00 Sq.Ft 85000 102900 10900 198800 Summerlake Lot 61 Sec 2 23 H 7 - 61 - 11517 NaN Sturbridge CT NaN 0.0 68
In [5]:
df['assessment_total'].median()
Out[5]:
np.float64(176300.0)