I’m trying to sort the index using the below line.
task_count_20.sort_index(ascending=False, ignore_index=True, inplace=True)
The above line of code is working in Google colab
and in the local environment, but when I’m trying in building the app using streamlit
, I’m getting the below traceback error.
TypeError: sort_index() got an unexpected keyword argument 'ignore_index'
Traceback:
File "app.py", line 601, in <module>
Lollipop_count_plot(df, col, count=20)
File "app.py", line 209, in Lollipop_count_plot
task_count_20.sort_index(ascending=False, ignore_index=True, inplace=True)#
In the official pandas documentation, sort_index()
has the keyword ignore_index
pandas.DataFrame.sort_index
DataFrame.sort_index(axis=0, level=None, ascending=True, inplace=False, kind=‘quicksort’, na_position=‘last’, sort_remaining=True, ignore_index=False, key=None)