wesm/pandas — Issue #336: make it easier to join TS to DF
Author: sjev
Created: 2011-11-04 21:25:35+00:00
State: open

Normally I work with DataFrames consisting of OHLC columns. To create a new DF with only 'close' column of multiple DFs one can do something like this:
DataFrame({'VIX':vix['close'],'VXV':vxv['close']})
However, it would be more convenient to use .join method, but to do this I have to hack around with a rename function:

def renameTs(series, name=None):
'''
return a renamed copy of time series
'''
s = series.copy()
s.name =name
return s

and use it as follows:
df.join(renameTs(series,'BAR'))

this all would become much cleaner by using
df.join(df['close'], newColName='VIX')