Tagged Questions

2
votes
1answer
235 views

Fast way to convert array to tuple/list in python?

It seems like the time it takes to convert an array to a tuple scales linearly with the the length of the array. Is there a way to do this more efficient? I need to insert arrays with 5e+6 elements ...
0
votes
1answer
312 views

Moving large SQL query to NumPy

I have a very large MySQL query in my web app that looks like this: query = SELECT video_tag.video_id, (sum(user_rating.rating) * video.rating_norm) as score FROM video_tag JOIN user_rating ON ...
4
votes
2answers
345 views

What's the most efficient way to covert MySQL output into a NumPy array in Python?

I'm using MySQLdb and Python. I have some basic queries such as this: c=db.cursor() c.execute("SELECT id, rating from video") results = c.fetchall() I need "results" to be a NumPy array, and I'm ...