Ethereum: Reaching the data that comes with the list with python?

Evaluate your data python

When you get data from you, you are right that we are listed in the list. As is the serials that can be evaluated and processed in a stronger manre.

Here is an example of how to refund the data from JSON responds using Python:

by assuming that JSON Answer

`Json

We started

{

ID: 1,

Name: John Doe,

Age: 30,

"City": "New York"

},

{

ID: 2,

Name: Jane Smith,

Age: 25,

City: Los Angeles.

}

]

Re

The use of Python to analyze and return data

Python

Import JSON

Ethereum: Reaching the data that comes with the list with python?

By assuming

data =

{"S": 1, "Name": "John Doe", Age: 30, "City": "New York"},

{"S": 2, "Name": "Jane Smith", Age: 25, City: "Los Angeles"}

]

Define a feature to extract the data

Def get_data (data):

Keys_to_Extract = ["S", "Name", "Age"]

For element data:

Exted_info = {}

KEY_TO_Extract:

If the item key:

Exted_info [Key] = Item [key]

excitement_info

Example

For a person get_data (data):

Print (a person)

Re

In this example, the lack of well -being getstaa is able to perform your objects ("data") and pay for the generator's expressiveness containing data (eg "name" and "age"). We use the "Example Usage" section to repeat the pulled data.

Access to specific data *

To achieve specific data, you can simply repeat the generator's expression:

Python

For a person get_data (data):

Print (Person ["S"]

Print: 1

Print (Person ["Name"])

Print: John Doe

Re

Or, if you want to use the Coop Instance Core, you will define a separate point in the data as an argument:

Python

Def Get_person (Person):

Back {"S": Person ["ID"], "Name": Person ["Name"]}

Example

data =

{"S": 1, "Name": "John Doe", Age: 30, "City": "New York"},

{"S": 2, "Name": "Jane Smith", Age: 25, City: "Los Angeles"}

]

Personal data:

Print (get_person (person))

` Re

This approach is more sadness when a larger set of data that does not fit into memory.

Market Signals Market Contract

Leave a Reply

Your email address will not be published. Required fields are marked *