-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Pandas FutureWarning for concat with empty Series
concat None if Series is empty FutureWarning: The behavior of array concatenation with empty entries is deprecated. In a future version, this will no longer exclude empty items when determining the result dtype. To retain the old behavior, exclude the empty entries before the concat operation.
- Loading branch information
1 parent
6cd7f27
commit 82c24ed
Showing
2 changed files
with
5 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
import matplotlib.pyplot as plt | ||
import okama as ok | ||
|
||
indexes = ["RGBITR.INDX", "RUCBTRNS.INDX", "MCFTR.INDX", "GC.COMM"] | ||
bounds = [(0, 0.7), (0, 0.7), (0, 1), (0, 0.19)] | ||
ef = ok.EfficientFrontier(indexes, ccy="RUB", full_frontier=False, bounds=bounds, inflation=False) | ||
tg = ef.get_tangency_portfolio(rf_return=0.08) | ||
s = tg["Weights"].sum() | ||
print(s) | ||
## TODO: replace ValueError: Weights sum is not equal to one. with custom error mesage | ||
|
||
weights = [0.32, 0.31, 0.18, .19] | ||
portf = ok.Portfolio(['RGBITR.INDX', 'RUCBTRNS.INDX', 'MCFTR.INDX', 'GC.COMM'], ccy="RUB", weights=weights, inflation=True, symbol="portf.PF", rebalancing_period='year') | ||
portf.describe() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters