Broadcasting bug with datetime.date index? · Issue #2304 · pandas-dev/pandas (original) (raw)
Guys,
It seems to be a problem with broadcasting when having a datetime.date index, do you know what may be causing this?
Example:
index = index=[datetime.date(2012, 1, 1), datetime.date(2012, 1, 2)] columns=['a', 'b'] df = pandas.DataFrame([[1., 2.], [3., 4.]], index, columns)
print( df.mean(1) ) 2012-01-01 1.5 2012-01-02 3.5
print( (df - df.mean(1)).to_string() ) a b 2012-01-01 2012-01-02 2012-01-01 NaN NaN NaN NaN 2012-01-02 NaN NaN NaN NaN
The columns somehow end up being the union of the inital columns and the index. The above code works OK when using datetime.datetime instead.
Many thanks,
Marius