You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2021/12/02 05:14:00 UTC

[jira] [Assigned] (SPARK-37512) Support TimedeltaIndex creation given a timedelta Series/Index

     [ https://issues.apache.org/jira/browse/SPARK-37512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Apache Spark reassigned SPARK-37512:
------------------------------------

    Assignee:     (was: Apache Spark)

> Support TimedeltaIndex creation given a timedelta Series/Index
> --------------------------------------------------------------
>
>                 Key: SPARK-37512
>                 URL: https://issues.apache.org/jira/browse/SPARK-37512
>             Project: Spark
>          Issue Type: Sub-task
>          Components: PySpark
>    Affects Versions: 3.3.0
>            Reporter: Xinrong Meng
>            Priority: Major
>
>  
> To solve the issues below:
> {code:java}
> >>> idx = ps.TimedeltaIndex([timedelta(1), timedelta(microseconds=2)])
> >>> idx
> TimedeltaIndex(['1 days 00:00:00', '0 days 00:00:00.000002'], dtype='timedelta64[ns]', freq=None)
> >>> ps.TimedeltaIndex(idx)
> Traceback (most recent call last):
> ...
>     raise TypeError("astype can not be applied to %s." % self.pretty_name)
> TypeError: astype can not be applied to timedelta.
>  {code}
>  
>  
>  
> {code:java}
> >>> s = ps.Series([timedelta(1), timedelta(microseconds=2)], index=[10, 20])
> >>> s
> 10          1 days 00:00:00
> 20   0 days 00:00:00.000002
> dtype: timedelta64[ns]
> >>> ps.TimedeltaIndex(s)
> Traceback (most recent call last):
> ...
>     raise TypeError("astype can not be applied to %s." % self.pretty_name)
> TypeError: astype can not be applied to timedelta.
>  {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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