why each columns wont append to the series?
id_names = pd.Series()
for column in n_df:
id_names.append(n_df[column].drop_duplicates(), ignore_index = True)
id_names
why each columns wont append to the series?
id_names = pd.Series()
for column in n_df:
id_names.append(n_df[column].drop_duplicates(), ignore_index = True)
id_names
You are failing to reassign the result of append back to the series. pd.Series.append
is not an inplace method. You need to reassign.
id_names = pd.Series()
for column in n_df:
id_names = id_names.append(n_df[column].drop_duplicates(), ignore_index = True)
id_names
However, there is a simplier method for doing this task.
Try:
n_df.melt()