'another pandas apply throwing AttributeError: 'Series' object has no attribute 'whatever'

This code should work, no? I used this pattern a bunch of times before and not it's throwing an error. What am i missing?

table=pd.DataFrame({"a":[1,2],"b":[3,4]})
table["c"]=table.apply(lambda x:x.a)

I'm getting

AttributeError: 'Series' object has no attribute 'a'

What am i missing?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source