You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if a user attempts to assign multiple columns using the woodwork accessor, an error is thrown.
def test_multiple_assignment():
df = pd.DataFrame()
df["ints"] = [i for i in range(100)]
df["bools"] = [True, False, True, False] * 25
df["datetime"] = pd.date_range("1/1/21", periods=100)
df_ = pd.DataFrame()
df_["ints_"] = [f"{i * 2}" for i in range(100)]
df_["bools_"] = [f"{i * 5}" for i in range(100)]
df.ww.init()
df.ww[["ints", "bools"]] = df_
---------------------------------------
ValueError: New column must be of Series type
Whereas
def test_multiple_assignment():
df = pd.DataFrame()
df["ints"] = [i for i in range(100)]
df["bools"] = [True, False, True, False] * 25
df["datetime"] = pd.date_range("1/1/21", periods=100)
df_ = pd.DataFrame()
df_["ints_"] = [f"{i * 2}" for i in range(100)]
df_["bools_"] = [f"{i * 5}" for i in range(100)]
df[["ints", "bools"]] = df_
yields the correct assignment
The text was updated successfully, but these errors were encountered:
Currently if a user attempts to assign multiple columns using the woodwork accessor, an error is thrown.
Whereas
yields the correct assignment
The text was updated successfully, but these errors were encountered: