Skip to content

Instantly share code, notes, and snippets.

@smly
Created February 24, 2013 06:17
Show Gist options
  • Select an option

  • Save smly/5022849 to your computer and use it in GitHub Desktop.

Select an option

Save smly/5022849 to your computer and use it in GitHub Desktop.
DataFrame.ix & DataFrame.merge
# %run ipython/load_df.py
import pandas as pd
df = pd.load('pickle/train_test_tsv2_data_frame.pd.pickle')
fea = pd.load('pickle/actions_feature.pd.pickle')
train = pd.DataFrame(df.ix['train']['UserID'].drop_duplicates())
train = train.merge(fea)
test = pd.DataFrame(df.ix['test']['UserID'].drop_duplicates())
test = test.merge(fea)
train_ans = pd.read_csv('data/conv/train.ans.tsv', sep="\t")
clf = ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment