Differences between revisions 17 and 18
Revision 17 as of 2020-06-01 18:03:46
Size: 10921
Editor: kcrisman
Comment:
Revision 18 as of 2020-06-01 18:32:34
Size: 11019
Editor: kcrisman
Comment:
Deletions are marked like this. Additions are marked like this.
Line 69: Line 69:
import urllib2, csv import urllib.request, csv, io
Line 72: Line 72:
L = list(zip(range(1,13),longmonths))
Line 73: Line 74:
def iceplotter(month = selector(zip(range(1,13),longmonths),default = (4, 'April'),label="Month")):
    month_str = months[month-1] + '/N_%02d_area.txt'%(month)
def iceplotter(month = selector(L, default = 4, label="Month")):
    month_str = '/north/monthly/data/N_%02d_extent_v3.0.csv'%(month)
Line 77: Line 78:
    icedata_f = urllib2.urlopen('ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/%s'%month_str)
    cr = csv.reader(icedata_f,delimiter=' ', dialect=dialect)
    icedata = list(cr)
    icedata_f = urllib.request.urlopen('ftp://sidads.colorado.edu/DATASETS/NOAA/G02135%s'%month_str)
    cr = csv.reader(io.StringIO(icedata_f.read().decode()), delimiter=',', dialect=dialect)
    icedata = [row for row in cr]
Line 99: Line 100:
    html('<h3>Extent of Arctic sea ice coverage in %s, %d - %d</h3>'%(longmonths[month-1],min(years),max(years)))
    html('Data from the <a href="http://nsidc.org/">National Snow and Ice Data Center</a>')
    pretty_print(html('<h3>Extent of Arctic sea ice coverage in %s, %d - %d</h3>'%(longmonths[month-1],min(years),max(years))))
    pretty_print(html('Data from the <a href="http://nsidc.org/">National Snow and Ice Data Center</a>'))

Sage Interactions - Web applications

goto interact main page

Warning: Web apps can break frequently due to websites or services changing locations or formats!

CO2 data plot, fetched from NOAA

by Marshall Hampton

One can do many things with scipy.stats. This only scratches the surface.

co2c.png

Arctic sea ice extent data plot, fetched from NSIDC

by Marshall Hampton

seaice.png

Pie Chart from the Google Chart API

by Harald Schilly

interact_with_google_chart_api.png

Stock Market data, fetched from Yahoo and Google FIXME

by William Stein

(Need to fix plotting warnings as well as some stocks give index errors (like bcc), and Python 3 changes, etc.)

stocks.png

interact/web (last edited 2020-06-01 18:37:46 by kcrisman)