Skip to content
Advertisement

how to filter json array in python

That is the current json array I have. I want get all json objects that type=1

before filter:

JavaScript

after filter:

JavaScript

please help.

Advertisement

Answer

The following snippet of code does exactly what you want, but BEWARE that your input (as written in the question) is not a valid json string, you can check here: http://jsonlint.com.

JavaScript
Advertisement