Anonymous user
Community Data Science Workshops (Spring 2014)/Saturday May 3rd lecture: Difference between revisions
Community Data Science Workshops (Spring 2014)/Saturday May 3rd lecture (view source)
Revision as of 04:54, 3 May 2014
, 10 years agono edit summary
imported>Mako No edit summary |
imported>Mako No edit summary |
||
Line 14:
#* example python program
# New programming concepts:
#* open a file and write to it▼
#* interpolate variables into a string using % and %()s▼
#* urllib2 and urlopen
▲#* interpolate variables into a string using % and %()s
#* JSON file (JavaScript Object Notation)
#**
#** import json; json.loads()
#** like Python (except no single quotes)
#** simple lists, dictionaries
#** can reflect more complicated data structures
#* Example file at http://mako.cc/cdsw.json
▲#* open a file and write to it
# [http://placekitten.com/ placekitten.com]
#* API that takes specially crafted URLs and gives appropriately sized picture of kittens
|