How to create sequential number column in pyspark dataframe?
Three simple steps:
from pyspark.sql.window import Window
from pyspark.sql.functions import monotonically_increasing_id,row_number
df =df.withColumn("row_idx",row_number().over(Window.orderBy(monotonically_increasing_id())))
I would like to create column with sequential numbers in pyspark dataframe starting from specified number. For instance, I want to add column A to my dataframe df which will start from 5 to the length of my dataframe, incrementing by one, so 5, 6, 7, ..., length(df). 
Some simple solution using pyspark methods?