Skip to content

Instantly share code, notes, and snippets.

View BSCowboy's full-sized avatar

Bryan Smith BSCowboy

  • DoD
  • Austin, TX
View GitHub Profile
from Tkinter import *
import ttk
class MainWindow(Frame):
def __init__(self):
Frame.__init__(self)
self.master.title("ProgressBar example")
#self.master.minsize(400, 100)
self.grid(sticky=E+W+N+S)
@tmthyjames
tmthyjames / stealth_scraping.ipynb
Created August 27, 2016 23:45
Scraping EPA data using randomized time delays and a PhantomJS headless browser
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tonyfast
tonyfast / d3-tutorial.ipynb
Last active February 3, 2017 20:16
python/d3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pybokeh
pybokeh / Python_Excel_Scripting.ipynb
Last active January 20, 2020 01:50
Excel scripting using Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awesomebytes
awesomebytes / python_development_environment.md
Last active May 28, 2024 05:23
My development environment, how to install it

Python development environment (with ROS!)

Install pip

The package manager of python packages is called pip.

sudo apt-get install python-pip

If you need a pip package as a debian you can use Victor's debian from pip.

Install ipython

@VincentLoy
VincentLoy / metutils.py
Created May 12, 2015 16:42
some weather utilities functions
#!/usr/bin/env python
"""
Tropical Cyclone Risk Model (TCRM) - Version 1.0 (beta release)
Copyright (C) 2011 Geoscience Australia
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@jlln
jlln / separator.py
Last active November 9, 2023 19:59
Efficiently split Pandas Dataframe cells containing lists into multiple rows, duplicating the other column's values.
def splitDataFrameList(df,target_column,separator):
''' df = dataframe to split,
target_column = the column containing the values to split
separator = the symbol used to perform the split
returns: a dataframe with each entry for the target column separated, with each element moved into a new row.
The values in the other columns are duplicated across the newly divided rows.
'''
def splitListToRows(row,row_accumulator,target_column,separator):
split_row = row[target_column].split(separator)
@wladston
wladston / distcorr.py
Last active December 12, 2023 06:50
Distance correlation with p-value
from scipy.spatial.distance import pdist, squareform
import numpy as np
import copy
def distcorr(Xval, Yval, pval=True, nruns=500):
""" Compute the distance correlation function, returning the p-value.
Based on Satra/distcorr.py (gist aa3d19a12b74e9ab7941)
>>> a = [1,2,3,4,5]
@DrLulz
DrLulz / search.py
Created January 20, 2015 16:53
Search text of all PDFs in a folder.
#!/usr/bin/python
import sys;
import re;
import slate;
import pickle;
import nltk;
import glob;
import os;
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)