You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Prakhar Sandhu (Jira)" <ji...@apache.org> on 2022/07/17 18:36:00 UTC

[jira] [Commented] (SPARK-38601) AttributeError: module 'pyspark.pandas' has no attribute 'DateOffset'

    [ https://issues.apache.org/jira/browse/SPARK-38601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17567705#comment-17567705 ] 

Prakhar Sandhu commented on SPARK-38601:
----------------------------------------

Any idea how to make DateOffset work in pyspark.pandas

> AttributeError: module 'pyspark.pandas' has no attribute 'DateOffset'
> ---------------------------------------------------------------------
>
>                 Key: SPARK-38601
>                 URL: https://issues.apache.org/jira/browse/SPARK-38601
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 3.2.1
>            Reporter: Prakhar Sandhu
>            Priority: Major
>
> I am working on replacing Pandas library to pyspark.pandas Library in my python repo in VS Code. But pyspark.pandas module does not seem to have DateOffset() module similar to what pandas has.
> I tried this :
> {code:java}
> import pyspark.pandas as pd 
> clean_df[self._config.general["info_col"]] = (clean_df["cycle_dt"] - pd.DateOffset(months=cycle_info_gap)        ).fillna(clean_df[self._config.general["time_col"]])  {code}
> It results in the below error :
> {code:java}
> Un unanticipated error occurred: module 'pyspark.pandas' has no attribute 'DateOffset'{code}
> Is there any alternative for this in pyspark.pandas?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org