Skip to content

Commit 2865e9b

Browse files
authored
Update README.md
1 parent 511b7e5 commit 2865e9b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,13 @@ df = df.withColumn('full_name', F.array('fname', 'lname'))
269269
df = df.withColumn('empty_array_column', F.array([]))
270270

271271
# Array Size/Length – F.size(col)
272-
df = df.withColumn('array_length', F.size(F.col('my_array')))
272+
df = df.withColumn('array_length', F.size('my_array'))
273+
274+
# Flatten Array – F.flatten(col)
275+
df = df.withColumn('flattened', F.flatten('my_array'))
276+
277+
# Unique/Distinct Elements – F.array_distinct(col)
278+
df = df.withColumn('unique_elements', F.array_distinct('my_array'))
273279
```
274280

275281
## Aggregation Operations

0 commit comments

Comments
 (0)