Using python 3.7 , pandas 1.1.3 , Anaconda Jupyter Notebook
I am new into python and I have a following dataframe.
DF_1
Name Date AAA 2000-09-01 BBB 2001-08-01 CCC 2002-07-01 AAA 2005-05-01
I just want to extract distinct values from 'Name' column and create a new dataframe (df_2) and insert into it with same column name.
Output df_2 should look like this
Name AAA BBB CCC
Try this:
df_2 = DF_1[['Name']].drop_duplicates()
1.4m articles
1.4m replys
5 comments
56.9k users