pyspark.sql.functions.
array
Creates a new array column.
New in version 1.4.0.
Column
column names or Columns that have the same data type.
Examples
>>> df.select(array('age', 'age').alias("arr")).collect() [Row(arr=[2, 2]), Row(arr=[5, 5])] >>> df.select(array([df.age, df.age]).alias("arr")).collect() [Row(arr=[2, 2]), Row(arr=[5, 5])]
previous
pyspark.sql.functions.approx_count_distinct
next
pyspark.sql.functions.array_contains