You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "dch nguyen (Jira)" <ji...@apache.org> on 2021/10/05 04:33:00 UTC
[jira] [Commented] (SPARK-36930) Support ps.DataFrame.dtypes
[ https://issues.apache.org/jira/browse/SPARK-36930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17424288#comment-17424288 ]
dch nguyen commented on SPARK-36930:
------------------------------------
working on this.
> Support ps.DataFrame.dtypes
> ---------------------------
>
> Key: SPARK-36930
> URL: https://issues.apache.org/jira/browse/SPARK-36930
> Project: Spark
> Issue Type: Sub-task
> Components: PySpark
> Affects Versions: 3.3.0
> Reporter: dch nguyen
> Priority: Major
>
> When DF.dtypes is supported, we can use
>
> {code:java}
> >>> pdf = pd.DataFrame(
> ... {"a": [1, 2, 3, 4, 5, 6, 7, 8, 9], "b": [4, 5, 6, 3, 2, 1, 0, 0, 0]},
> ... )
> >>> psdf = ps.from_pandas(pdf)
> >>> psdf.dtypes
> a int64
> b int64
> dtype: object
> >>> ps.DataFrame[psdf.dtypes]
> typing.Tuple[pyspark.pandas.typedef.typehints.NameType, pyspark.pandas.typedef.typehints.NameType]
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org