After applying a method on a DataFrame, we often return multiple values as a tuple. This requires additional steps to project it back as separate columns. Instead, with the result_type argument, you can control the shape and output type. As desired, the output can be either a DataFrame or a Series.
A Lesser-Known Feature of Apply Method In Pandas
A Lesser-Known Feature of Apply Method In…
A Lesser-Known Feature of Apply Method In Pandas
After applying a method on a DataFrame, we often return multiple values as a tuple. This requires additional steps to project it back as separate columns. Instead, with the result_type argument, you can control the shape and output type. As desired, the output can be either a DataFrame or a Series.