Skip to content
Advertisement

Exctract a value from a Json file(python)

Hi i’m not an expert and this problem kept me stuck for such a long time I hope that someone here can help me i would like to exctract the value “interestExpense” from the following json file:

JavaScript

In this case the result should be -130000000 as a string but i m trying to find a way to create an list(or an array) with all those floats so that i can decide which one to pick, i have no idea how to manipulate this kind of data(json) For example

JavaScript

should return 17780000000(the value associated with incomeBeforeTax) is this actually possible? The output is generated from this code:

JavaScript

Advertisement

Answer

If you are using python, you need to include the json module and parse it as an object:

JavaScript

Regards

L.

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