I got an error in calculating the date using pyspark.pandas. Is there any way to calculate the date with pyspark.pandas?
import pyspark.pandas as ps
import pandas as pd
df = pd.DataFrame({'year': [2015, 2016],
'month': [2, 3],
'day': [4, 5]})
df = ps.DataFrame(df)
srs = ps.to_datetime(df)
srs + timedelta(days=3)
# this yields the same error
srs.add(timedelta(days=3))
# this yields the same error
srs + pd.TimeDelta(days=3)
this yields this error TypeError: Addition can not be applied to datetimes.
while below works
srs = srs.to_pandas()
srs + timedelta(days=3)