Skip to content

apply on np.datetime col doesn't upconvert to Timestamp #2627

Closed
@dalejung

Description

@dalejung
import pandas as pd

s = pd.Series(pd.date_range(start="2000/1/1", freq="D", periods=10))
s.apply(lambda x: x.date())

# AttributeError: 'numpy.datetime64' object has no attribute 'date'

This is an error from some unit tests. Did something major change with how datetimes are handled? I recall that np.datetime64 was autoboxed into Timestamps.

I'll update after poking around.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions