Let us say I have the following column names in pandas: ["A", "B"]
My problem is that I want to use a for loop that grabs the column names from the list and creates a new column name that includes part of those elements from the list.
In each iteration I would like to create the following:
a = ["A", "B"]
for elements i in a:
elements + "_c" = SOME FUNCTION column <df.elements>
That should result in the addition of two new columns with names A_c and B_c.