0

I would like to start the index from 1 undes the "Field" column

df = pd.DataFrame(list(zip(total_points, passing_percentage)),
                 columns =['Pts Measured', '% pass'])
df = df.rename_axis('Field').reset_index()
df["Comments"] = ""
df

Output:

  Field  Pts Measured   % pass  Comments
0   0       92909       90.66   
1   1       92830       91.85   
2   2      130714       99.99   
Cristian
  • 93
  • 1
  • 7

1 Answers1

0

I found a similar question here: In Python pandas, start row index from 1 instead of zero without creating additional column

For your question, it would be as simple as adding the following line:

df["Field"] = np.arange(1, len(df) + 1)
Precel
  • 16
  • 1