I am trying to print threshold for the dataframe values using pyspark. Below is the R code which I wrote but I want this in Pyspark and I am unable to figure out how to do it in pyspark. Any help will be greatly appreciated!
Values dataframe looks something like
values dataframe is
vote
0.3
0.1
0.23
0.45
0.9
0.80
0.36
# loop through all link weight values, from the lowest to the highest
for (i in 1:nrow(values)){
# print status
print(paste0("Iterations left: ", nrow(values) - i, " Threshold: ", values[i, w_vote]))
}
What I am trying in pyspark is, but I am stuck here
for row in values.collect():
print('iterations left:',row - i, "Threshold:', ...)