You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for asset_index in range(n_assets):
ax.scatter(x=np.sqrt(cov_mat.iloc[asset_index, asset_index]),
y=avg_returns[asset_index],
marker=marks[asset_index],
s=150,
color='black',
label=assets[asset_index])
ax.legend()
plt.tight_layout()
plt.show();`
Refer the attached image
The text was updated successfully, but these errors were encountered:
rajesh1994
changed the title
While plotting plotting the "Efficient Frontier" facing IndexError: list index out of range
While plotting the "Efficient Frontier" facing IndexError: list index out of range
Mar 7, 2021
rajesh1994
changed the title
While plotting the "Efficient Frontier" facing IndexError: list index out of range
Chapter 7.2 While plotting the "Efficient Frontier" facing IndexError: list index out of range
Mar 7, 2021
`marks = ['o', "s", "x", "+"]
fig, ax = plt.subplots()
pf_results.plot(kind='scatter', x='volatility', y='returns', c='sharpe_ratio',
cmap='RdYlGn', edgecolors='black', ax=ax)
ax.set(xlabel='Volatility', ylabel='Expected Returns', title='Efficient Frontier')
ax.plot(pf_vol_ef, pf_returns_ef, 'b--')
for asset_index in range(n_assets):
ax.scatter(x=np.sqrt(cov_mat.iloc[asset_index, asset_index]),
y=avg_returns[asset_index],
marker=marks[asset_index],
s=150,
color='black',
label=assets[asset_index])
ax.legend()
plt.tight_layout()
plt.show();`
Refer the attached image
The text was updated successfully, but these errors were encountered: