#๐Ÿ”’ simple item filtering in Numpy

12 messages ยท Page 1 of 1 (latest)

rugged island
#

hi everyone!, im am having a specific problem with numpy, i cant seem to find how is this simple filter supposed to be done:

i have a table that defines all the filters like this:
table[property][items]

      item0 item1 item2
prop0     1     0     1
prop1     1     1     0
prop2     0     0     1
prop3     1     1     1

so every property (row) contains a binary compressed in uint64's, the length of that binary in bits is about the amount of items in the database (each bit indicates if this filter is present in that item)

now imagine i want to get only the items that contain certain binary properties:
must_have[is_property_present]

which props are selected?
prop0 prop1 prop2 prop3
    0     1     0     1

this has a bit for every property in the database, it contains a 1 for each property that must be in the candidates.

the candidates (the result) must be like this:
candidates[does_matchs]

which items match?
item0 item1 item2 item3
    1     1     0     1

the has a bit for every item in the database, it contains a 1 for each item that matchs with the specified filters.

i know how to manage memory in C but i am really new to Numpy, so pls be patient. thanks in advance!! ๐Ÿ™Œ

acoustic sandBOT
#

@rugged island

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

rugged island
#

i am not expecting anyone to solve the problem for me, but id like to have some guidance on how i should do this because im lost. also my problem is not about the memory model but the problem itself that i cant solve without iterators. so you can assume any memory model

thin minnow
#

you're a data science student?

rugged island
#

no but im learning the basics of data science because it will be useful

thin minnow
#

ohh i see

#

what resource are you using?

rugged island
#

i also tried chatgpt to guide be but doesnt seem to be able to do it without iterators

#

i hope i could just slam C code into python but i have to operate over a specific set of np operators

acoustic sandBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.