to_annual()
Convert a daily, weekly, or monthly amount to a yearly amount.
Usage
to_annual(
amount,
period="daily",
)Uses 365 days, 52 weeks, and 12 months per year. From the Budgeting chapter.
Parameters
amount: ArrayLike-
Amount per
period. period: Literal["daily", "weekly", "monthly"] = "daily"-
One of
"daily","weekly", or"monthly".
Returns
float or numpy.ndarray- Yearly amounts.
Raises
TypeError-
If
amountis not numeric. ValueError-
If
amountcontains missing values, orperiodis not one of the choices.
See Also
- to_monthly()
-
Convert to a monthly amount.
Examples
>>> from perfinpy import to_annual
>>> # $5 a day coffee
>>> to_annual(amount=5, period="daily")1825.0