Using DataFrame I want to add a column that will write Field1, Field2...(containing as many rows as the index-1).
import numpy as np
df = pd.DataFrame(list(zip(total_points, passing_percentage)),
columns =['Pts_Measured', '%_pass'])
df = df.rename_axis('Field').reset_index()
df["Comments"] = ""
df["Field"] = np.arange(1, len(df) + 1)
df
Output:
Field Pts_Measured %_pass Comments
0 1 92909 90.66
1 2 92830 91.85
2 3 130714 99.99
This is what I would want to have:
Field Field_num Pts_Measured %_pass Comments
0 1 Field1 92909 90.66
1 2 Field2 92830 91.85
2 3 FIeld3 130714 99.99
.. .... ............ .......... .......