I'm trying to making a df from only unique values from another df. This is my idea
columns = df.columns
df_uniquevalues = pd.DataFrame()
for i in range(len(columns)):
df_uniquevalues[columns[i]] = df[columns[i]].unique()
i += 1
My idea is extracting unique values by a for cycle. Hope you understand. But the error occurs for this reason "Length of values does no match length of index".
Have you a better idea? Or, just the way that I can add columns without the index problem?
Thank you so much!