Rename this file between md-rst-test.rst and md-rst-test.md to see the respective versions.
EDIT: This doesn't work. See my comment below.
Example syntax-highlighted Python code using a reStructuredText 0.9 directive:
def foo():
import logging | |
rootLogger = logging.getLogger() | |
rootLogger.setLevel(logging.DEBUG) | |
# Try logging.debug('foo') now! | |
# | |
# Note: if you have a module that uses a logger and you want it to log interactively, you'll need to | |
# import/reload it *after* running this code. | |
# | |
# This may also help: |
Rename this file between md-rst-test.rst and md-rst-test.md to see the respective versions.
EDIT: This doesn't work. See my comment below.
Example syntax-highlighted Python code using a reStructuredText 0.9 directive:
def foo():
# as a one liner, just to say I told you so: | |
tail -f $HOME/.config/pianobar/out | sed 's/\x1b\[2K/\n/g' | gawk -v HOME="$HOME" ' BEGIN { i=0; while((getline line<"blacklist") > 0) songs[line]; } { for(song in songs) { if ( $0 == song ) { print "Skipping "song; print "n" > HOME"/.config/pianobar/ctl2"; } } } ' | |
# With whitespace to make it easier to read: | |
tail -f $HOME/.config/pianobar/out |\ | |
sed 's/\x1b\[2K/\n/g' |\ | |
gawk -v HOME="$HOME" ' | |
BEGIN{ | |
i=0 |
<source src="https://nebula-static.s3.amazonaws.com/video-4.mp4" type='video/mp4'/> | |
<source src="https://nebula-static.s3.amazonaws.com/video-3-small.mp4" type='video/mp4'/> | |
<source src="https://nebula-static.s3.amazonaws.com/video-4.webm" type='video/webm'/> | |
<source src="https://nebula-static.s3.amazonaws.com/video-4.ogg" type='video/ogg'/> |
For example, let's say you want to predict movie rankings when your data is all integers in the 1 to 10 range. Classification might seem like a natural choice here, because the values are discrete, but it's actually better to use regression here because classification treats misclassifying a 5 as an 8 equal to misclassifying a 5 as a 6.
In general, use regression anytime there's a linear scale for the data. Classification is good for when there's many dimensions that don't correlate with each other well.
I loaded in ArcaCMD_LS_20061229.csv
and I wanted to get all the trades involving AAON. The way to get them ended up being:
arca = pd.read_csv('ArcaCMD_LS_20061229.csv')
# This creates a Series of booleans
aaon_bool = arca['symbol'] == 'AAON'
# You can access rows given a series of booleans
aaon = arca[aaon_bool]
print len(aaon)
2013-06-07 21:06:11.442571 7fef2a085780 0 ceph version 0.61.2 (fea782543a844bb277ae94d3391788b76c5bee60), process radosgw, pid 14680 | |
2013-06-07 21:06:11.453081 7fef2a085780 10 monclient(hunting): build_initial_monmap | |
2013-06-07 21:06:11.453494 7fef2a085780 1 librados: starting msgr at :/0 | |
2013-06-07 21:06:11.453528 7fef2a085780 1 librados: starting objecter | |
2013-06-07 21:06:11.453627 7fef2a085780 1 -- :/0 messenger.start | |
2013-06-07 21:06:11.453683 7fef2a085780 1 librados: setting wanted keys | |
2013-06-07 21:06:11.453690 7fef2a085780 1 librados: calling monclient init | |
2013-06-07 21:06:11.453696 7fef2a085780 10 monclient(hunting): init | |
2013-06-07 21:06:11.453729 7fef2a085780 10 monclient(hunting): auth_supported 1 method none | |
2013-06-07 21:06:11.453858 7fef2a085780 10 monclient(hunting): _reopen_session |
$ ceph osd dump | |
epoch 122 | |
fsid 8708952c-1017-4bca-a764-14fcb6182e4a | |
created 2013-06-04 00:30:39.089586 | |
modified 2013-06-07 20:59:00.593535 | |
flags | |
pool 0 'data' rep size 2 min_size 1 crush_ruleset 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 1 owner 0 crash_replay_interval 45 | |
pool 1 'metadata' rep size 2 min_size 1 crush_ruleset 1 object_hash rjenkins pg_num 64 pgp_num 64 last_change 1 owner 0 |
>>> for index, letter in enumerate('foobar'):
... print index, letter
...
0 f
1 o
2 o
3 b
4 a
17:04:49 D, [2013-08-08T17:04:48.397029 #22915] DEBUG -- : error in setup command: Error parsing /tmp/buildd/python-cinderclient-1.0.5/setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. | |
17:04:49 D, [2013-08-08T17:04:48.418053 #22915] DEBUG -- : dh_auto_clean: python setup.py clean -a returned exit code 1 | |
17:04:49 D, [2013-08-08T17:04:48.419824 #22915] DEBUG -- : make: *** [clean] Error 1 |