Given a DataFrame
, I'd like to run code that creates a new variable for each column, with the same name as the column.
For example, given this DataFrame
:
df = pd.DataFrame({'nums': [1, 2], 'strings': ['a', 'b']})
I want code that produces two Series
variables: nums
([1, 2]
) and strings
(['a', 'b']`).