How can I access value at a certain index of a column in PySpark dataframe for example I want to access value at index 5 of a column named "Category". How can I do that in PySpark syntax?
Something like this,
value = df.where(df.index == 5).select('Category').collect()[0]['Category']
#assuming 'index' is index column
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With