Skip to content

Instantly share code, notes, and snippets.

David Howell davoscollective

Block or report user

Report or block davoscollective

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davoscollective
davoscollective / time_del.py
Created Apr 20, 2018 — forked from zigg/time_del.py
Time various methods of removing a possibly-present item from a dict
View time_del.py
#!/usr/bin/python
import time
def new_d():
return {
1: 2, 3: 4, 5: 6, 7: 8, 9: 10,
11: 12, 13: 14, 15: 16, 17: 18, 19: 20
}
View PySpark_Vectorized_UDFs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davoscollective
davoscollective / PySpark_createDataFrame_with_Arrow.ipynb
Created Apr 19, 2018 — forked from BryanCutler/PySpark_createDataFrame_with_Arrow.ipynb
How to create a Spark DataFrame from Pandas or NumPy with Arrow
View PySpark_createDataFrame_with_Arrow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davoscollective
davoscollective / text_strip_margin.py
Created Sep 19, 2017 — forked from sekimura/text_strip_margin.py
Text (heredoc) strip margin in Python
View text_strip_margin.py
import re
def strip_margin(text):
return re.sub('\n[ \t]*\|', '\n', text)
def strip_heredoc(text):
indent = len(min(re.findall('\n[ \t]*(?=\S)', text) or ['']))
pattern = r'\n[ \t]{%d}' % (indent - 1)
return re.sub(pattern, '\n', text)
@davoscollective
davoscollective / mssql_to_csv.py
Created May 9, 2017 — forked from tinybike/mssql_to_csv.py
simple mssql -> csv file example using pymssql
View mssql_to_csv.py
#!/usr/bin/env python
"""
simple mssql -> csv file example using pymssql
@author jack@tinybike.net
"""
import csv
import datetime
import pymssql
from decimal import Decimal
You can’t perform that action at this time.