Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import numpy as np
#setting up a comparable dataframe
df = pd.DataFrame(np.random.randint(20,100,size=(50, 4)), columns=['A','B','C','D'])
#these two columns become a multi-column index
df['year_idx'] = np.random.randint(2000,2004,50)
df['id_idx'] = np.random.randint(10000,19999,50)
df.drop_duplicates(subset=['year_idx','id_idx'],inplace=True)
import pandas as pd
import numpy as np
#setting up a comparable dataframe
df = pd.DataFrame(np.random.randint(20,100,size=(50, 4)), columns=['A','B','C','D'])
#these two columns become a multi-column index
df['year_idx'] = np.random.randint(2000,2004,50)
df['id_idx'] = np.random.randint(10000,19999,50)
df.drop_duplicates(subset=['year_idx','id_idx'],inplace=True)
@paix120
paix120 / UsesThis API - Software that people that use _____ also use
Created June 19, 2015 01:41
UsesThis API - Software that people that use _____ also use (IPython Notebook)
{
"metadata": {
"name": "",
"signature": "sha256:ac29aa66fa648fd6798841e5524336ac80424bdd5f56e4c1b758ed6d9d543bac"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [