Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Nov 12, 2023
1 parent 8d504c0 commit ba21681
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions sklego/pandas_utils.py → sklego/dataframe_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from functools import partial, wraps

import numpy as np
import pandas as pd
from scipy.ndimage import shift

from sklego.common import as_list
Expand Down Expand Up @@ -256,7 +255,7 @@ def add_lags(X, cols, lags, drop_na=True):
if isinstance(X, np.ndarray):
return _add_lagged_numpy_columns(X, cols, lags, drop_na)
elif hasattr(X, "__dataframe_consortium_standard__"):
return _add_lagged_pandas_columns(X, cols, lags, drop_na)
return _add_lagged_dataframe_columns(X, cols, lags, drop_na)

# Otherwise, raise a ValueError
raise ValueError("X type should be a numpy.ndarray, or implement __dataframe_consortium_standard__")
Expand Down Expand Up @@ -308,7 +307,7 @@ def _add_lagged_numpy_columns(X, cols, lags, drop_na):
return answer


def _add_lagged_pandas_columns(df, cols, lags, drop_na):
def _add_lagged_dataframe_columns(df, cols, lags, drop_na):
"""Append a lag columns.
Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import numpy as np
import logging

from sklego.pandas_utils import (
from sklego.dataframe_utils import (
log_step,
log_step_extra,
add_lags,
_add_lagged_pandas_columns,
_add_lagged_dataframe_columns,
_add_lagged_numpy_columns,
)

Expand Down Expand Up @@ -55,7 +55,7 @@ def test_add_lags_correct_X(test_X):

def test_add_lagged_pandas_columns(test_df):
with pytest.raises(KeyError, match="The column does not exist"):
_add_lagged_pandas_columns(test_df, ["last_name"], 1, True)
_add_lagged_dataframe_columns(test_df, ["last_name"], 1, True)


def test_add_lagged_numpy_columns(test_X):
Expand Down

0 comments on commit ba21681

Please sign in to comment.