0

I tried to convert my Index to a column. But I get the Error: AttributeError: 'DataFrame' object has no attribute 'reset_Seriennummer' It should be simple but it doesn't work.

My Index is ot called Index but it is written the same way:

My df:

Seriennummer    0
701085.0    "(array([1.52558046e+03, 2.55900548e+02, 5.96901108e-01]), array([[ 9.41414894e+03, -2.07982124e+03, -2.30130078e+00],
       [-2.07982124e+03,  1.44373786e+03,  9.59282709e-01],
       [-2.30130078e+00,  9.59282709e-01,  7.75807643e-04]]))"
701086.0    "(array([1.19304206e+03, 2.71174688e+02, 6.59205468e-01]), array([[ 5.21906135e+03, -2.23855187e+03, -2.11896425e+00],
       [-2.23855187e+03,  2.61036500e+03,  1.67396324e+00],
       [-2.11896425e+00,  1.67396324e+00,  1.22581746e-03]]))"

What I tried so far:

df['Seriennummer'] = df.Seriennummer

or

df.reset_Seriennummer(level=0, inplace=True)
2
  • 1
    Do you want df = df.reset_index() ? Commented Sep 21, 2020 at 10:18
  • 1
    df['Seriennummer'] = df.index should convert your index into column Commented Sep 21, 2020 at 10:20

1 Answer 1

1

This will work:

df.reset_index(level='Seriennummer')
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.