Skip to content

Instantly share code, notes, and snippets.

View echennh-zz's full-sized avatar
🏠
Working from home

Elisa Chen echennh-zz

🏠
Working from home
  • meQuilibrium
View GitHub Profile
@kmcquade
kmcquade / get_aws_profile_keys.py
Created December 6, 2018 16:03
Simple python script to grab profile-specific keys from aws credentials file for environment variables export
#!/usr/bin/python2.7
import ConfigParser
import os
import sys
from os.path import expanduser
config = ConfigParser.RawConfigParser()
# credentials_file: The file where this script will grab the temp creds
credentials_file = '/.aws/credentials'
@sainathadapa
sainathadapa / anti_join.py
Created May 9, 2018 10:00
anti-join-pandas
import pandas as pd
def anti_join(x, y, on):
"""Return rows in x which are not present in y"""
ans = pd.merge(left=x, right=y, how='left', indicator=True, on=on)
ans = ans.loc[ans._merge == 'left_only', :].drop(columns='_merge')
return ans
def anti_join_all_cols(x, y):