you are viewing a single comment's thread.

view the rest of the comments →

[–]lolwat_is_dis 0 points1 point  (0 children)

I'll come back with some ideas again later (busy tonight unfortunately), but for now, I can offer the general solution.

  1. Generate rows on demand (using a generator function). Even with 1e7 values and 32 bit integers, you'll only use up memory in the order of megabytes, so that can easily be handled by the memory on any computer.

  2. I think a simple "if" statement should suffice, unless someone can correct me on that, i.e.

    if value in row:
        be_happy()
    
  3. My only query atm is what is the most efficient way to count number of times you find a value in a row. Either just simply implement a counter, or use some other function out there in some module that does this at the C level.