0
I created a dataframe in pandas, everything works perfect, but when I export to Excel, it appears this first column with these numbers. I would like to remove it, but commands like . drop do not work.
df = {}
item = []
count = []
def dataframe(df):
    for i in ranking:
        item.append(i['item'])
        count.append(i['count'])
    df = pd.DataFrame(df, columns=('Item','Count'))
    df['Item'] = item
    df['Count'] = count
    df.sort_values('Count', axis=0, ascending = False, inplace=True)
    df.to_excel('C:/hashtag_teste.xlsx')
    print(df)
    return df
I thought I tried this, but maybe I was putting it in the wrong place. I’m still learning. Thank you so much for your help :)
– Henrique Faziali Bueno