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()

feedMe
  • 3,431
  • 2
  • 36
  • 61
Dimitris Poulopoulos
  • 1,139
  • 2
  • 15
  • 36

0 Answers0