concat多個dataframe以後,出現index重複的處理

今天contact了幾個dataframe文件,因爲對最終處理數據的行數有限制,因此我選擇隨機刪除幾行數據,在使用drop中的index刪除是發現同時刪掉了好多行,檢查後才發現index有重複,故查找了從新設置index的方法,以此記錄。python 代碼以下:code import pandas as pd df1=pd.DataFrame({'one':[1,2,3,4],
相關文章
相關標籤/搜索