If df is a DataFrame that includes a column 'x', what is NOT a way to add a new column 'y', using a function 'f' that applies a transformation?
Select an answer:
df.y = f(df.x)
Pandas doesn't allow columns to be created via a new attribute name. So, pandas sees `y` as an attribute of the dataframe `df` rather than a new column name.
Comments
Leave a comment