create a dataframe containing elements in a range

Solutions on MaxInterview for create a dataframe containing elements in a range by the best coders in the world

showing results for - "create a dataframe containing elements in a range"
Grégoire
06 Feb 2016
1# Create a DataFrame containing elements in a range
2
3spark.range(1, 7, 2).collect()
4# [Row(id=1), Row(id=3), Row(id=5)]
5
6spark.range(3).collect()
7#[Row(id=0), Row(id=1), Row(id=2)]