Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rwijtvliet committed Oct 7, 2024
1 parent fec336c commit c852082
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions portfolyo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .tools.standardize import frame as standardize
from .tools.tzone import force_agnostic, force_aware
from .tools.unit import Q_, Unit, ureg
from .tools.unit import avoid_frame_of_objects as pintframe
from .tools.wavg import general as wavg

VOLUME = Kind.VOLUME
Expand Down
4 changes: 2 additions & 2 deletions portfolyo/tools/wavg.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def dataframe(
# Unweighted average if no weights are provided.
if weights is None:
# Fix possible problems, like distinct units of same dimension
# df = tools_unit.defaultunit(df)
df = tools_unit.avoid_frame_of_objects(df)
return df.apply(np.mean, axis=axis) # can't do .mean() if pint-series

# Prep: orient so that we can always average over columns.
Expand All @@ -215,7 +215,7 @@ def dataframe(
# HACK: transposing moves unit to element-level, undo here

# Fix possible problems, also those introduced by .T
# df = tools_unit.defaultunit(df)
df = tools_unit.defaultunit(df)

# Do averaging.
if isinstance(weights, pd.DataFrame):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ matplotlib = "^3.7.2"
pint = "^0.24"
pint-pandas = "0.6"
colorama = "^0.4.6"
holidays = "^0.32"
numpy = "^1.26.2"
holidays = "^0.57"


[tool.poetry.group.test.dependencies]
Expand Down

0 comments on commit c852082

Please sign in to comment.