-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Testingpandas testing functions or related to the test suitepandas testing functions or related to the test suite
Milestone
Description
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
Metadata
Metadata
Assignees
Labels
Testingpandas testing functions or related to the test suitepandas testing functions or related to the test suite