Presentation is loading. Please wait.

Presentation is loading. Please wait.

Download class materials onto your desktop… as usual.

Similar presentations


Presentation on theme: "Download class materials onto your desktop… as usual."— Presentation transcript:

1 Download class materials onto your desktop… as usual

2 JSON (JavaScript Object Notation) Think of it as a string representation of a Python object, in particular, a dictionary The json package in Python allows you to convert a library to a JSON object(string representation) or from a JSON object to a Python object. This allows easy data transfer and storage across platforms.

3 Python JavaC++Excel

4 Streamer Query server with an URL Receive data Write to a file

5 Analyzer filestring list of strings, each a JSON object list of dictionaries Do something interesting

6 Answer the following questions How many keys (attributes) are there in a single tweet? What are they (can you print them out)? One of the keys is 'user'. What type of object is its value? Does a tweet have a key called 'place'? What type of object is its value?

7 Next tasks I just loaded one tweet for you. Can you load all of them Can you find out how many tweets whose 'place' attribute is not None? For those tweets whose 'place' attributes are not None, print the values of 'place'. What type of object they are?

8 More about geotag The value of 'place', when not None, is a dictionary. Find out what are its keys. Look at 'bounding_box'. These are four coordinates that specify a square on the earth. Take the first one. Can you find out where it is?


Download ppt "Download class materials onto your desktop… as usual."

Similar presentations


Ads by Google