![]() |
| Get JSON Value based on Another value - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Get JSON Value based on Another value (/thread-32007.html) |
Get JSON Value based on Another value - sambanerjee - Jan-14-2021 Hi - This is the JSON below. I'm looking to get the value of 'bid' for each 'StockSymbol' - any help for this newbie ? RE: Get JSON Value based on Another value - buran - Jan-14-2021 for trade in data['trades']: print(f"{trade['stockSymbol']}: {trade['bid']}")where data is JSON object, i.e. after you load the JSON string RE: Get JSON Value based on Another value - sambanerjee - Jan-15-2021 (Jan-14-2021, 04:50 PM)buran Wrote: Thank you - I'll try this out (I'm sure it will work) - I got by using the jmespath library - |