pydata/pandas — Issue #811: DataFrame.join can not have datetime as column names
Author: turkeytest
Created: 2012-02-22 19:06:53+00:00
State: open

Issue:
For DataFrameA.join( DataFrameB , on = 'somecol' ), DataFrameB can not have datetime objects as column labels

Example:

from datetime import datetime
from pandas import DataFrame

str_dates = [ '20120209' , '20120222' ]
dt_dates = [ datetime(2012,2,9) , datetime(2012,2,22)]

A = DataFrame(str_dates , index = range(2) , columns = ['aa'] )

B = DataFrame([[1,2],[3,4]] , index = str_dates , columns = str_dates)
C = DataFrame([[1,2],[3,4]] , index = str_dates , columns = dt_dates )

works = A.join( B , on = 'aa' ) # works -- extra column labels are string
fails = A.join( C , on = 'aa' ) # fails -- extra column labels are datetime