I am currently using cufflinks for the first time and there is an error that I believe is impossible to fix (without reverting pandas to an earlier version, I suppose). I just want to make sure that I am not missing something obvious.
When I try to create a spread graph, I get the error:
AttributeError: module 'pandas' has no attribute 'np'
And it indicates that the issue is located within the cufflinks source code, specifically at pd.np
:
if kind=='spread':
trace=self.apply(lambda x:x[0]-x[1],axis=1)
positive=trace.apply(lambda x:x if x>=0 else pd.np.nan)
negative=trace.apply(lambda x:x if x<0 else pd.np.nan)
trace=pd.DataFrame({'positive':positive,'negative':negative})
Apparently that used to be valid pandas syntax, but no longer.
So does this mean I simply cannot use cufflinks for spread graphs? Everything else works fine.
I've tried updating each package individually as well as conda update --all
. The code causing the error is as basic as it gets and comes straight from the source docs:
# Plot pre-generated DataFrame
import cufflinks as cf
cf.datagen.lines(2).iplot(kind='spread')
Expected output is a spread graph. cf.datagen.lines(2)
was tested independently and works as expected, and iplot works for all other graph types.