This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################## | |
## Imports | |
########################################################################## | |
import os | |
from PIL import Image | |
########################################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is an example of how to take a screen capture using Selenium and | |
PIL. The code uses the PhantomJS driver so be sure to install | |
per the requirements section below. | |
Note that Selenium can save a screen capture directly to disk but the | |
code here saves it as a StringIO object so we can demonstrate how to | |
get the data into PIL. From there we can edit it, store in a database, | |
save out to s3, etc. without needing to create a file on disk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
#Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
#Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(value_list)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Model answer for RSS exercise | |
NOTE: In order to use this program, be sure to create a sub-directory | |
called 'articles' | |
""" | |
########################################################################## | |
## Imports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Model answer for REST Workshop | |
NOTE: In order to use this program, be sure to create a sub-directory | |
called 'releases' | |
""" | |
########################################################################## | |
## Imports | |
########################################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Model answer for REST workshop using OpenCalais | |
""" | |
########################################################################## | |
## Imports | |
########################################################################## | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
SQLite workshop to get comfortable with SQL and the operations | |
required for managing data. Check out the pymotw link below under | |
Resources for further explanations and code samples | |
Resources: | |
http://pymotw.com/2/sqlite3/ | |
https://docs.python.org/2/library/sqlite3.html | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
SQLite workshop to get comfortable with SQL and the operations | |
required for managing data. Check out the pymotw link below under | |
Resources for further explanations and code samples | |
Resources: | |
http://pymotw.com/2/sqlite3/ | |
https://docs.python.org/2/library/sqlite3.html | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# clock | |
# Prints out the time specially formatted | |
# | |
# Author: Benjamin Bengfort <benjamin@bengfort.com> | |
# Created: Sat Mar 08 15:29:47 2014 -0500 | |
# | |
# Copyright (C) 2014 Bengfort.com | |
# For license information, see LICENSE.txt | |
# |
OlderNewer