santosjorge / cufflinks

Productivity Tools for Plotly + Pandas
MIT License
3.02k stars 675 forks source link

QuantFig demo did not plot with error: AttributeError: 'DataFrame' object has no attribute 'ix' #245

Open tht18 opened 4 years ago

tht18 commented 4 years ago

Hello, This is probably not a new issue. I just installed the latest version of cufflinks 0.17.3 today and tested the demo code to generate Candle Stick plot, but it did not work. I would highly appreciate any advice to fix it as the charts seem really cute. Thank you! Following is the code and error message:

import cufflinks as cf import plotly.offline as plyo from plotly.offline import iplot, init_notebook_mode cf.go_offline(connected=True) init_notebook_mode(connected=True) df=cf.datagen.ohlcv() qf=cf.QuantFig(df,title='First Quant Figure',legend='top',name='GS') qf.add_bollinger_bands() qf.iplot()


AttributeError Traceback (most recent call last)

in () 1 qf=cf.QuantFig(df,title='First Quant Figure',legend='top',name='GS') 2 qf.add_bollinger_bands() ----> 3 qf.iplot() D:\Anaconda\lib\site-packages\cufflinks\quant_figure.py in iplot(self, **kwargs) 1157 showstudies=kwargs.pop('showstudies',True) 1158 study_kwargs=utils.kwargs_from_keyword(kwargs,{},'study',True) -> 1159 datalegend=kwargs.pop('datalegend',data.pop('datalegend',data.pop('showlegend',True))) 1160 export_kwargs = utils.check_kwargs(kwargs,__QUANT_FIGURE_EXPORT) 1161 D:\Anaconda\lib\site-packages\cufflinks\quant_figure.py in _get_sliced(self, slice, df) 147 a=None if a in ('',None) else utils.make_string(a) 148 b=None if b in ('',None) else utils.make_string(b) --> 149 if a: 150 a=date_tools.stringToString(a,from_strfmt,to_strfmt) if '-' not in a else a 151 if b: ~\AppData\Roaming\Python\Python36\site-packages\pandas\core\generic.py in __getattr__(self, name) 5272 if self._info_axis._can_hold_identifiers_and_holds_name(name): 5273 return self[name] -> 5274 return object.__getattribute__(self, name) 5275 5276 def __setattr__(self, name: str, value) -> None: AttributeError: 'DataFrame' object has no attribute 'ix'