How has Homelessness Changed in the US from 2010 to 2016?

This dataset reports the national estimates of homelessness by state from 2007 - 2018. Estimates of homeless veterans are included from the beginning of 2011. This dataset was obtained from HUD EXCHANGE.

Gather

In [1]:
import pandas as pd
import zipfile
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
% matplotlib inline
In [2]:
with zipfile.ZipFile('homelessness.zip', 'r') as myzip:
    myzip.extractall()
In [3]:
df_homeless = pd.read_csv('2007-2016-Homelessnewss-USA.csv')
df_homeless
Out[3]:
Year State CoC Number CoC Name Measures Count
0 1/1/2007 AK AK-500 Anchorage CoC Chronically Homeless Individuals 224
1 1/1/2007 AK AK-500 Anchorage CoC Homeless Individuals 696
2 1/1/2007 AK AK-500 Anchorage CoC Homeless People in Families 278
3 1/1/2007 AK AK-500 Anchorage CoC Sheltered Chronically Homeless Individuals 187
4 1/1/2007 AK AK-500 Anchorage CoC Sheltered Homeless 842
5 1/1/2007 AK AK-500 Anchorage CoC Sheltered Homeless Individuals 589
6 1/1/2007 AK AK-500 Anchorage CoC Sheltered Homeless People in Families 253
7 1/1/2007 AK AK-500 Anchorage CoC Total Homeless 974
8 1/1/2007 AK AK-500 Anchorage CoC Unsheltered Chronically Homeless Individuals 37
9 1/1/2007 AK AK-500 Anchorage CoC Unsheltered Homeless 132
10 1/1/2007 AK AK-500 Anchorage CoC Unsheltered Homeless Individuals 107
11 1/1/2007 AK AK-500 Anchorage CoC Unsheltered Homeless People in Families 25
12 1/1/2007 AK AK-501 Alaska Balance of State CoC Chronically Homeless Individuals 54
13 1/1/2007 AK AK-501 Alaska Balance of State CoC Homeless Individuals 366
14 1/1/2007 AK AK-501 Alaska Balance of State CoC Homeless People in Families 302
15 1/1/2007 AK AK-501 Alaska Balance of State CoC Sheltered Chronically Homeless Individuals 34
16 1/1/2007 AK AK-501 Alaska Balance of State CoC Sheltered Homeless 545
17 1/1/2007 AK AK-501 Alaska Balance of State CoC Sheltered Homeless Individuals 302
18 1/1/2007 AK AK-501 Alaska Balance of State CoC Sheltered Homeless People in Families 243
19 1/1/2007 AK AK-501 Alaska Balance of State CoC Total Homeless 668
20 1/1/2007 AK AK-501 Alaska Balance of State CoC Unsheltered Chronically Homeless Individuals 20
21 1/1/2007 AK AK-501 Alaska Balance of State CoC Unsheltered Homeless 123
22 1/1/2007 AK AK-501 Alaska Balance of State CoC Unsheltered Homeless Individuals 64
23 1/1/2007 AK AK-501 Alaska Balance of State CoC Unsheltered Homeless People in Families 59
24 1/1/2007 AL AL-500 Birmingham/Jefferson, St. Clair, Shelby Counti... Chronically Homeless Individuals 516
25 1/1/2007 AL AL-500 Birmingham/Jefferson, St. Clair, Shelby Counti... Homeless Individuals 1,529
26 1/1/2007 AL AL-500 Birmingham/Jefferson, St. Clair, Shelby Counti... Homeless People in Families 575
27 1/1/2007 AL AL-500 Birmingham/Jefferson, St. Clair, Shelby Counti... Sheltered Chronically Homeless Individuals 269
28 1/1/2007 AL AL-500 Birmingham/Jefferson, St. Clair, Shelby Counti... Sheltered Homeless 1,240
29 1/1/2007 AL AL-500 Birmingham/Jefferson, St. Clair, Shelby Counti... Sheltered Homeless Individuals 833
... ... ... ... ... ... ...
86499 1/1/2016 WY WY-500 Wyoming Statewide CoC Parenting Youth Under 18 0
86500 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Children of Parenting Youth 14
86501 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Chronically Homeless 33
86502 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Chronically Homeless Individuals 29
86503 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Chronically Homeless People in Families 4
86504 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Homeless 491
86505 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Homeless Individuals 277
86506 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Homeless People in Families 214
86507 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Homeless Unaccompanied Children (Und... 1
86508 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Homeless Unaccompanied Young Adults ... 23
86509 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Homeless Unaccompanied Youth (Under 25) 24
86510 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Homeless Veterans 56
86511 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Parenting Youth (Under 25) 12
86512 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Parenting Youth Age 18-24 12
86513 1/1/2016 WY WY-500 Wyoming Statewide CoC Sheltered Parenting Youth Under 18 0
86514 1/1/2016 WY WY-500 Wyoming Statewide CoC Total Homeless 857
86515 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Children of Parenting Youth 3
86516 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Chronically Homeless 58
86517 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Chronically Homeless Individuals 51
86518 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Chronically Homeless People in Fam... 7
86519 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Homeless 366
86520 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Homeless Individuals 240
86521 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Homeless People in Families 126
86522 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Homeless Unaccompanied Children (U... 2
86523 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Homeless Unaccompanied Young Adult... 5
86524 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Homeless Unaccompanied Youth (Unde... 7
86525 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Homeless Veterans 31
86526 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Parenting Youth (Under 25) 3
86527 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Parenting Youth Age 18-24 3
86528 1/1/2016 WY WY-500 Wyoming Statewide CoC Unsheltered Parenting Youth Under 18 0

86529 rows × 6 columns

Assess

In [4]:
df_homeless.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 86529 entries, 0 to 86528
Data columns (total 6 columns):
Year          86529 non-null object
State         86529 non-null object
CoC Number    86529 non-null object
CoC Name      86529 non-null object
Measures      86529 non-null object
Count         86529 non-null object
dtypes: object(6)
memory usage: 4.0+ MB
In [5]:
df_population = pd.read_csv('Population-by-state.csv')
df_population.head()
Out[5]:
GEO.id GEO.id2 GEO.display-label rescen42010 resbase42010 respop72010 respop72011 respop72012 respop72013 respop72014 respop72015 respop72016
0 Id Id2 Geography April 1, 2010 - Census April 1, 2010 - Estimates Base Population Estimate (as of July 1) - 2010 Population Estimate (as of July 1) - 2011 Population Estimate (as of July 1) - 2012 Population Estimate (as of July 1) - 2013 Population Estimate (as of July 1) - 2014 Population Estimate (as of July 1) - 2015 Population Estimate (as of July 1) - 2016
1 0400000US01 1 Alabama 4779736 4780131 4785492 4799918 4815960 4829479 4843214 4853875 4863300
2 0400000US02 2 Alaska 710231 710249 714031 722713 731089 736879 736705 737709 741894
3 0400000US04 4 Arizona 6392017 6392301 6408312 6467163 6549634 6624617 6719993 6817565 6931071
4 0400000US05 5 Arkansas 2915918 2916025 2921995 2939493 2950685 2958663 2966912 2977853 2988248
In [6]:
df_population.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 53 entries, 0 to 52
Data columns (total 12 columns):
GEO.id               53 non-null object
GEO.id2              53 non-null object
GEO.display-label    53 non-null object
rescen42010          53 non-null object
resbase42010         53 non-null object
respop72010          53 non-null object
respop72011          53 non-null object
respop72012          53 non-null object
respop72013          53 non-null object
respop72014          53 non-null object
respop72015          53 non-null object
respop72016          53 non-null object
dtypes: object(12)
memory usage: 5.0+ KB

Issues

df_homeless

  1. Fix year column in df_homeless to fit YYYY format.
  2. States are abbreviated for df_homeless but are in full in df_population.
  3. Remove the extra states in df_homeless that don't appear in df_population.
  4. Data organized by cities/counties in df_homeless.
  5. Multiple Measures for each state in df_homeless.
  6. Convert 'Count' column from str to int in df_homeless.
  7. Year in df_homeless dataframe should be a column not a row.

df_population

  1. Rename columns for df_population for better clarity.
  2. Delete 0 index row for df_population.
  3. Convert column entries to int.

Clean

df_homeless

In [7]:
# make copy of data set
df_homeless1 = df_homeless.copy()
In [8]:
# drop 'CoC Number' from df_homeless
df_homeless1.drop('CoC Number', axis=1, inplace=True)

Fix year column in df_homeless to fit YYYY format.

In [9]:
# Use only year values for the Year column.
df_homeless1['Year'] = df_homeless1['Year'].str[4:]

States are abbreviated for df_homeless but are in full in df_population.

In [10]:
# Rename State column values
df_homeless2= df_homeless1.replace({'State' : {
    'AL': 'Alabama',
    'AK': 'Alaska',
    'AZ': 'Arizona',
    'AR': 'Arkansas',
    'CA': 'California',
    'CO': 'Colorado',
    'CT': 'Connecticut',
    'DC': 'District of Columbia',
    'DE': 'Delaware',
    'FL': 'Florida',
    'GA': 'Georgia',
    'HI': 'Hawaii',
    'ID': 'Idaho',
    'IL': 'Illinois',
    'IN': 'Indiana',
    'IA': 'Iowa',
    'KS': 'Kansas',
    'KY': 'Kentucky',
    'LA': 'Louisiana',
    'ME': 'Maine',
    'MD': 'Maryland',
    'MA': 'Massachusetts',
    'MI': 'Michigan',
    'MN': 'Minnesota',
    'MS': 'Mississippi',
    'MO': 'Missouri',
    'MT': 'Montana',
    'NE': 'Nebraska',
    'NV': 'Nevada',
    'NH': 'New Hampshire',
    'NJ': 'New Jersey',
    'NM': 'New Mexico',
    'NY': 'New York',
    'NC': 'North Carolina',
    'ND': 'North Dakota',
    'OH': 'Ohio',
    'OK': 'Oklahoma',
    'OR': 'Oregon',
    'PA': 'Pennsylvania',
    'PR': 'Puerto Rico',
    'RI': 'Rhode Island',
    'SC': 'South Carolina',
    'SD': 'South Dakota',
    'TN': 'Tennessee',
    'TX': 'Texas',
    'UT': 'Utah',
    'VT': 'Vermont',
    'VA': 'Virginia',
    'WA': 'Washington',
    'WV': 'West Virginia',
    'WI': 'Wisconsin',
    'WY': 'Wyoming',
    }})
df_homeless2
Out[10]:
Year State CoC Name Measures Count
0 2007 Alaska Anchorage CoC Chronically Homeless Individuals 224
1 2007 Alaska Anchorage CoC Homeless Individuals 696
2 2007 Alaska Anchorage CoC Homeless People in Families 278
3 2007 Alaska Anchorage CoC Sheltered Chronically Homeless Individuals 187
4 2007 Alaska Anchorage CoC Sheltered Homeless 842
5 2007 Alaska Anchorage CoC Sheltered Homeless Individuals 589
6 2007 Alaska Anchorage CoC Sheltered Homeless People in Families 253
7 2007 Alaska Anchorage CoC Total Homeless 974
8 2007 Alaska Anchorage CoC Unsheltered Chronically Homeless Individuals 37
9 2007 Alaska Anchorage CoC Unsheltered Homeless 132
10 2007 Alaska Anchorage CoC Unsheltered Homeless Individuals 107
11 2007 Alaska Anchorage CoC Unsheltered Homeless People in Families 25
12 2007 Alaska Alaska Balance of State CoC Chronically Homeless Individuals 54
13 2007 Alaska Alaska Balance of State CoC Homeless Individuals 366
14 2007 Alaska Alaska Balance of State CoC Homeless People in Families 302
15 2007 Alaska Alaska Balance of State CoC Sheltered Chronically Homeless Individuals 34
16 2007 Alaska Alaska Balance of State CoC Sheltered Homeless 545
17 2007 Alaska Alaska Balance of State CoC Sheltered Homeless Individuals 302
18 2007 Alaska Alaska Balance of State CoC Sheltered Homeless People in Families 243
19 2007 Alaska Alaska Balance of State CoC Total Homeless 668
20 2007 Alaska Alaska Balance of State CoC Unsheltered Chronically Homeless Individuals 20
21 2007 Alaska Alaska Balance of State CoC Unsheltered Homeless 123
22 2007 Alaska Alaska Balance of State CoC Unsheltered Homeless Individuals 64
23 2007 Alaska Alaska Balance of State CoC Unsheltered Homeless People in Families 59
24 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Chronically Homeless Individuals 516
25 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Homeless Individuals 1,529
26 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Homeless People in Families 575
27 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Sheltered Chronically Homeless Individuals 269
28 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Sheltered Homeless 1,240
29 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Sheltered Homeless Individuals 833
... ... ... ... ... ...
86499 2016 Wyoming Wyoming Statewide CoC Parenting Youth Under 18 0
86500 2016 Wyoming Wyoming Statewide CoC Sheltered Children of Parenting Youth 14
86501 2016 Wyoming Wyoming Statewide CoC Sheltered Chronically Homeless 33
86502 2016 Wyoming Wyoming Statewide CoC Sheltered Chronically Homeless Individuals 29
86503 2016 Wyoming Wyoming Statewide CoC Sheltered Chronically Homeless People in Families 4
86504 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless 491
86505 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Individuals 277
86506 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless People in Families 214
86507 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Unaccompanied Children (Und... 1
86508 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Unaccompanied Young Adults ... 23
86509 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Unaccompanied Youth (Under 25) 24
86510 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Veterans 56
86511 2016 Wyoming Wyoming Statewide CoC Sheltered Parenting Youth (Under 25) 12
86512 2016 Wyoming Wyoming Statewide CoC Sheltered Parenting Youth Age 18-24 12
86513 2016 Wyoming Wyoming Statewide CoC Sheltered Parenting Youth Under 18 0
86514 2016 Wyoming Wyoming Statewide CoC Total Homeless 857
86515 2016 Wyoming Wyoming Statewide CoC Unsheltered Children of Parenting Youth 3
86516 2016 Wyoming Wyoming Statewide CoC Unsheltered Chronically Homeless 58
86517 2016 Wyoming Wyoming Statewide CoC Unsheltered Chronically Homeless Individuals 51
86518 2016 Wyoming Wyoming Statewide CoC Unsheltered Chronically Homeless People in Fam... 7
86519 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless 366
86520 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Individuals 240
86521 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless People in Families 126
86522 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Unaccompanied Children (U... 2
86523 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Unaccompanied Young Adult... 5
86524 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Unaccompanied Youth (Unde... 7
86525 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Veterans 31
86526 2016 Wyoming Wyoming Statewide CoC Unsheltered Parenting Youth (Under 25) 3
86527 2016 Wyoming Wyoming Statewide CoC Unsheltered Parenting Youth Age 18-24 3
86528 2016 Wyoming Wyoming Statewide CoC Unsheltered Parenting Youth Under 18 0

86529 rows × 5 columns

Remove the extra states in df_homeless that don't appear in df_population.

In [11]:
# drop "VI" entries in State column
df_homeless2.drop(df_homeless2[df_homeless2.State == "VI"].index, inplace=True)
In [12]:
# drop "GU" entries in State column
df_homeless2.drop(df_homeless2[df_homeless2.State == "GU"].index, inplace=True)
In [13]:
# find all unique entries in State column
df_homeless2.State.unique()
Out[13]:
array(['Alaska', 'Alabama', 'Arkansas', 'Arizona', 'California',
       'Colorado', 'Connecticut', 'District of Columbia', 'Delaware',
       'Florida', 'Georgia', 'Hawaii', 'Iowa', 'Idaho', 'Illinois',
       'Indiana', 'Kansas', 'Kentucky', 'Louisiana', 'Massachusetts',
       'Maryland', 'Maine', 'Michigan', 'Minnesota', 'Missouri',
       'Mississippi', 'Montana', 'North Carolina', 'North Dakota',
       'Nebraska', 'New Hampshire', 'New Jersey', 'New Mexico', 'Nevada',
       'New York', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania',
       'Puerto Rico', 'Rhode Island', 'South Carolina', 'South Dakota',
       'Tennessee', 'Texas', 'Utah', 'Virginia', 'Vermont', 'Washington',
       'Wisconsin', 'West Virginia', 'Wyoming'], dtype=object)
In [14]:
# reset index
df_homeless2.reset_index(drop=True)
Out[14]:
Year State CoC Name Measures Count
0 2007 Alaska Anchorage CoC Chronically Homeless Individuals 224
1 2007 Alaska Anchorage CoC Homeless Individuals 696
2 2007 Alaska Anchorage CoC Homeless People in Families 278
3 2007 Alaska Anchorage CoC Sheltered Chronically Homeless Individuals 187
4 2007 Alaska Anchorage CoC Sheltered Homeless 842
5 2007 Alaska Anchorage CoC Sheltered Homeless Individuals 589
6 2007 Alaska Anchorage CoC Sheltered Homeless People in Families 253
7 2007 Alaska Anchorage CoC Total Homeless 974
8 2007 Alaska Anchorage CoC Unsheltered Chronically Homeless Individuals 37
9 2007 Alaska Anchorage CoC Unsheltered Homeless 132
10 2007 Alaska Anchorage CoC Unsheltered Homeless Individuals 107
11 2007 Alaska Anchorage CoC Unsheltered Homeless People in Families 25
12 2007 Alaska Alaska Balance of State CoC Chronically Homeless Individuals 54
13 2007 Alaska Alaska Balance of State CoC Homeless Individuals 366
14 2007 Alaska Alaska Balance of State CoC Homeless People in Families 302
15 2007 Alaska Alaska Balance of State CoC Sheltered Chronically Homeless Individuals 34
16 2007 Alaska Alaska Balance of State CoC Sheltered Homeless 545
17 2007 Alaska Alaska Balance of State CoC Sheltered Homeless Individuals 302
18 2007 Alaska Alaska Balance of State CoC Sheltered Homeless People in Families 243
19 2007 Alaska Alaska Balance of State CoC Total Homeless 668
20 2007 Alaska Alaska Balance of State CoC Unsheltered Chronically Homeless Individuals 20
21 2007 Alaska Alaska Balance of State CoC Unsheltered Homeless 123
22 2007 Alaska Alaska Balance of State CoC Unsheltered Homeless Individuals 64
23 2007 Alaska Alaska Balance of State CoC Unsheltered Homeless People in Families 59
24 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Chronically Homeless Individuals 516
25 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Homeless Individuals 1,529
26 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Homeless People in Families 575
27 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Sheltered Chronically Homeless Individuals 269
28 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Sheltered Homeless 1,240
29 2007 Alabama Birmingham/Jefferson, St. Clair, Shelby Counti... Sheltered Homeless Individuals 833
... ... ... ... ... ...
86067 2016 Wyoming Wyoming Statewide CoC Parenting Youth Under 18 0
86068 2016 Wyoming Wyoming Statewide CoC Sheltered Children of Parenting Youth 14
86069 2016 Wyoming Wyoming Statewide CoC Sheltered Chronically Homeless 33
86070 2016 Wyoming Wyoming Statewide CoC Sheltered Chronically Homeless Individuals 29
86071 2016 Wyoming Wyoming Statewide CoC Sheltered Chronically Homeless People in Families 4
86072 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless 491
86073 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Individuals 277
86074 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless People in Families 214
86075 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Unaccompanied Children (Und... 1
86076 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Unaccompanied Young Adults ... 23
86077 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Unaccompanied Youth (Under 25) 24
86078 2016 Wyoming Wyoming Statewide CoC Sheltered Homeless Veterans 56
86079 2016 Wyoming Wyoming Statewide CoC Sheltered Parenting Youth (Under 25) 12
86080 2016 Wyoming Wyoming Statewide CoC Sheltered Parenting Youth Age 18-24 12
86081 2016 Wyoming Wyoming Statewide CoC Sheltered Parenting Youth Under 18 0
86082 2016 Wyoming Wyoming Statewide CoC Total Homeless 857
86083 2016 Wyoming Wyoming Statewide CoC Unsheltered Children of Parenting Youth 3
86084 2016 Wyoming Wyoming Statewide CoC Unsheltered Chronically Homeless 58
86085 2016 Wyoming Wyoming Statewide CoC Unsheltered Chronically Homeless Individuals 51
86086 2016 Wyoming Wyoming Statewide CoC Unsheltered Chronically Homeless People in Fam... 7
86087 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless 366
86088 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Individuals 240
86089 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless People in Families 126
86090 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Unaccompanied Children (U... 2
86091 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Unaccompanied Young Adult... 5
86092 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Unaccompanied Youth (Unde... 7
86093 2016 Wyoming Wyoming Statewide CoC Unsheltered Homeless Veterans 31
86094 2016 Wyoming Wyoming Statewide CoC Unsheltered Parenting Youth (Under 25) 3
86095 2016 Wyoming Wyoming Statewide CoC Unsheltered Parenting Youth Age 18-24 3
86096 2016 Wyoming Wyoming Statewide CoC Unsheltered Parenting Youth Under 18 0

86097 rows × 5 columns

In [15]:
# ensure that unwanted entries have been removed
df_homeless2.shape
Out[15]:
(86097, 5)

Data organized by cities/counties in df_homeless.

In [16]:
# drop CoC Name column
df_homeless2.drop('CoC Name', axis=1, inplace=True)
In [17]:
# make copy of df_homeless2
df_homeless_measures = df_homeless2.copy()

Multiple Measures for each state in df_homeless.

In [18]:
# drop Measures column
df_homeless2.drop('Measures', axis=1, inplace=True)

Convert 'Count' column from str to int in df_homeless.

In [19]:
# remove commas from Count column
df_homeless2['Count'] = df_homeless2['Count'].str.replace(',', '')
In [20]:
# convert all entries in Count column from string to integer
df_homeless2['Count'] = pd.to_numeric(df_homeless2['Count'])
In [21]:
# sum Count by state and year
d = {'Count': 'sum'}
df_homeless3 = df_homeless2.groupby(['Year', 'State']).aggregate(d)
df_homeless3
Out[21]:
Count
Year State
2007 Alabama 23794
Alaska 7124
Arizona 64192
Arkansas 17048
California 636626
Colorado 61000
Connecticut 19974
Delaware 4544
District of Columbia 24800
Florida 207202
Georgia 83524
Hawaii 25836
Idaho 7186
Illinois 67310
Indiana 30820
Iowa 11550
Kansas 7968
Kentucky 33392
Louisiana 23100
Maine 10746
Maryland 41612
Massachusetts 66088
Michigan 118612
Minnesota 32120
Mississippi 6694
Missouri 28224
Montana 4766
Nebraska 15694
Nevada 36310
New Hampshire 9726
... ... ...
2016 Michigan 46678
Minnesota 38104
Mississippi 8414
Missouri 35318
Montana 7082
Nebraska 13562
Nevada 39590
New Hampshire 7404
New Jersey 43862
New Mexico 12930
New York 398450
North Carolina 47676
North Dakota 4788
Ohio 50656
Oklahoma 21908
Oregon 75044
Pennsylvania 76154
Puerto Rico 25914
Rhode Island 5796
South Carolina 27040
South Dakota 5138
Tennessee 46292
Texas 118182
Utah 13386
Vermont 5762
Virginia 31262
Washington 103862
West Virginia 7020
Wisconsin 27656
Wyoming 4184

520 rows × 1 columns

In [22]:
# pivot table
df_homeless4 = pd.pivot_table(df_homeless3, values='Count', index=['State'], columns=['Year'], aggfunc=np.sum)
df_homeless4
Out[22]:
Year 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
State
Alabama 23794 23652 26698 26270 28006 25764 23210 22244 20338 20100
Alaska 7124 7462 8614 7780 10100 9280 8940 8316 9806 9332
Arizona 64192 56146 63342 58714 54204 55744 49444 47532 51024 49880
Arkansas 17048 14806 12220 11838 16946 19328 18580 14542 14524 13190
California 636626 626632 557536 556390 672434 643038 632446 604312 661882 668516
Colorado 61000 61152 63644 64792 70592 77868 47506 48102 52620 55552
Connecticut 19974 20258 20068 18818 23106 21276 22658 23250 19882 18814
Delaware 4544 4228 4854 4122 4530 4564 4246 4154 4684 5074
District of Columbia 24800 28544 28758 30376 37250 38138 36566 39920 40520 44816
Florida 207202 217788 240520 248668 284588 271558 241046 207228 189254 174246
Georgia 83524 81722 88982 86614 106710 102030 83822 80986 69504 64516
Hawaii 25836 25800 24672 24938 29502 29794 31176 34062 39778 42594
Idaho 7186 5948 8176 9606 10528 9400 8624 9822 10008 11644
Illinois 67310 64010 60644 61840 68450 67694 62530 60848 68584 57524
Indiana 30820 30972 29466 27358 28620 28590 28190 27718 30046 28980
Iowa 11550 13938 14132 12554 14474 13374 14102 13868 15328 14774
Kansas 7968 6596 7070 7562 11158 11786 11256 11836 11740 10008
Kentucky 33392 33832 25338 27882 28544 24316 24358 24464 22652 20890
Louisiana 23100 23150 59646 59558 56796 44458 26514 22402 22210 21046
Maine 10746 10792 10148 9968 10890 10736 13096 12184 11600 11044
Maryland 41612 39854 50916 47738 49424 44678 40086 39692 45286 39480
Massachusetts 66088 62728 65802 70598 77436 80586 87082 100720 104206 94740
Michigan 118612 118534 59318 55880 61714 57882 52732 56324 53686 46678
Minnesota 32120 33650 33770 34456 38326 38466 38954 39082 41144 38104
Mississippi 6694 9598 12232 11686 11518 12144 11932 10590 9766 8414
Missouri 28224 33910 30594 35978 44338 50454 41926 35782 35066 35318
Montana 4766 5944 5104 6750 8870 9530 9038 8572 9012 7082
Nebraska 15694 17354 15862 16578 16820 17658 14602 14290 14036 13562
Nevada 36310 36812 46950 47650 44492 43346 32632 39220 48648 39590
New Hampshire 9726 8950 7240 6948 7032 7334 7058 7198 7908 7404
New Jersey 74306 57866 54544 56702 61990 57388 54036 53540 52456 43862
New Mexico 13482 13482 15458 15458 19600 17958 13862 14456 14944 12930
New York 263356 254678 252828 270942 282142 307774 344306 356292 412672 398450
North Carolina 50498 53298 54652 51722 59984 63406 58286 54016 53682 47676
North Dakota 2704 2562 3232 3324 2960 3416 9474 5794 6692 4788
Ohio 49672 56152 55406 54756 62734 66324 58736 55688 56932 50656
Oklahoma 18442 16506 20660 22156 22384 23212 21382 20264 20358 21908
Oregon 76018 89304 74920 83170 86920 79232 70448 62020 78126 75044
Pennsylvania 68058 64756 63980 61112 70044 70280 69992 70582 78154 76154
Puerto Rico 23044 17882 20670 21032 26130 26084 25196 24954 26370 25914
Rhode Island 5756 5274 6868 5300 5230 5916 6734 5792 5594 5796
South Carolina 23786 24126 19240 19240 24176 22858 29380 22726 28080 27040
South Dakota 2524 2524 3142 3142 3658 4236 5494 4276 5498 5138
Tennessee 50374 45548 47392 46094 45410 49338 48970 48724 48122 46292
Texas 175014 178448 159084 153508 190318 171536 148356 141080 123526 118182
Utah 13646 15140 16580 13948 14742 16540 15578 14646 14450 13386
Vermont 4522 4284 5124 5146 5194 5770 6940 7608 7604 5762
Virginia 42910 37232 38650 39340 43698 42042 37362 33404 36054 31262
Washington 98722 93962 96346 95724 94264 93818 82460 86774 97496 103862
West Virginia 11938 8838 7342 10088 10644 11816 11346 10646 10224 7020
Wisconsin 23970 23170 27532 26786 26342 27134 27604 27356 29836 27656
Wyoming 2224 3138 2218 2518 4734 9682 5062 3836 4060 4184

Drop 2007-2009 columns in df_homeless

In [23]:
# drop columns due df_population data set 
df_homeless4.drop(['2007', '2008', '2009'], axis=1, inplace=True)
df_homeless4
Out[23]:
Year 2010 2011 2012 2013 2014 2015 2016
State
Alabama 26270 28006 25764 23210 22244 20338 20100
Alaska 7780 10100 9280 8940 8316 9806 9332
Arizona 58714 54204 55744 49444 47532 51024 49880
Arkansas 11838 16946 19328 18580 14542 14524 13190
California 556390 672434 643038 632446 604312 661882 668516
Colorado 64792 70592 77868 47506 48102 52620 55552
Connecticut 18818 23106 21276 22658 23250 19882 18814
Delaware 4122 4530 4564 4246 4154 4684 5074
District of Columbia 30376 37250 38138 36566 39920 40520 44816
Florida 248668 284588 271558 241046 207228 189254 174246
Georgia 86614 106710 102030 83822 80986 69504 64516
Hawaii 24938 29502 29794 31176 34062 39778 42594
Idaho 9606 10528 9400 8624 9822 10008 11644
Illinois 61840 68450 67694 62530 60848 68584 57524
Indiana 27358 28620 28590 28190 27718 30046 28980
Iowa 12554 14474 13374 14102 13868 15328 14774
Kansas 7562 11158 11786 11256 11836 11740 10008
Kentucky 27882 28544 24316 24358 24464 22652 20890
Louisiana 59558 56796 44458 26514 22402 22210 21046
Maine 9968 10890 10736 13096 12184 11600 11044
Maryland 47738 49424 44678 40086 39692 45286 39480
Massachusetts 70598 77436 80586 87082 100720 104206 94740
Michigan 55880 61714 57882 52732 56324 53686 46678
Minnesota 34456 38326 38466 38954 39082 41144 38104
Mississippi 11686 11518 12144 11932 10590 9766 8414
Missouri 35978 44338 50454 41926 35782 35066 35318
Montana 6750 8870 9530 9038 8572 9012 7082
Nebraska 16578 16820 17658 14602 14290 14036 13562
Nevada 47650 44492 43346 32632 39220 48648 39590
New Hampshire 6948 7032 7334 7058 7198 7908 7404
New Jersey 56702 61990 57388 54036 53540 52456 43862
New Mexico 15458 19600 17958 13862 14456 14944 12930
New York 270942 282142 307774 344306 356292 412672 398450
North Carolina 51722 59984 63406 58286 54016 53682 47676
North Dakota 3324 2960 3416 9474 5794 6692 4788
Ohio 54756 62734 66324 58736 55688 56932 50656
Oklahoma 22156 22384 23212 21382 20264 20358 21908
Oregon 83170 86920 79232 70448 62020 78126 75044
Pennsylvania 61112 70044 70280 69992 70582 78154 76154
Puerto Rico 21032 26130 26084 25196 24954 26370 25914
Rhode Island 5300 5230 5916 6734 5792 5594 5796
South Carolina 19240 24176 22858 29380 22726 28080 27040
South Dakota 3142 3658 4236 5494 4276 5498 5138
Tennessee 46094 45410 49338 48970 48724 48122 46292
Texas 153508 190318 171536 148356 141080 123526 118182
Utah 13948 14742 16540 15578 14646 14450 13386
Vermont 5146 5194 5770 6940 7608 7604 5762
Virginia 39340 43698 42042 37362 33404 36054 31262
Washington 95724 94264 93818 82460 86774 97496 103862
West Virginia 10088 10644 11816 11346 10646 10224 7020
Wisconsin 26786 26342 27134 27604 27356 29836 27656
Wyoming 2518 4734 9682 5062 3836 4060 4184

df_population

Rename columns in df_population.

In [24]:
# rename columns
df_population1 = df_population.rename(columns={'GEO.display-label': 'State', 'respop72010': '2010', 'respop72011': '2011', 'respop72012': '2012', 'respop72013': '2013', 'respop72014': '2014', 'respop72015': '2015', 'respop72016': '2016'})

Delete 0 index row for df_population.

In [25]:
# drop first row [0] of df_population
df_population1.drop([0], inplace=True)
In [26]:
# drop first 'rescen42010' from df_population
df_population1.drop('rescen42010', axis=1, inplace=True)
In [27]:
# drop first 'resbase42010' from df_population
df_population1.drop('resbase42010', axis=1, inplace=True)
In [28]:
# drop first 'GEO.id' from df_population
df_population1.drop('GEO.id', axis=1, inplace=True)
In [29]:
# drop first 'GEO.id2' from df_population
df_population1.drop('GEO.id2', axis=1, inplace=True)
df_population1
Out[29]:
State 2010 2011 2012 2013 2014 2015 2016
1 Alabama 4785492 4799918 4815960 4829479 4843214 4853875 4863300
2 Alaska 714031 722713 731089 736879 736705 737709 741894
3 Arizona 6408312 6467163 6549634 6624617 6719993 6817565 6931071
4 Arkansas 2921995 2939493 2950685 2958663 2966912 2977853 2988248
5 California 37332685 37676861 38011074 38335203 38680810 38993940 39250017
6 Colorado 5048644 5118360 5189867 5267603 5349648 5448819 5540545
7 Connecticut 3579899 3589893 3593795 3596003 3591873 3584730 3576452
8 Delaware 899816 907924 916993 925395 934948 944076 952065
9 District of Columbia 605183 620477 635327 649165 659005 670377 681170
10 Florida 18849098 19096952 19344156 19582022 19888741 20244914 20612439
11 Georgia 9713521 9811610 9914668 9984938 10087231 10199398 10310371
12 Hawaii 1363945 1377864 1391820 1406481 1416349 1425157 1428557
13 Idaho 1571010 1584143 1595911 1612011 1633532 1652828 1683140
14 Illinois 12841578 12860012 12870798 12879505 12867544 12839047 12801539
15 Indiana 6490528 6516480 6537743 6569102 6595233 6612768 6633053
16 Iowa 3050738 3065223 3076310 3091930 3108030 3121997 3134693
17 Kansas 2858850 2869503 2885262 2892821 2899360 2906721 2907289
18 Kentucky 4348662 4369354 4384799 4400477 4413057 4424611 4436974
19 Louisiana 4544996 4575404 4603429 4626402 4647880 4668960 4681666
20 Maine 1327730 1328231 1328895 1329076 1330719 1329453 1331479
21 Maryland 5788584 5843603 5889651 5931129 5967295 5994983 6016447
22 Massachusetts 6565524 6611923 6658008 6706786 6749911 6784240 6811779
23 Michigan 9877495 9876213 9887238 9898982 9915767 9917715 9928300
24 Minnesota 5311147 5348562 5380285 5418521 5453109 5482435 5519952
25 Mississippi 2970322 2978162 2984945 2990482 2992400 2989390 2988726
26 Missouri 5996118 6010717 6025415 6042711 6060930 6076204 6093000
27 Montana 990641 997821 1005196 1014314 1022867 1032073 1042520
28 Nebraska 1830051 1842283 1855725 1868559 1881145 1893765 1907116
29 Nevada 2703284 2718379 2752565 2786464 2833013 2883758 2940058
30 New Hampshire 1316872 1318473 1321182 1322687 1328743 1330111 1334795
31 New Jersey 8803729 8841243 8873211 8899162 8925001 8935421 8944469
32 New Mexico 2064756 2077756 2083784 2085193 2083024 2080328 2081015
33 New York 19402640 19519529 19602769 19673546 19718515 19747183 19745289
34 North Carolina 9558915 9650963 9746175 9841590 9934399 10035186 10146788
35 North Dakota 674526 685476 702087 724019 739904 756835 757952
36 Ohio 11540983 11544824 11550839 11570022 11594408 11605090 11614373
37 Oklahoma 3759603 3786274 3817054 3852415 3877499 3907414 3923561
38 Oregon 3838048 3868031 3899116 3925751 3968371 4024634 4093465
39 Pennsylvania 12712343 12744293 12771854 12781338 12790565 12791904 12784227
40 Rhode Island 1053337 1052451 1052901 1053033 1054480 1055607 1056426
41 South Carolina 4635943 4672637 4720760 4767894 4828430 4894834 4961119
42 South Dakota 816325 824398 834441 844922 852561 857919 865454
43 Tennessee 6356671 6397634 6454306 6494821 6544663 6595056 6651194
44 Texas 25244310 25646389 26071655 26473525 26944751 27429639 27862596
45 Utah 2775326 2816124 2855782 2902663 2941836 2990632 3051217
46 Vermont 625982 626730 626444 627140 626984 626088 624594
47 Virginia 8025773 8110035 8192048 8262692 8317372 8367587 8411808
48 Washington 6743226 6822520 6895226 6968006 7054196 7160290 7288000
49 West Virginia 1854230 1854972 1856560 1853231 1848514 1841053 1831102
50 Wisconsin 5690263 5709640 5726177 5742854 5758377 5767891 5778708
51 Wyoming 564513 567725 576765 582684 583642 586555 585501
52 Puerto Rico 3721525 3678732 3634488 3593077 3534874 3473181 3411307
In [30]:
# Make the state column the index
df_population1.set_index("State", inplace = True)
df_population1
Out[30]:
2010 2011 2012 2013 2014 2015 2016
State
Alabama 4785492 4799918 4815960 4829479 4843214 4853875 4863300
Alaska 714031 722713 731089 736879 736705 737709 741894
Arizona 6408312 6467163 6549634 6624617 6719993 6817565 6931071
Arkansas 2921995 2939493 2950685 2958663 2966912 2977853 2988248
California 37332685 37676861 38011074 38335203 38680810 38993940 39250017
Colorado 5048644 5118360 5189867 5267603 5349648 5448819 5540545
Connecticut 3579899 3589893 3593795 3596003 3591873 3584730 3576452
Delaware 899816 907924 916993 925395 934948 944076 952065
District of Columbia 605183 620477 635327 649165 659005 670377 681170
Florida 18849098 19096952 19344156 19582022 19888741 20244914 20612439
Georgia 9713521 9811610 9914668 9984938 10087231 10199398 10310371
Hawaii 1363945 1377864 1391820 1406481 1416349 1425157 1428557
Idaho 1571010 1584143 1595911 1612011 1633532 1652828 1683140
Illinois 12841578 12860012 12870798 12879505 12867544 12839047 12801539
Indiana 6490528 6516480 6537743 6569102 6595233 6612768 6633053
Iowa 3050738 3065223 3076310 3091930 3108030 3121997 3134693
Kansas 2858850 2869503 2885262 2892821 2899360 2906721 2907289
Kentucky 4348662 4369354 4384799 4400477 4413057 4424611 4436974
Louisiana 4544996 4575404 4603429 4626402 4647880 4668960 4681666
Maine 1327730 1328231 1328895 1329076 1330719 1329453 1331479
Maryland 5788584 5843603 5889651 5931129 5967295 5994983 6016447
Massachusetts 6565524 6611923 6658008 6706786 6749911 6784240 6811779
Michigan 9877495 9876213 9887238 9898982 9915767 9917715 9928300
Minnesota 5311147 5348562 5380285 5418521 5453109 5482435 5519952
Mississippi 2970322 2978162 2984945 2990482 2992400 2989390 2988726
Missouri 5996118 6010717 6025415 6042711 6060930 6076204 6093000
Montana 990641 997821 1005196 1014314 1022867 1032073 1042520
Nebraska 1830051 1842283 1855725 1868559 1881145 1893765 1907116
Nevada 2703284 2718379 2752565 2786464 2833013 2883758 2940058
New Hampshire 1316872 1318473 1321182 1322687 1328743 1330111 1334795
New Jersey 8803729 8841243 8873211 8899162 8925001 8935421 8944469
New Mexico 2064756 2077756 2083784 2085193 2083024 2080328 2081015
New York 19402640 19519529 19602769 19673546 19718515 19747183 19745289
North Carolina 9558915 9650963 9746175 9841590 9934399 10035186 10146788
North Dakota 674526 685476 702087 724019 739904 756835 757952
Ohio 11540983 11544824 11550839 11570022 11594408 11605090 11614373
Oklahoma 3759603 3786274 3817054 3852415 3877499 3907414 3923561
Oregon 3838048 3868031 3899116 3925751 3968371 4024634 4093465
Pennsylvania 12712343 12744293 12771854 12781338 12790565 12791904 12784227
Rhode Island 1053337 1052451 1052901 1053033 1054480 1055607 1056426
South Carolina 4635943 4672637 4720760 4767894 4828430 4894834 4961119
South Dakota 816325 824398 834441 844922 852561 857919 865454
Tennessee 6356671 6397634 6454306 6494821 6544663 6595056 6651194
Texas 25244310 25646389 26071655 26473525 26944751 27429639 27862596
Utah 2775326 2816124 2855782 2902663 2941836 2990632 3051217
Vermont 625982 626730 626444 627140 626984 626088 624594
Virginia 8025773 8110035 8192048 8262692 8317372 8367587 8411808
Washington 6743226 6822520 6895226 6968006 7054196 7160290 7288000
West Virginia 1854230 1854972 1856560 1853231 1848514 1841053 1831102
Wisconsin 5690263 5709640 5726177 5742854 5758377 5767891 5778708
Wyoming 564513 567725 576765 582684 583642 586555 585501
Puerto Rico 3721525 3678732 3634488 3593077 3534874 3473181 3411307
In [31]:
# Convert to int
df_population2 = df_population1.apply(pd.to_numeric)

Check

In [32]:
# Check info for df_homeless
df_homeless4.info()
<class 'pandas.core.frame.DataFrame'>
Index: 52 entries, Alabama to Wyoming
Data columns (total 7 columns):
2010    52 non-null int64
2011    52 non-null int64
2012    52 non-null int64
2013    52 non-null int64
2014    52 non-null int64
2015    52 non-null int64
2016    52 non-null int64
dtypes: int64(7)
memory usage: 3.2+ KB
In [33]:
# Check info for df_population
df_population2.info()
<class 'pandas.core.frame.DataFrame'>
Index: 52 entries, Alabama to Puerto Rico
Data columns (total 7 columns):
2010    52 non-null int64
2011    52 non-null int64
2012    52 non-null int64
2013    52 non-null int64
2014    52 non-null int64
2015    52 non-null int64
2016    52 non-null int64
dtypes: int64(7)
memory usage: 3.2+ KB
In [34]:
# Calculate percentage homeless
df_percentage_homeless = df_homeless4/df_population2
df_percentage_homeless
Out[34]:
Year 2010 2011 2012 2013 2014 2015 2016
State
Alabama 0.005490 0.005835 0.005350 0.004806 0.004593 0.004190 0.004133
Alaska 0.010896 0.013975 0.012693 0.012132 0.011288 0.013293 0.012579
Arizona 0.009162 0.008381 0.008511 0.007464 0.007073 0.007484 0.007197
Arkansas 0.004051 0.005765 0.006550 0.006280 0.004901 0.004877 0.004414
California 0.014904 0.017847 0.016917 0.016498 0.015623 0.016974 0.017032
Colorado 0.012834 0.013792 0.015004 0.009019 0.008992 0.009657 0.010026
Connecticut 0.005257 0.006436 0.005920 0.006301 0.006473 0.005546 0.005261
Delaware 0.004581 0.004989 0.004977 0.004588 0.004443 0.004961 0.005329
District of Columbia 0.050193 0.060034 0.060029 0.056328 0.060576 0.060444 0.065793
Florida 0.013193 0.014902 0.014038 0.012310 0.010419 0.009348 0.008453
Georgia 0.008917 0.010876 0.010291 0.008395 0.008029 0.006815 0.006257
Hawaii 0.018284 0.021411 0.021407 0.022166 0.024049 0.027911 0.029816
Idaho 0.006115 0.006646 0.005890 0.005350 0.006013 0.006055 0.006918
Illinois 0.004816 0.005323 0.005260 0.004855 0.004729 0.005342 0.004494
Indiana 0.004215 0.004392 0.004373 0.004291 0.004203 0.004544 0.004369
Iowa 0.004115 0.004722 0.004347 0.004561 0.004462 0.004910 0.004713
Kansas 0.002645 0.003888 0.004085 0.003891 0.004082 0.004039 0.003442
Kentucky 0.006412 0.006533 0.005546 0.005535 0.005544 0.005120 0.004708
Louisiana 0.013104 0.012413 0.009658 0.005731 0.004820 0.004757 0.004495
Maine 0.007508 0.008199 0.008079 0.009853 0.009156 0.008725 0.008295
Maryland 0.008247 0.008458 0.007586 0.006759 0.006652 0.007554 0.006562
Massachusetts 0.010753 0.011712 0.012104 0.012984 0.014922 0.015360 0.013908
Michigan 0.005657 0.006249 0.005854 0.005327 0.005680 0.005413 0.004702
Minnesota 0.006487 0.007166 0.007149 0.007189 0.007167 0.007505 0.006903
Mississippi 0.003934 0.003867 0.004068 0.003990 0.003539 0.003267 0.002815
Missouri 0.006000 0.007376 0.008374 0.006938 0.005904 0.005771 0.005796
Montana 0.006814 0.008889 0.009481 0.008910 0.008380 0.008732 0.006793
Nebraska 0.009059 0.009130 0.009515 0.007815 0.007596 0.007412 0.007111
Nevada 0.017627 0.016367 0.015747 0.011711 0.013844 0.016870 0.013466
New Hampshire 0.005276 0.005333 0.005551 0.005336 0.005417 0.005945 0.005547
New Jersey 0.006441 0.007011 0.006468 0.006072 0.005999 0.005871 0.004904
New Mexico 0.007487 0.009433 0.008618 0.006648 0.006940 0.007183 0.006213
New York 0.013964 0.014454 0.015701 0.017501 0.018069 0.020898 0.020179
North Carolina 0.005411 0.006215 0.006506 0.005922 0.005437 0.005349 0.004699
North Dakota 0.004928 0.004318 0.004865 0.013085 0.007831 0.008842 0.006317
Ohio 0.004744 0.005434 0.005742 0.005077 0.004803 0.004906 0.004361
Oklahoma 0.005893 0.005912 0.006081 0.005550 0.005226 0.005210 0.005584
Oregon 0.021670 0.022471 0.020321 0.017945 0.015629 0.019412 0.018333
Pennsylvania 0.004807 0.005496 0.005503 0.005476 0.005518 0.006110 0.005957
Puerto Rico 0.005651 0.007103 0.007177 0.007012 0.007059 0.007592 0.007597
Rhode Island 0.005032 0.004969 0.005619 0.006395 0.005493 0.005299 0.005486
South Carolina 0.004150 0.005174 0.004842 0.006162 0.004707 0.005737 0.005450
South Dakota 0.003849 0.004437 0.005076 0.006502 0.005015 0.006409 0.005937
Tennessee 0.007251 0.007098 0.007644 0.007540 0.007445 0.007297 0.006960
Texas 0.006081 0.007421 0.006579 0.005604 0.005236 0.004503 0.004242
Utah 0.005026 0.005235 0.005792 0.005367 0.004979 0.004832 0.004387
Vermont 0.008221 0.008287 0.009211 0.011066 0.012134 0.012145 0.009225
Virginia 0.004902 0.005388 0.005132 0.004522 0.004016 0.004309 0.003716
Washington 0.014196 0.013817 0.013606 0.011834 0.012301 0.013616 0.014251
West Virginia 0.005441 0.005738 0.006364 0.006122 0.005759 0.005553 0.003834
Wisconsin 0.004707 0.004614 0.004739 0.004807 0.004751 0.005173 0.004786
Wyoming 0.004460 0.008339 0.016787 0.008687 0.006573 0.006922 0.007146
In [35]:
# Write object to a comma-separated values (csv) file.
df_percentage_homeless.to_csv('df_percentage_homeless.csv')

df_homeless_measures

In [36]:
# remove commas from Count column
df_homeless_measures['Count'] = df_homeless_measures['Count'].str.replace(',', '')
In [37]:
# convert all entries in Count column from string to integer
df_homeless_measures['Count'] = pd.to_numeric(df_homeless_measures['Count'])
In [38]:
# sum Count by state, year, and measures
d = {'Count': 'sum'}
df_homeless_measures1 = df_homeless_measures.groupby(['Year', 'State', 'Measures']).aggregate(d)
df_homeless_measures1
Out[38]:
Count
Year State Measures
2007 Alabama Chronically Homeless Individuals 993
Homeless Individuals 4184
Homeless People in Families 1268
Sheltered Chronically Homeless Individuals 483
Sheltered Homeless 3796
Sheltered Homeless Individuals 2823
Sheltered Homeless People in Families 973
Total Homeless 5452
Unsheltered Chronically Homeless Individuals 510
Unsheltered Homeless 1656
Unsheltered Homeless Individuals 1361
Unsheltered Homeless People in Families 295
Alaska Chronically Homeless Individuals 278
Homeless Individuals 1062
Homeless People in Families 580
Sheltered Chronically Homeless Individuals 221
Sheltered Homeless 1387
Sheltered Homeless Individuals 891
Sheltered Homeless People in Families 496
Total Homeless 1642
Unsheltered Chronically Homeless Individuals 57
Unsheltered Homeless 255
Unsheltered Homeless Individuals 171
Unsheltered Homeless People in Families 84
Arizona Chronically Homeless Individuals 2804
Homeless Individuals 10020
Homeless People in Families 4626
Sheltered Chronically Homeless Individuals 650
Sheltered Homeless 8618
Sheltered Homeless Individuals 4423
... ... ... ...
2016 Wyoming Parenting Youth Under 18 0
Sheltered Children of Parenting Youth 14
Sheltered Chronically Homeless 33
Sheltered Chronically Homeless Individuals 29
Sheltered Chronically Homeless People in Families 4
Sheltered Homeless 491
Sheltered Homeless Individuals 277
Sheltered Homeless People in Families 214
Sheltered Homeless Unaccompanied Children (Under 18) 1
Sheltered Homeless Unaccompanied Young Adults (Age 18-24) 23
Sheltered Homeless Unaccompanied Youth (Under 25) 24
Sheltered Homeless Veterans 56
Sheltered Parenting Youth (Under 25) 12
Sheltered Parenting Youth Age 18-24 12
Sheltered Parenting Youth Under 18 0
Total Homeless 857
Unsheltered Children of Parenting Youth 3
Unsheltered Chronically Homeless 58
Unsheltered Chronically Homeless Individuals 51
Unsheltered Chronically Homeless People in Families 7
Unsheltered Homeless 366
Unsheltered Homeless Individuals 240
Unsheltered Homeless People in Families 126
Unsheltered Homeless Unaccompanied Children (Under 18) 2
Unsheltered Homeless Unaccompanied Young Adults (Age 18-24) 5
Unsheltered Homeless Unaccompanied Youth (Under 25) 7
Unsheltered Homeless Veterans 31
Unsheltered Parenting Youth (Under 25) 3
Unsheltered Parenting Youth Age 18-24 3
Unsheltered Parenting Youth Under 18 0

11232 rows × 1 columns

In [39]:
# Write object to a comma-separated values (csv) file.
df_homeless_measures1.to_csv('diff_homeless_measures.csv')

df_homeless_percent

In [40]:
# Transpose data set
df_percentage_homeless1 = df_percentage_homeless.T
df_percentage_homeless1
Out[40]:
State Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Florida ... South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming
Year
2010 0.005490 0.010896 0.009162 0.004051 0.014904 0.012834 0.005257 0.004581 0.050193 0.013193 ... 0.003849 0.007251 0.006081 0.005026 0.008221 0.004902 0.014196 0.005441 0.004707 0.004460
2011 0.005835 0.013975 0.008381 0.005765 0.017847 0.013792 0.006436 0.004989 0.060034 0.014902 ... 0.004437 0.007098 0.007421 0.005235 0.008287 0.005388 0.013817 0.005738 0.004614 0.008339
2012 0.005350 0.012693 0.008511 0.006550 0.016917 0.015004 0.005920 0.004977 0.060029 0.014038 ... 0.005076 0.007644 0.006579 0.005792 0.009211 0.005132 0.013606 0.006364 0.004739 0.016787
2013 0.004806 0.012132 0.007464 0.006280 0.016498 0.009019 0.006301 0.004588 0.056328 0.012310 ... 0.006502 0.007540 0.005604 0.005367 0.011066 0.004522 0.011834 0.006122 0.004807 0.008687
2014 0.004593 0.011288 0.007073 0.004901 0.015623 0.008992 0.006473 0.004443 0.060576 0.010419 ... 0.005015 0.007445 0.005236 0.004979 0.012134 0.004016 0.012301 0.005759 0.004751 0.006573
2015 0.004190 0.013293 0.007484 0.004877 0.016974 0.009657 0.005546 0.004961 0.060444 0.009348 ... 0.006409 0.007297 0.004503 0.004832 0.012145 0.004309 0.013616 0.005553 0.005173 0.006922
2016 0.004133 0.012579 0.007197 0.004414 0.017032 0.010026 0.005261 0.005329 0.065793 0.008453 ... 0.005937 0.006960 0.004242 0.004387 0.009225 0.003716 0.014251 0.003834 0.004786 0.007146

7 rows × 52 columns

In [41]:
# Difference in percent homeless from 2010-2016
df_percentage_homeless1.loc['Diff'] = df_percentage_homeless1.loc['2016'] - df_percentage_homeless1.loc['2010']
diff_homeless_percent = df_percentage_homeless1.loc['Diff'].sort_values()
diff_homeless_percent
Out[41]:
State
Louisiana              -0.008609
Florida                -0.004739
Nevada                 -0.004161
Oregon                 -0.003337
Colorado               -0.002807
Georgia                -0.002659
Arizona                -0.001966
Nebraska               -0.001948
Texas                  -0.001839
Kentucky               -0.001703
Maryland               -0.001685
West Virginia          -0.001607
New Jersey             -0.001537
Alabama                -0.001357
New Mexico             -0.001273
Virginia               -0.001185
Mississippi            -0.001119
Michigan               -0.000956
North Carolina         -0.000712
Utah                   -0.000639
Ohio                   -0.000383
Illinois               -0.000322
Oklahoma               -0.000309
Tennessee              -0.000291
Missouri               -0.000204
Montana                -0.000021
Connecticut             0.000004
Washington              0.000056
Wisconsin               0.000079
Indiana                 0.000154
New Hampshire           0.000271
Arkansas                0.000363
Minnesota               0.000415
Rhode Island            0.000455
Iowa                    0.000598
Delaware                0.000749
Maine                   0.000787
Kansas                  0.000797
Idaho                   0.000803
Vermont                 0.001005
Pennsylvania            0.001150
South Carolina          0.001300
North Dakota            0.001389
Alaska                  0.001683
Puerto Rico             0.001945
South Dakota            0.002088
California              0.002129
Wyoming                 0.002686
Massachusetts           0.003155
New York                0.006215
Hawaii                  0.011532
District of Columbia    0.015600
Name: Diff, dtype: float64
In [42]:
# Convert diff_homeless_percent to data set
diff_homeless_percent_1 = diff_homeless_percent.reset_index()
diff_homeless_percent_1
Out[42]:
State Diff
0 Louisiana -0.008609
1 Florida -0.004739
2 Nevada -0.004161
3 Oregon -0.003337
4 Colorado -0.002807
5 Georgia -0.002659
6 Arizona -0.001966
7 Nebraska -0.001948
8 Texas -0.001839
9 Kentucky -0.001703
10 Maryland -0.001685
11 West Virginia -0.001607
12 New Jersey -0.001537
13 Alabama -0.001357
14 New Mexico -0.001273
15 Virginia -0.001185
16 Mississippi -0.001119
17 Michigan -0.000956
18 North Carolina -0.000712
19 Utah -0.000639
20 Ohio -0.000383
21 Illinois -0.000322
22 Oklahoma -0.000309
23 Tennessee -0.000291
24 Missouri -0.000204
25 Montana -0.000021
26 Connecticut 0.000004
27 Washington 0.000056
28 Wisconsin 0.000079
29 Indiana 0.000154
30 New Hampshire 0.000271
31 Arkansas 0.000363
32 Minnesota 0.000415
33 Rhode Island 0.000455
34 Iowa 0.000598
35 Delaware 0.000749
36 Maine 0.000787
37 Kansas 0.000797
38 Idaho 0.000803
39 Vermont 0.001005
40 Pennsylvania 0.001150
41 South Carolina 0.001300
42 North Dakota 0.001389
43 Alaska 0.001683
44 Puerto Rico 0.001945
45 South Dakota 0.002088
46 California 0.002129
47 Wyoming 0.002686
48 Massachusetts 0.003155
49 New York 0.006215
50 Hawaii 0.011532
51 District of Columbia 0.015600
In [43]:
# Write object to a comma-separated values (csv) file.
diff_homeless_percent.to_csv('diff_homeless.csv')

Visualize

United States Change in Homeless Population from 2010 to 2016

In [44]:
# Import Tableau Dashboard to Jupyter Notebooks (Change in Homelessness by State)
In [45]:
%%HTML 
<div class='tableauPlaceholder' id='viz1560960628541' style='position: relative'><noscript><a href='#'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Un&#47;UnitedStatesChangeinHomelessPopulation2010-2016&#47;Dashboard2&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='UnitedStatesChangeinHomelessPopulation2010-2016&#47;Dashboard2' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Un&#47;UnitedStatesChangeinHomelessPopulation2010-2016&#47;Dashboard2&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1560960628541');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='100%';vizElement.style.height=(divElement.offsetWidth*0.75)+'px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>
In [46]:
# Import Tableau Dashboard to Jupyter Notebooks (Change in Homelessness by State Bar Graph)
In [47]:
%%HTML
<div class='tableauPlaceholder' id='viz1560906912716' style='position: relative'><noscript><a href='#'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Ch&#47;ChangeinHomelessnessbyStateBarGraph&#47;Dashboard1&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='ChangeinHomelessnessbyStateBarGraph&#47;Dashboard1' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Ch&#47;ChangeinHomelessnessbyStateBarGraph&#47;Dashboard1&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1560906912716');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='100%';vizElement.style.height=(divElement.offsetWidth*0.75)+'px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>
In [48]:
# Convert diff_homeless_percent to data set
diff_homeless_percent_1 = diff_homeless_percent.reset_index()
diff_homeless_percent_1
Out[48]:
State Diff
0 Louisiana -0.008609
1 Florida -0.004739
2 Nevada -0.004161
3 Oregon -0.003337
4 Colorado -0.002807
5 Georgia -0.002659
6 Arizona -0.001966
7 Nebraska -0.001948
8 Texas -0.001839
9 Kentucky -0.001703
10 Maryland -0.001685
11 West Virginia -0.001607
12 New Jersey -0.001537
13 Alabama -0.001357
14 New Mexico -0.001273
15 Virginia -0.001185
16 Mississippi -0.001119
17 Michigan -0.000956
18 North Carolina -0.000712
19 Utah -0.000639
20 Ohio -0.000383
21 Illinois -0.000322
22 Oklahoma -0.000309
23 Tennessee -0.000291
24 Missouri -0.000204
25 Montana -0.000021
26 Connecticut 0.000004
27 Washington 0.000056
28 Wisconsin 0.000079
29 Indiana 0.000154
30 New Hampshire 0.000271
31 Arkansas 0.000363
32 Minnesota 0.000415
33 Rhode Island 0.000455
34 Iowa 0.000598
35 Delaware 0.000749
36 Maine 0.000787
37 Kansas 0.000797
38 Idaho 0.000803
39 Vermont 0.001005
40 Pennsylvania 0.001150
41 South Carolina 0.001300
42 North Dakota 0.001389
43 Alaska 0.001683
44 Puerto Rico 0.001945
45 South Dakota 0.002088
46 California 0.002129
47 Wyoming 0.002686
48 Massachusetts 0.003155
49 New York 0.006215
50 Hawaii 0.011532
51 District of Columbia 0.015600
In [49]:
%%HTML
<div class='tableauPlaceholder' id='viz1560913331810' style='position: relative'><noscript><a href='#'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Ch&#47;ChangeinHomelessPopulationHeatMap&#47;Dashboard3&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='ChangeinHomelessPopulationHeatMap&#47;Dashboard3' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Ch&#47;ChangeinHomelessPopulationHeatMap&#47;Dashboard3&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1560913331810');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='100%';vizElement.style.height=(divElement.offsetWidth*0.75)+'px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>

Results

  • 26 states have decreased the percentage of homeless people in their state.
  • 26 states have increased the percentage of homeless people in their state.

Ranking: States that have decreased the rate of homelessness the most

Ranking State Change
1. Louisiana -0.8609%
2. Florida -0.4739%
3. Nevada -0.4161%
4. Oregon -0.3337%
5. Colorado -0.2807%
6. Georgia -0.2659%
7. Arizona -0.1966%
8. Nebraska -0.1948%
9. Texas -0.1839%
10. Kentucky -0.1703%
11. Maryland -0.1685%
12. West Virginia -0.1607%
13. New Jersey -0.1537%
14. Alabama -0.1357%
15. New Mexico -0.1273%
16. Virginia -0.1185%
17. Mississippi -0.1119%
18. Michigan -0.0956%
19. North Carolina -0.0712%
20. Utah -0.0639%
21. Ohio -0.0383%
22. Illinois -0.0322%
23. Oklahoma -0.0309%
24. Tennessee -0.0291%
25. Missouri -0.0204%
26. Montana -0.0021%
27. Connecticut 0.0004%
28. Washington 0.0056%
29. Wisconsin 0.0079%
30. Indiana 0.0154%
31. New Hampshire 0.0271%
32. Arkansas 0.0363%
33. Minnesota 0.0415%
34. Rhode Island 0.0455%
35. Iowa 0.0598%
36. Delaware 0.0749%
37. Maine 0.0787%
38. Kansas 0.0797%
39. Idaho 0.0803%
40. Vermont 0.1005%
41. Pennsylvania 0.1150%
42. South Carolina 0.1300%
43. North Dakota 0.1389%
44. Alaska 0.1683%
45. Puerto Rico 0.1945%
46. South Dakota 0.2088%
47. California 0.2129%
48. Wyoming 0.2686%
49. Massachusetts 0.3155%
50. New York 0.6215%
51. Hawaii 1.1532%
52. District of Columbia 1.5600%

Percent of State Population Homeless in 2016

In [50]:
# Import Tableau Dashboard to Jupyter Notebooks (Percentage Homeless in 2016)
In [51]:
%%HTML
<div class='tableauPlaceholder' id='viz1560960701231' style='position: relative'><noscript><a href='#'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Pe&#47;PercentofStatePopulationHomelessin2016&#47;Dashboard4&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='PercentofStatePopulationHomelessin2016&#47;Dashboard4' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Pe&#47;PercentofStatePopulationHomelessin2016&#47;Dashboard4&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1560960701231');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='100%';vizElement.style.height=(divElement.offsetWidth*0.75)+'px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>
In [52]:
# Import Tableau Bar Chart to Jupyter Notebook (Percentage Homeless in 2016)
In [53]:
%%HTML
<div class='tableauPlaceholder' id='viz1560963028192' style='position: relative'><noscript><a href='#'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Pe&#47;PercentofStatePopulationHomelessin2016BarChart&#47;Dashboard5&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='PercentofStatePopulationHomelessin2016BarChart&#47;Dashboard5' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Pe&#47;PercentofStatePopulationHomelessin2016BarChart&#47;Dashboard5&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1560963028192');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='1709px';vizElement.style.height='931px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>
In [54]:
# convert to data frame
df_2016 = df_percentage_homeless['2016'].reset_index()
df_2016
Out[54]:
State 2016
0 Alabama 0.004133
1 Alaska 0.012579
2 Arizona 0.007197
3 Arkansas 0.004414
4 California 0.017032
5 Colorado 0.010026
6 Connecticut 0.005261
7 Delaware 0.005329
8 District of Columbia 0.065793
9 Florida 0.008453
10 Georgia 0.006257
11 Hawaii 0.029816
12 Idaho 0.006918
13 Illinois 0.004494
14 Indiana 0.004369
15 Iowa 0.004713
16 Kansas 0.003442
17 Kentucky 0.004708
18 Louisiana 0.004495
19 Maine 0.008295
20 Maryland 0.006562
21 Massachusetts 0.013908
22 Michigan 0.004702
23 Minnesota 0.006903
24 Mississippi 0.002815
25 Missouri 0.005796
26 Montana 0.006793
27 Nebraska 0.007111
28 Nevada 0.013466
29 New Hampshire 0.005547
30 New Jersey 0.004904
31 New Mexico 0.006213
32 New York 0.020179
33 North Carolina 0.004699
34 North Dakota 0.006317
35 Ohio 0.004361
36 Oklahoma 0.005584
37 Oregon 0.018333
38 Pennsylvania 0.005957
39 Puerto Rico 0.007597
40 Rhode Island 0.005486
41 South Carolina 0.005450
42 South Dakota 0.005937
43 Tennessee 0.006960
44 Texas 0.004242
45 Utah 0.004387
46 Vermont 0.009225
47 Virginia 0.003716
48 Washington 0.014251
49 West Virginia 0.003834
50 Wisconsin 0.004786
51 Wyoming 0.007146
In [55]:
# sort values
df_2016.sort_values(by=['2016']).reset_index()
Out[55]:
index State 2016
0 24 Mississippi 0.002815
1 16 Kansas 0.003442
2 47 Virginia 0.003716
3 49 West Virginia 0.003834
4 0 Alabama 0.004133
5 44 Texas 0.004242
6 35 Ohio 0.004361
7 14 Indiana 0.004369
8 45 Utah 0.004387
9 3 Arkansas 0.004414
10 13 Illinois 0.004494
11 18 Louisiana 0.004495
12 33 North Carolina 0.004699
13 22 Michigan 0.004702
14 17 Kentucky 0.004708
15 15 Iowa 0.004713
16 50 Wisconsin 0.004786
17 30 New Jersey 0.004904
18 6 Connecticut 0.005261
19 7 Delaware 0.005329
20 41 South Carolina 0.005450
21 40 Rhode Island 0.005486
22 29 New Hampshire 0.005547
23 36 Oklahoma 0.005584
24 25 Missouri 0.005796
25 42 South Dakota 0.005937
26 38 Pennsylvania 0.005957
27 31 New Mexico 0.006213
28 10 Georgia 0.006257
29 34 North Dakota 0.006317
30 20 Maryland 0.006562
31 26 Montana 0.006793
32 23 Minnesota 0.006903
33 12 Idaho 0.006918
34 43 Tennessee 0.006960
35 27 Nebraska 0.007111
36 51 Wyoming 0.007146
37 2 Arizona 0.007197
38 39 Puerto Rico 0.007597
39 19 Maine 0.008295
40 9 Florida 0.008453
41 46 Vermont 0.009225
42 5 Colorado 0.010026
43 1 Alaska 0.012579
44 28 Nevada 0.013466
45 21 Massachusetts 0.013908
46 48 Washington 0.014251
47 4 California 0.017032
48 37 Oregon 0.018333
49 32 New York 0.020179
50 11 Hawaii 0.029816
51 8 District of Columbia 0.065793

Results

  • No state have a homeless population of over 7% of their total population in 2016.
  • The District of Columbia had over double the rate of homelessness than any other state in this study in 2016.
  • Mississippi had the lowest rate of homelessness out of all the states in 2016.

Ranking

Ranking State Percentage Homeless
1. Mississippi 0.2815%
2. Kansas 0.3442%
3. Virginia 0.3716%
4. West Virginia 0.3834%
5. Alabama 0.4133%
6. Texas 0.4242%
7. Ohio 0.4361%
8. Indiana 0.4369%
9. Utah 0.4387%
10. Arkansas 0.4414%
11. Illinois 0.4494%
12. Louisiana 0.4495%
13. North Carolina 0.4699%
14. Michigan 0.4702%
15. Kentucky 0.4708%
16. Iowa 0.4713%
17. Wisconsin 0.4786%
18. New Jersey 0.4904%
19. Connecticut 0.5261%
20. Delaware 0.5329%
21. South Carolina 0.5450%
22. Rhode Island 0.5486 %
23. New Hampshire 0.5547%
24. Oklahoma 0.5584%
25. Missouri 0.5796%
26. South Dakota 0.5937%
27. Pennsylvania 0.5957%
28. New Mexico 0.6213%
29. Georgia 0.6257%
30. North Dakota 0.6317%
31. Maryland 0.6562%
32. Montana 0.6793%
33. Minnesota 0.6903%
34. Idaho 0.6918%
35. Tennessee 0.6960%
36. Nebraska 0.7111%
37. Wyoming 0.7146%
38. Arizona 0.7197%
39. Puerto Rico 0.7597%
40. Maine 0.8295%
41. Florida 0.8453%
42. Vermont 0.9225%
43. Colorado 1.0026%
44. Alaska 1.2579%
45. Nevada 1.3466%
46. Massachusetts 1.3908%
47. Washington 1.4251%
48. California 1.7032%
49. Oregon 1.8333%
50. New York 2.0179%
51. Hawaii 2.9816%
52. District of Columbia 6.5793%

Breakdown of Homelessness

In [56]:
# Import Tableau Treemap to Jupyter Notebook (Breakdown of State Homelessness by Year)
In [57]:
%%HTML
<div class='tableauPlaceholder' id='viz1561320599475' style='position: relative'><noscript><a href='#'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Br&#47;BreakdownofStateHomelessnessbyYear&#47;Sheet2&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='BreakdownofStateHomelessnessbyYear&#47;Sheet2' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Br&#47;BreakdownofStateHomelessnessbyYear&#47;Sheet2&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /><param name='filter' value='publish=yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1561320599475');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='100%';vizElement.style.height=(divElement.offsetWidth*0.75)+'px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>

Results

  • Sheltered homeless and homeless individuals make up the highest portion of the homeless population nationwide on average between 2007 to 2016.
  • Youth homelessness make up the lowest portion of the homeless population nationwide on average between 2007 to 2016.

Changes in Homelessness Over the Years

In [58]:
# Import Tableau Line Graph to Jupyter Notebook (Changes in Homelessness Over the Years)
In [59]:
%%HTML
<div class='tableauPlaceholder' id='viz1561175150476' style='position: relative'><noscript><a href='#'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Ch&#47;ChangesinHomelessnessOvertheYears&#47;Dashboard2&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='ChangesinHomelessnessOvertheYears&#47;Dashboard2' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Ch&#47;ChangesinHomelessnessOvertheYears&#47;Dashboard2&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /><param name='filter' value='publish=yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1561175150476');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='100%';vizElement.style.height=(divElement.offsetWidth*0.75)+'px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>

Results

  • Total homelessness has decreased in the country from 2007 to 2016.