Skip to content

Commit

Permalink
formatting and date_start -> date_end
Browse files Browse the repository at this point in the history
  • Loading branch information
dsweber2 committed Mar 29, 2024
1 parent ff86a84 commit df5aa19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nwss_wastewater/delphi_nwss/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def sig_digit_round(value, n_digits):
sign_mask = value < 0
value[sign_mask] *= -1
exponent = np.ceil(np.log10(value))
result = 10**exponent * np.round(value * 10 ** (-exponent), n_digits)
result = 10 ** exponent * np.round(value * 10 ** (-exponent), n_digits)
result[sign_mask] *= -1
result[zero_mask] = in_value[zero_mask]
return result
Expand Down Expand Up @@ -68,7 +68,7 @@ def reformat(df, df_metric):
"""
# drop unused columns from df_metric
df_metric_core = df_metric.loc[
:, ["key_plot_id", "date_start", "population_served", *METRIC_SIGNALS]
:, ["key_plot_id", "date_end", "population_served", *METRIC_SIGNALS]
]
# get matching keys
df_metric_core = df_metric_core.rename(columns={"date_end": "timestamp"})
Expand Down Expand Up @@ -148,8 +148,8 @@ def pull_nwss_data(token: str):

# Pull data from Socrata API
client = Socrata("data.cdc.gov", token)
results_concentration = client.get("g653-rqe2", limit=10**10)
results_metric = client.get("2ew6-ywp6", limit=10**10)
results_concentration = client.get("g653-rqe2", limit=10 ** 10)
results_metric = client.get("2ew6-ywp6", limit=10 ** 10)
df_metric = pd.DataFrame.from_records(results_metric)
df_concentration = pd.DataFrame.from_records(results_concentration)
df_concentration = df_concentration.rename(columns={"date": "timestamp"})
Expand Down

0 comments on commit df5aa19

Please sign in to comment.