If I want to drop duplicated index in a dataframe the following doesn't work for obvious reasons:
myDF.drop_duplicates(cols=index)
and
myDF.drop_duplicates(cols='index')
looks for a column named 'index'
If I want to drop an index I have to do:
myDF['index'] = myDF.index
myDF= myDF.drop_duplicates(cols='index')
myDF.set_index = myDF['index']
myDF= myDF.drop('index', axis =1)
Is there a more efficient way?