I have a method which I apply on a pandas series to produce two columns as shown below. One of the returned column contains lists of varying size. This produces VisibleDeprecationWarning
. How can I avoid this?
I tried what's shown in this answer. But couldnt really adopt it to my situation here.
import pandas as pd
import numpy as np
def some_method(i):
return i, np.random.randint(10, size=i)
df = pd.DataFrame(np.random.randint(10, size=100), columns=["a"])
df["c"], df["d"] = zip(*df.a.apply(some_method))