uchicago-cs/deepdish

I followed example in http://deepdish.io/ but 'numpy.ndarray' object has no attribute 'tobytes'

stray-leone opened this issue · 3 comments

I run the example code in http://deepdish.io/
However, at datum.data = X[i].tobytes() error came.
I know that error is come from deepdish but I don't know the reason and I want to run example code
Do you know the reason the problem ??

My numpy version is 1.8.2

I believe it should be X[i].tostring() prior to numpy 1.9.

I added a note about this to the blog post. Thanks for pointing this out!

I know this will fix it, so I'm closing this issue.

I think a better solution might be adding some test code:

            if float(np.__version__[0:3]) < 1.9:
                datum.data = X[i].tostring()
            else:
                datum.data = X[i].tobytes()