Y

New York ACS Logistic Regression Example

import pandas as pd

acs = pd.read_csv('data/acs_ny.csv')
print(acs.columns)
Index(['Acres', 'FamilyIncome', 'FamilyType', 'NumBedrooms', 'NumChildren',
       'NumPeople', 'NumRooms', 'NumUnits', 'NumVehicles', 'NumWorkers',
       'OwnRent', 'YearBuilt', 'HouseCosts', 'ElectricBill', 'FoodStamp',
       'HeatingFuel', 'Insurance', 'Language'],
     dtype='object')
print(acs.head())
 Acres FamilyIncome  FamilyType NumBedrooms NumChildren NumPeople \
0 1-10          150     Married           4           1         3
1 1-10          180 Female Head           3           2         4
2 1-10          280 Female Head           4           0         2
3 1-10          330 Female Head           2           1         2
4 1-10          330   Male Head           3           1         2
 Num Num Num Num Own Year \ Rooms Units Vehicles Workers Rent Built 0 9 Single detached 1 0 Mortgage 1950-1959 1 ...

Get Pandas for Everyone: Python Data Analysis, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.