siuba
siuba copied to clipboard
Allow unnesting multiple columns
After some tests, new errors happen. As mentioned in issue #352
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!