Get specific row from PySpark dataframe

PHOTO EMBED

Tue Oct 04 2022 14:19:27 GMT+0000 (Coordinated Universal Time)

Saved by @thiago3442 #pyspark #python

# get first row
print(dataframe.collect()[0])
  
# get second row
print(dataframe.collect()[1])
  
# get last row
print(dataframe.collect()[-1])
  
# get third row
print(dataframe.collect()[2])
content_copyCOPY

Get specific row from PySpark dataframe

https://www.geeksforgeeks.org/get-specific-row-from-pyspark-dataframe/