Have you considered using a module or something that is a little bit more focused on handling data structures? Such as pandas or something similar. I think it would be a lot easier to 'query' on your data based on specific conditions that way.
Ofcourse, it would be possible to write all the logic by yourself. But do you have a proper design to do so? I think you'll soon find out that it is more complex than it seems now.
[EDIT] It's also a good idea to share the code you already have.
Ofcourse, it would be possible to write all the logic by yourself. But do you have a proper design to do so? I think you'll soon find out that it is more complex than it seems now.
[EDIT] It's also a good idea to share the code you already have.