1 / 8

Download class materials onto your desktop…

Download class materials onto your desktop…. as usual. JSON (JavaScript Object Notation). Think of it as a string representation of a Python object, in particular, a dictionary

hao
Download Presentation

Download class materials onto your desktop…

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. Streamer

  4. Analyzer

  5. 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?

  6. 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?

  7. 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?

More Related