1

I'm trying to store a python numpy.ndarray into a MySQL table, using this solution.

When I use ndarray.dumps() I get back a the pickle object in bytes representation and when I try to store it in a BLOB MySQL data type I get a MySQL error. Here is the query:

> query = 'INSERT INTO user (loyalty_member_id, user_vector) VALUES ({0}, {1});'.format(user, user_vector)

where user is an INT and user_vector is the result of numpy.ndarray.dumps()

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.