I have a spark dataframe: df1 as below:

```
age = spark.createDataFrame(["10","11","13"], "string").toDF("age")
age.show()
+---+
|age|
+---+
| 10|
| 11|
| 13|
+---+

```

I have a requirement of adding a row number column to the dataframe to make it:

```
+---+------+
|age|col_id|
+---+------+
| 10|   1  |
| 11|   2  |
| 13|   3  |
+---+------+

```

None of the columns in my dataframe contains unique values.
I tried to use `F.monotonically_increasing_id())` but it is just producing random numbers in increasing order.

```
>>> age = spark.createDataFrame(["10","11","13"], "string").toDF("age").withColumn("rowId1", F.monotonically_increasing_id())
>>> age
DataFrame[age: string, rowId1: bigint]
>>> age.show
<bound method DataFrame.show of DataFrame[age: string, rowId1: bigint]>
>>> age.show()
+---+-----------+
|age|     rowId1|
+---+-----------+
| 10|17179869184|
| 11|42949672960|
| 13|60129542144|
+---+-----------+

```

Since I don't have any column with unique data, I am worried about using windowing functions and generate `row_numbers`.
So, is there a way I can add a column with `row_count` to the dataframe that gives:

```
+---+------+
|age|col_id|
+---+------+
| 10|   1  |
| 11|   2  |
| 13|   3  |
+---+------+

```

If windowing function is the only way to implement, how can I make sure all the data comes under a single partition ?
or if there is a way to implement the same without using windowing functions, how to implement it ?
Any help is appreciated.