Short and basic
Longer
http://nbviewer.ipython.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb http://www.labri.fr/perso/nrougier/teaching/matplotlib/
import sys | |
from datetime import datetime | |
import orca | |
from caldwr.parsers.precipout import load_precipout | |
# this will be replaced when calling orca.run, but it's good to | |
# have a placeholder here so things don't crash when evaluating | |
# stuff ala carte or with orca-server. |
""" | |
Convert Pandas DFs in an HDFStore to parquet files for better compatibility | |
with Spark. | |
Run from the command line with: | |
spark-submit --driver-memory 4g --master 'local[*]' hdf5_to_parquet.py | |
""" | |
import pandas as pd |
#!/usr/bin/env python | |
""" | |
Prepare an HTML file from SnakeViz for use as a static page. | |
This makes it so all static files are loaded from a CDN instead | |
of from the local server. | |
To get the SnakeViz HTML file run the snakeviz CLI to load a profile | |
in your browser, than save that page as an HTML file to your computer. | |
Finally, run this script on that HTML file. |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" .> | |
<title>tmppou4ttv_</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="https://cdn.rawgit.com/jiffyclub/snakeviz/v0.4.0/snakeviz/static/snakeviz.css" rel="stylesheet"> | |
<!-- DataTables CSS --> | |
<link href="https://cdn.rawgit.com/jiffyclub/snakeviz/v0.4.0/snakeviz/static/vendor/jquery.dataTables.min.css" rel="stylesheet"> | |
</head> |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" .> | |
<title>g2</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="https://cdn.rawgit.com/jiffyclub/snakeviz/v0.4.0/snakeviz/static/snakeviz.css" rel="stylesheet"> | |
<!-- DataTables CSS --> | |
<link href="https://cdn.rawgit.com/jiffyclub/snakeviz/v0.4.0/snakeviz/static/vendor/jquery.dataTables.min.css" rel="stylesheet"> | |
</head> |
#!/usr/bin/env python | |
""" | |
This script checks whether a name is taken on PyPI. | |
Usage: | |
onpypi fakename requests | |
Prints: |
#!/usr/bin/env python | |
""" | |
Starts a Tornado static file server in a given directory. | |
To start the server in the current directory: | |
tserv . | |
Then go to http://localhost:8000 to browse the directory. | |
Use the --prefix option to add a prefix to the served URL, |