pyspark从integertypes中拆分stringtype进行探索性分析

问题描述 投票:0回答:1

我想从PySpark中的整数中分离出我的df的字符类型,并对integertypes执行一些描述性分析。我写了这个函数,有没有更有效的方法?

for item in df.columns:
    if df.dtypes[item][1] =='string':
        print("this column is a string ")
    else:
        df.agg(F.min(df[item])).show()                                  
        max= df.agg(F.max(df[item]))                                  
        max.show()
string types split pyspark
1个回答
0
投票

要分析数据框的结构,您可以使用:

df.describe()
df.schema()
df.toPandas().info()
df.cube("col1"[, "col2"]).count().show()

最后但并非最不重要的DataFrameStatFunctions

© www.soinside.com 2019 - 2024. All rights reserved.