File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
+ """Functions to retrieve USAFacts data."""
2
3
import numpy as np
3
4
import pandas as pd
4
5
5
6
6
7
def pull_usafacts_data (base_url : str , metric : str , pop_df : pd .DataFrame ) -> pd .DataFrame :
7
- """Pulls the latest USA Facts data, and conforms it into a dataset
8
+ """Pull the latest USA Facts data, and conforms it into a dataset.
8
9
9
10
The output dataset has:
10
11
Original file line number Diff line number Diff line change 67
67
68
68
69
69
def run_module ():
70
-
70
+ """Run module for processing USAFacts data."""
71
71
params = read_params ()
72
72
export_start_date = params ["export_start_date" ]
73
73
if export_start_date == "latest" :
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
+ """Smoothing functions."""
2
3
import numpy as np
3
4
4
5
def identity (x ):
5
- ''' Trivial "smoother" that does no smoothing.
6
+ """ Trivial "smoother" that does no smoothing.
6
7
7
8
Parameters
8
9
----------
@@ -13,11 +14,11 @@ def identity(x):
13
14
-------
14
15
np.ndarray:
15
16
Same as x
16
- '''
17
+ """
17
18
return x
18
19
19
20
def kday_moving_average (x , k ):
20
- ''' Compute k-day moving average on x.
21
+ """ Compute k-day moving average on x.
21
22
22
23
Parameters
23
24
----------
@@ -28,7 +29,7 @@ def kday_moving_average(x, k):
28
29
-------
29
30
np.ndarray:
30
31
k-day moving average. The first k-1 entries are np.nan.
31
- '''
32
+ """
32
33
if not isinstance (k , int ):
33
34
raise ValueError ('k must be int.' )
34
35
# temp = np.append(np.zeros(k - 1), x)
You can’t perform that action at this time.
0 commit comments