Python में Portfolio Analysis परिचय
Charlotte Werger
Data Scientist
$$
$$


Maximum Sharpe पोर्टफोलियो: EF पर सबसे उच्च Sharpe अनुपात
from pypfopt.efficient_frontier import EfficientFrontier
# mu और S के साथ Efficient Frontier निकालें
ef = EfficientFrontier(mu, Sigma)
raw_weights = ef.max_sharpe()
# पढ़ने योग्य वेट्स पाएँ
cleaned_weights = ef.clean_weights()
{'GOOG': 0.01269,'AAPL': 0.09202,'FB': 0.19856,
'BABA': 0.09642,'AMZN': 0.07158,'GE': 0.02456,...}
# प्रदर्शन मीट्रिक्स प्राप्त करें
ef.portfolio_performance(verbose=True)
Expected annual return: 33.0%
Annual volatility: 21.7%
Sharpe Ratio: 1.43
Minimum volatility पोर्टफोलियो: EF पर सबसे कम जोखिम
# mu और S के साथ Efficient Frontier निकालें
ef = EfficientFrontier(mu, Sigma)
raw_weights = ef.min_volatility()
# पढ़ने योग्य वेट्स और प्रदर्शन मीट्रिक्स पाएँ
cleaned_weights = ef.clean_weights()
{'GOOG': 0.05664, 'AAPL': 0.087, 'FB': 0.1591,
'BABA': 0.09784, 'AMZN': 0.06986, 'GE': 0.0123,...}
ef.portfolio_performance(verbose=True)
Expected annual return: 17.4%
Annual volatility: 13.2%
Sharpe Ratio: 1.28


Python में Portfolio Analysis परिचय