unnest is a function from the tidyr package that can expand the list columns.
Questions tagged [unnest]
456 questions
-2
votes
1 answer
DISTINCT Select on comma separated values MySQL
Currently I have this table yeast_module which has this field beer_style
Which currently, every single row in the yeast_module has this beer_style data
American Amber,American Brown Ale,American India Pale Ale,American Pale Ale,American…

Pablo
- 1,357
- 1
- 11
- 40
-2
votes
3 answers
How get all matching positions in a string?
I have a column flag_acumu in a table in PostgreSQL with values like:
'SSNSSNNNNNNNNNNNNNNNNNNNNNNNNNNNNSNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN'
I need to show all positions with an 'S'. With this code, I only get the first such position, but not…

alejus
- 189
- 1
- 3
-2
votes
3 answers
SQL Query to Transpose Column Counts to Row Counts
I have a table that looks like the following which shows the count of types. I need to and have been trying to display data as 1 column and 7 rows instead though... without…

BooneStars
- 3
- 5
-3
votes
2 answers
Postgresql, json, query
I want the syntax to query in PostgreSQL for the data in JSON format of the following form into tabular format.
data(JSON):
1. { "attr1":"v1", "attr2":[{"subattr":"a1","subattr2":"aa1"},{"subattr":"a2","subattr2":"aa2"}],"attr3":"vv1"}
2. {…

FR_68
- 1
- 1
-3
votes
1 answer
How to unnest_tokens and keep additional columns
Applying the unnest_tokens function to tweets creates 1 column with each word in its own row. I have additional columns in the original data frame (day, hour, min) of each tweet. Is there a way to have each row of words also have three more column…

Sam_Donnelly
- 5
- 2
-4
votes
1 answer
How do you split a list of dictionaries into separate dictionaries?
How do you split a list of dictionaries into separate dictionaries?
dict_example = [{'limited': 1, 'all': 16, 'concept': 1, 'secondly': 1}, {'hello': 3, 'bye': 6}]
The desired output:
dict_1: {'limited': 1, 'all': 16, 'concept': 1, 'secondly':…

evc
- 13
- 3