filmov
tv
use JSON files in Python
Показать описание
this video shows what JSON data looks like, how to use it and do some calculations. We use a for loop to parse the data. Knowing how to use JSON data is a valuable skill to have in Python.
JSON data used:
[
{
"year": "2015",
"net_sales": 11162,
"cost_of_sales": 6638,
"operating_expenses": 4526,
"other_operating_expenses": 684,
"interest_expense": 225,
"other_expense": 62,
"income_before_income_tax": 519,
"income_tax_expense": 132
},
{
"year": "2014",
"net_sales": 8169,
"cost_of_sales": 4901,
"operating_expenses": 3103,
"other_operating_expenses": 308,
"interest_expense": 218,
"other_expense": 44,
"income_before_income_tax": 211,
"income_tax_expense": 22
}
]
JSON data used:
[
{
"year": "2015",
"net_sales": 11162,
"cost_of_sales": 6638,
"operating_expenses": 4526,
"other_operating_expenses": 684,
"interest_expense": 225,
"other_expense": 62,
"income_before_income_tax": 519,
"income_tax_expense": 132
},
{
"year": "2014",
"net_sales": 8169,
"cost_of_sales": 4901,
"operating_expenses": 3103,
"other_operating_expenses": 308,
"interest_expense": 218,
"other_expense": 44,
"income_before_income_tax": 211,
"income_tax_expense": 22
}
]