PySpark Action Methods
In this tutorial we will try to look at some of the common action methods in PySpark
df.count()df.show(n=10)df.collect()df.first()df.take(n=5)def my_function(row):
print(row)
df.foreach(my_function)def my_function(iterator):
for row in iterator:
print(row)
df.foreachPartition(my_function)Last updated