4
數據爲pd.read_csv()
:合併多個行到1行
Name Job Place Age
John None None None
None Doctor None None
None None UK None
None None None 50
Alex None None None
None Engr None None
None None US None
None None None 45
單個行的信息被包含在所述對角線。有沒有辦法將對角線轉換並摺疊成行?結果數據框將有2行。
試用df.ffill()
/df.bfill()
和df.drop_duplicates()
但這不起作用。
我認爲DF.dropnan()會做 –
@SaulloCastro你的意思是'df.dropna()'?它沒有。 – MYGz