I hereby claim:
- I am achagani on github.
- I am achagani (https://keybase.io/achagani) on keybase.
- I have a public key ASAIK_sY55b25US3Tdm85m1sFB9mkV2no1t91rnB4UgP8go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#source: http://www.swegler.com/becky/blog/2014/08/06/useful-pandas-snippets/ | |
#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'] |
# Python virtualenv | |
SRC_DIRECTORY="$HOME/programming" | |
venv () { | |
source $SRC_DIRECTORY/$1/bin/activate; | |
cd $SRC_DIRECTORY/$1; | |
# Then run "bash" again to reload the file, and you're done! | |
} |
import os, shutil, glob | |
def copy_subdirectory_files (file_src, file_dst): | |
for file in os.listdir(file_src): | |
for font in glob.iglob(os.path.join(file_src, file, "*.ttf")): | |
print("Copying file: "+ font) | |
shutil.copy(os.path.join(file_src, file, font), file_dst) |