Skip to content
Advertisement

regex on nested object key to filter list python

I have an array of objects like below:

JavaScript

I want to be able to filter down to objects that don’t have a key in labels that match prefix-.

What I’d end up with is:

JavaScript

At the moment I have a working solution but not sure if its the most efficient:

JavaScript

Advertisement

Answer

Here is a possible solution:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement