You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defdefault(o):
try:
isodate=o.date().isoformat()
exceptAttributeError:
passelse:
ifisodate=="NaT":
returnNonereturnisodate# Let the base class default method raise the TypeErrorreturnjson.JSONEncoder.default(self, o)
json.JSONEncoder(default=default).encode(df.to_dict())
{"dates": {"0": "2020-07-07", "1": null}}
I just found out that there is df.to_json(), which sort of does the same:
df.to_json(date_format="iso", date_unit="s")
{"dates":{"0":"2020-07-07T00:00:00Z","1":null}}
I only wish I could set the date_unit precision to "day"...
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
df.mask
does not replaceNaT
byNone
.Expected Output
df.mask
should properly maskNaT
.Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: