siuba icon indicating copy to clipboard operation
siuba copied to clipboard

Allow unnesting multiple columns

Open antonio-yu opened this issue 3 years ago • 1 comments

After some tests, new errors happen. As mentioned in issue #352

antonio-yu avatar Jan 18 '22 02:01 antonio-yu

Hey

RE how to unnest a specific column (not named data):

import pandas as pd
from siuba import unnest

sent = pd.DataFrame({
    'id': ['1', '2'],
    'data1': [['a','b'], ['x', 'z']]
     })

sent >> unnest("data1")

RE how to unnest multiple columns

I'm not super familiar with tidyr's behavior for something like this. But am seeing it can unnest multiple columns:

library(tidyr)

tibble(
    a = list(c(1,2), c(3, 4)),
    b = list(c(5, 6), c(7,8))
) %>% unnest(c(a, b))

This isn't supported right now in siuba (AFAIK), but I changed the title to track as a feature!

machow avatar Jan 19 '22 16:01 machow