Skip to content

Commit

Permalink
Refactor test to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmarino committed Apr 20, 2020
1 parent e6d0c79 commit 29ce5ac
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pandas/tests/groupby/transform/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,9 +1025,7 @@ def test_groupby_transform_with_datetimes(func, values):
dates = pd.date_range("1/1/2011", periods=10, freq="D")

stocks = pd.DataFrame({"price": np.arange(10.0)}, index=dates)
stocks["week_id"] = (
pd.to_datetime(stocks.index).isocalendar().set_index(stocks.index).week
)
stocks["week_id"] = dates.isocalendar().set_index(dates).week

result = stocks.groupby(stocks["week_id"])["price"].transform(func)

Expand Down

0 comments on commit 29ce5ac

Please sign in to comment.