Data for pd.read_csv():
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
Single line information is contained in the diagonal. Is there a way to convert and collapse a diagonal into a string? The resulting data file will contain 2 lines.
Tried df.ffill()/ df.bfill()and df.drop_duplicates(), but it will not work.
source
share