I have a list called partylist which prints the following.
Index(['AAAP', 'AABHAP', 'AACP', 'AAHPty', 'AAM', 'AAPP', 'ABD', 'ABEP',
'ABGP', 'ABHM',
...
'kajp', 'mimm', 'pjdl', 'rajpt', 'ravp', 'rpsn', 'skd', 'ssrd', 'svjn',
'swbi'],
dtype='object', name='PARTY', length=671)
I tried using reset_index
newlist = partylist.reset_index(level=['PARTY'], inplace=True)
but got an error
AttributeError Traceback (most recent call last) /var/folders/l9/6n1gmxmx515cfndb3gm2cyv40000gn/T/ipykernel_12124/2959807225.py in ----> 1 newlist = partylist.reset_index(level=['PARTY'], inplace=True)
AttributeError: 'Index' object has no attribute 'reset_index'
How can I solve it and make a column list of the partylist?