I have a DataFrame
and I want to add a new column
but not based on exit column,what should I do?
This is my dataframe:
+----+
|time|
+----+
| 1|
| 4|
| 3|
| 2|
| 5|
| 7|
| 3|
| 5|
+----+
This is my expect result:
+----+-----+
|time|index|
+----+-----+
| 1| 1|
| 4| 2|
| 3| 3|
| 2| 4|
| 5| 5|
| 7| 6|
| 3| 7|
| 5| 8|
+----+-----+