Reputation: 5278
I have a class DataImporter
with a method called getData
that I want to apply on a pandas dataframe. The problem: the class / method can just handle single elements.
Imagine I have a DataFrame with three columns id
, a
and b
.
What I actually want to do is something like: (pseudo code)
df["c"] = Class(df["id"]).getData(df["a"], df["b"])
I found out there is something like pandas.Series.apply, but I don't see that it works for the getData
part.
Upvotes: 1
Views: 1319