Comments (3)
Es alguna actualizacion de pandas de tu anaconda local, por eso no tenes el error en colab, te sugiero abrir el anaconda prompt y ejecutar esto:
conda update --all
va a tardar 15 minutos pero luego de eso deberia andar bien
from defi.
Actualice conda y cuando corro
import yfinance as yf
import seaborn as sns
import numpy as np
import calendar
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from matplotlib.colors import LinearSegmentedColormap
import pandas as pd
import seaborn as sns
pd.options.plotting.backend = "plotly"
cmap_jp = LinearSegmentedColormap.from_list('Custom', ('red','black','green'), N=256)
df = yf.download('GDX', auto_adjust=True, progress=False)
df = df.loc[df.index.year > 1980].copy()
df["Year"] = df.index.year
df["Month"] = df.index.month
df = df.resample('M').last()
df['variacion'] = df.Close.pct_change()
tabla = df.pivot_table(index="Year",columns="Month",values="variacion")
meses = [x[:3] for x in list(calendar.month_name[1:])]
tabla.columns = meses
plt.style.use('dark_background')
#plt.style.use('classic') """ https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html"""
fig = plt.figure(figsize=(20,12))
gs = GridSpec(nrows=3,ncols=2, figure=fig, width_ratios=[2.5,1], hspace=0.2, wspace=0.1, top=.9)
ax_l = fig.add_subplot(gs[:,0])
ax_r = [fig.add_subplot(gs[i,1]) for i in range(3)]
sc = lambda y: (y - y.min()) / (y.max() - y.min())
ax_r[0].bar(meses, tabla.mean(), color=cmap_jp(sc(tabla.mean())), label='Media', width=.7, edgecolor='gray')
ax_r[1].bar(meses, tabla.median(), color=cmap_jp(sc(tabla.median())), label = 'Mediana', width=.7, edgecolor='gray')
ax_r[2].bar(meses, tabla.kurt(), color=cmap_jp(sc(tabla.kurt())), label = 'Kurtosis', width=.7, edgecolor='gray')
[ax_r[i].legend(fontsize=12) for i in range(3)]
[ax_r[i].grid(alpha=.5) for i in range(3)]
sns.heatmap(tabla, annot=True, ax=ax_l, cmap=cmap_jp, fmt='.2%', vmax=0.15, vmin=-0.15, cbar_kws={"shrink": 0.6})
ax_l.set_title('SP500 Rendimientos Mensuales 1981-2021', fontsize=15)
print('\n')
plt.show()
print('\n')
El kernel se muere y no ejecuta, sin embargo otros codigos los corre sin problema
from defi.
Anda borrando lineas de abajo hacia arriba a ver cual es la conflictiva, es raro a mi me corre lo mas bien, seguro es alguna libreria en tu instalacion que te esta generando un conflicto
from defi.
Related Issues (13)
- Add function for get LP token value HOT 2
- Coingecko Farming Simulate missing graphics HOT 2
- Custom LP pool weights
- IndexError: single positional indexer is out-of-bounds HOT 1
- Error in Farming + Rewards - IL HOT 1
- PCS - Get token/pair info HOT 2
- Not an issue but
- Add other strategies
- Reward token HOT 1
- PancakeSwap Historical Data HOT 1
- Getting error from 'iloss_simulate' function HOT 1
- Pancakeswap API Update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from defi.