Skip to content

Commit

Permalink
starting google drive authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
weste committed Feb 8, 2024
1 parent e675fe2 commit 24dd82b
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions data_scripts/dwellings/dwellings_denver.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# packages
import pandas as pd
import gdown
import pydrive2


# get and clean data
url = "https://drive.google.com/file/d/uc?id=1Ac5zPy_8UZnI8gxxsnBs-45D_ZOUZ1PQ/"

dat = gdown.download(url)

# dat = (pd.read_csv(url)
# .query('~COMMUSE.notna()')
# .drop(
# columns = ['Model', 'Cluster', 'Group',
# 'CondoComplex', 'CondoComplexName', 'COMMUSE'])
# .assign(
# NBHD = lambda x: x.NBHD.astype('object'))
# .query('LIVEAREA > 0')
# .set_index('PARCEL')
# )


dat = (pd.read_csv(url)
.query('~COMMUSE.notna()') # Filter nulls from commuse column
.drop(
columns = ['Model', 'Cluster', 'Group',
'CondoComplex', 'CondoComplexName', 'COMMUSE']) # drop these columns
.assign(
NBHD = lambda x: x.NBHD.astype('object')) # Convert 'NBHD' column to object type
.query('LIVEAREA > 0') # Filter rows where 'LIVEAREA' is greater than 0
.set_index('PARCEL') # Set 'PARCEL' column as the index
)


# rename columns to lower case
Expand Down

0 comments on commit 24dd82b

Please sign in to comment.