Skip to content
Open

testing #2122

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def process_county_1990_2000(url: str) -> pd.DataFrame:
# reading the input file and converting to dataframe
df = pd.read_table(_url,
index_col=False,
delim_whitespace=True,
sep=r'\s+',
skiprows=16,
skipfooter=14,
engine='python',
Expand All @@ -71,11 +71,10 @@ def process_county_1990_2000(url: str) -> pd.DataFrame:
errors='coerce')))
df = num_df[num_df[_cols].notnull().all(axis=1)]
df.loc[:, 1:] = df.loc[:, 1:].apply(pd.to_numeric)
df.loc[:, 'geo_ID'] = df.loc[:, 'geo_ID'].astype(int)

# providing geoId to the dataframe
# and making the geoId of 5 digit as county
df.loc[:, 'geo_ID'] = [f'{x:05}' for x in df.loc[:, 'geo_ID']]
df['geo_ID'] = df['geo_ID'].astype(int).astype(str).str.zfill(5)
Comment thread
niveditasing marked this conversation as resolved.
# columns after 11 where having origin hence not required
df.drop(df[df['Race'] >= 11].index, inplace=True)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"geo_ID"
"country/USA"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"geo_ID"
"country/USA"
Loading
Loading