3,242 questions
0 votes
0 answers
59 views
How do I properly insert 3 into my nested list tree?
I am working on a program that is supposed to build a tree using nested lists in Racket. I believe I am very close, but I am stuck on one section of my insertion testing process. The syntax for my ...
3 votes
1 answer
112 views
How do I make a Prolog rule that only reads the lists inside lists?
I am somewhat new to Prolog, having only practised for a few months so far. I am stumped on the following problem and nothing I googled seemed to help. I wrote the following code into a Prolog ...
2 votes
1 answer
67 views
Strange behavior when partitioning list of tuples into different lists [duplicate]
I found some really unexpected behavior today using python 3.12.4. I am trying to sort a list of tuples into 2 different lists in a list of lists based on the first number of the tuple. Instead, each ...
-1 votes
1 answer
126 views
How to iterate through a list of lists and access each element in the sublist and store for use in functions?
I'm working in Python and I'm trying to generate coordinates for circles with their radii being appended after coordinate generation. Once I have the list I want to check it against itself to see if ...
1 vote
1 answer
93 views
Trying to create nested lists of text data based on test group and questionnaire response, then return the total number of each type of response
My macro accurately creates 2 lists of numerical data based on which group (control or exposed) a subject is in. Dim Subjects As Integer Subjects = Sheets("Participant Info").Range("C4:...
1 vote
1 answer
37 views
Ansible: save item from nested list based on match from a separate list
I'm new to ansible so i'll try to explain this as best as I can... I have two lists created from separate json_query results. One of them contains nested lists with two related items each (vm and ...
2 votes
1 answer
112 views
Data frame into nested list (tree)
How to turn a data frame into a recursive list of lists (tree)? Input roles_data <- data.frame( Child = c("A", "B", "C", "D", "E", "F"),...
-4 votes
2 answers
79 views
find the min of int value mixed with string value in a nested list in Python [closed]
I have a nested li below, I wanted to return a nested li with the string with and min of the int value within the same string value. Any idea? li=[['a', 10], ['a', 20], ['a', 20], ['a', 40], ['a', 50],...
-1 votes
3 answers
152 views
Trying to delete overlapping nested lists in Python [closed]
I'm trying to write a code in python that can remove overlapping lists. My lists are in the format [lower_bound,upper_bound,data,data]. These lists are stored in a larger list. I want to iterate over ...
1 vote
1 answer
94 views
Error handling for tidyr hoist in API call dplyr pipe when column type changes between calls
I'm working with the Jira Native API to bring in dashboard data to R for rectangularizing. The max results that can be returned each call is 100. I'm working with a small dashboard atm but am thinking ...
1 vote
1 answer
54 views
drag-and-drop functionality works on a basic level but fails when dealing with deeply nested elements
I'm working on a dynamic nested tree structure using Angular CDK Drag & Drop. The drag-and-drop feature works at the first level but fails when trying to drop elements deeper in the hierarchy. The ...
0 votes
0 answers
24 views
Making nested lists Vs making nested sets (without frozensets)
If I wanted to make a nested set: nested_set = {{1, 2, 3}, {6, 4, 5}, {12, 8, 5, 7}} It would give the error: TypeError: unhashable type: 'set' However if I wanted to make a nested list: nested_list =...
1 vote
3 answers
87 views
How to check for specific structure in nested list python
Suppose we have the list: mylist = [ [ "Hello", [ "Hi" ] ] ] How do I check that list containing "Hello" and "Hi" ...
-2 votes
1 answer
43 views
Adding lists to a list
I have a value that creates a list with two values. I need to add it as a sublist to another list muptiple times. I need the resulting list to look like this: [["a", 1], ["b", 2], [...
0 votes
2 answers
117 views
Efficient connected components from a 2D array
In an m x n matrix consisting of 0s and 1s, we are tasked with counting the 4-directionally connected islands of 1s. A python implementation is as follows: def numIslands(grid): def sink(i,...