Pandas new column based on value from another column
How can I add a new column to dataframe that has the same name as values in another column? My dataframe is: import pandas as pd df = pd.DataFrame({ ‘Col1’: [2, 74, 37, 36, 95], ‘Col2’: [36, 80, 9, 26, 16], ‘Col3’: [20, 4, 7, 55, 91], ‘Col4’: [‘Col2′,’Col2′,’Col2′,’Col2′,’Col2’] }) So I need to add… Read More Pandas new column based on value from another column