{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# import json as pandas\n", "import pandas as pd" ] }, { "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", "
Region IDSize RankRegionRegion TypeHome TypeStateMetroState Code FIPSMunicipal Code FIPSDateRent (Smoothed)Rent (Smoothed) (Seasonally Adjusted)CityCounty
066146Ada Countycountyall homes plus multifamilyAda CountyBoise City, ID16.01.02015-01-31927.493763927.493763NoneAda County
166146Ada Countycountyall homes plus multifamilyAda CountyBoise City, ID16.01.02015-02-28931.690623931.690623NoneAda County
266146Ada Countycountyall homes plus multifamilyAda CountyBoise City, ID16.01.02015-03-31932.568601932.568601NoneAda County
366146Ada Countycountyall homes plus multifamilyAda CountyBoise City, ID16.01.02015-04-30933.148134933.148134NoneAda County
466146Ada Countycountyall homes plus multifamilyAda CountyBoise City, ID16.01.02015-05-31941.045724941.045724NoneAda County
.............................................
1258735857850713Cherry Hillcityall homes plus multifamilyCamden CountyPhiladelphia-Camden-Wilmington, PA-NJ-DE-MDNaNNaN2023-08-312291.6048002244.961006Cherry HillNone
1258736857850713Cherry Hillcityall homes plus multifamilyCamden CountyPhiladelphia-Camden-Wilmington, PA-NJ-DE-MDNaNNaN2023-09-302296.1889062254.213172Cherry HillNone
1258737857850713Cherry Hillcityall homes plus multifamilyCamden CountyPhiladelphia-Camden-Wilmington, PA-NJ-DE-MDNaNNaN2023-10-312292.2709382261.540446Cherry HillNone
1258738857850713Cherry Hillcityall homes plus multifamilyCamden CountyPhiladelphia-Camden-Wilmington, PA-NJ-DE-MDNaNNaN2023-11-302253.4171402257.956024Cherry HillNone
1258739857850713Cherry Hillcityall homes plus multifamilyCamden CountyPhiladelphia-Camden-Wilmington, PA-NJ-DE-MDNaNNaN2023-12-312280.8303032280.830303Cherry HillNone
\n", "

1258740 rows × 14 columns

\n", "
" ], "text/plain": [ " Region ID Size Rank Region Region Type \\\n", "0 66 146 Ada County county \n", "1 66 146 Ada County county \n", "2 66 146 Ada County county \n", "3 66 146 Ada County county \n", "4 66 146 Ada County county \n", "... ... ... ... ... \n", "1258735 857850 713 Cherry Hill city \n", "1258736 857850 713 Cherry Hill city \n", "1258737 857850 713 Cherry Hill city \n", "1258738 857850 713 Cherry Hill city \n", "1258739 857850 713 Cherry Hill city \n", "\n", " Home Type State \\\n", "0 all homes plus multifamily Ada County \n", "1 all homes plus multifamily Ada County \n", "2 all homes plus multifamily Ada County \n", "3 all homes plus multifamily Ada County \n", "4 all homes plus multifamily Ada County \n", "... ... ... \n", "1258735 all homes plus multifamily Camden County \n", "1258736 all homes plus multifamily Camden County \n", "1258737 all homes plus multifamily Camden County \n", "1258738 all homes plus multifamily Camden County \n", "1258739 all homes plus multifamily Camden County \n", "\n", " Metro State Code FIPS \\\n", "0 Boise City, ID 16.0 \n", "1 Boise City, ID 16.0 \n", "2 Boise City, ID 16.0 \n", "3 Boise City, ID 16.0 \n", "4 Boise City, ID 16.0 \n", "... ... ... \n", "1258735 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n", "1258736 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n", "1258737 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n", "1258738 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n", "1258739 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n", "\n", " Municipal Code FIPS Date Rent (Smoothed) \\\n", "0 1.0 2015-01-31 927.493763 \n", "1 1.0 2015-02-28 931.690623 \n", "2 1.0 2015-03-31 932.568601 \n", "3 1.0 2015-04-30 933.148134 \n", "4 1.0 2015-05-31 941.045724 \n", "... ... ... ... \n", "1258735 NaN 2023-08-31 2291.604800 \n", "1258736 NaN 2023-09-30 2296.188906 \n", "1258737 NaN 2023-10-31 2292.270938 \n", "1258738 NaN 2023-11-30 2253.417140 \n", "1258739 NaN 2023-12-31 2280.830303 \n", "\n", " Rent (Smoothed) (Seasonally Adjusted) City County \n", "0 927.493763 None Ada County \n", "1 931.690623 None Ada County \n", "2 932.568601 None Ada County \n", "3 933.148134 None Ada County \n", "4 941.045724 None Ada County \n", "... ... ... ... \n", "1258735 2244.961006 Cherry Hill None \n", "1258736 2254.213172 Cherry Hill None \n", "1258737 2261.540446 Cherry Hill None \n", "1258738 2257.956024 Cherry Hill None \n", "1258739 2280.830303 Cherry Hill None \n", "\n", "[1258740 rows x 14 columns]" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# read the data\n", "x = pd.read_json(\"processed/rentals/final5.jsonl\", lines=True)\n", "x" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['county', 'city', 'zip', 'country', 'msa'], dtype=object)" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# get unique values for column\n", "x[\"Region Type\"].unique()" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['all homes plus multifamily', 'SFR', 'multifamily'], dtype=object)" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x[\"Home Type\"].unique()" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['1-Bedroom', '2-Bedrooms', '3-Bedrooms', '4-Bedrooms',\n", " '5+-Bedrooms', 'All Bedrooms'], dtype=object)" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x[\"Bedroom Count\"].unique()" ] } ], "metadata": { "kernelspec": { "display_name": "sta663", "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.12.2" } }, "nbformat": 4, "nbformat_minor": 2 }