[Python] Python can't sort values from GitLab export [duplicate]

Discussão em 'Python' iniciado por Stack, Setembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    I am sorting an amount of information of a GitLab-issues export and to then sort this information according to their date. Yet, when I start the script, I always get the same error:


    SettingWithCopyWarning:
    A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead
    ​

    data = pd.read_csv('09.csv',sep=',', header='infer')

    test = data[data["Labels"].str.contains("epic", na=False)]

    test = data[data["Title"].str.contains('xMS::001|iMS::000_Restart_ILASC_Implementation', na=False)]
    test['Due Date']=pd.to_datetime(test['Due Date'])
    test.sort_values(by=['Due Date'], ascending=True)

    with pd.ExcelWriter('v34.xlsx', engine='openpyxl', mode='a',if_sheet_exists='overlay') as writer:
    test.to_excel(writer, index=False, startrow= 10, startcol=1)


    And even if I avoid this error, the sort in my table doesn't change, no matter how I adjust it.

    Continue reading...

Compartilhe esta Página