Questions tagged [nested-lists]

This tag refers to a structure in which two or more lists are placed in a "nested" form (i.e. one list is contained within another).

nested-lists
Filter by
Sorted by
Tagged with
0 votes
2 answers
7k views

How to write a complex nested list to a csv file without brackets in python?

So I am having trouble writing my data to a .csv file using the import csv package. My data is stored in the following general format: [(Time, [[ID#, MAG, Merr], [ID#, MAG, Merr]])] An example of my ...
0 votes
1 answer
51 views

Why isn't the grid gallery Multi-filter not working?

The two main problems is that the subcategories are not being shown and the filtering of the images according to the classes is not working as well. I was expecting to fiilter the images as follows:...
4 votes
3 answers
113 views

Extracting single data frame column from nested list

I have a nested list where the lowest level contains a data frame with multiple columns. Example below. I would like to extract from this a new list which contains only the first column of the data ...
-1 votes
2 answers
96 views

Plot multiple graph from one csv file in same plot without using pandas [duplicate]

I'm trying to make a code for a pandemic simulation. I have a csv file with data from 3 groups: S (Susceptible) – I (Infectious) – R (Recovered) – . I want to plot all three lists (s, i, r) in the ...
1 vote
0 answers
53 views

Is there a simpler and more elegant way of showing frontmatter for a paper in a nested list

I have been playing with Obsidian and R trying to do some cleaning up of YAML properties on dozens of papers. I have used dplyr, tidyr, purrr, ymlthis to achieve this. Still I am finding some ...
137 votes
4 answers
102k views

How to create multiple levels of indentation in Javadoc?

Suppose, that as part of documenting your code (Javadoc) you want to indicate that the relationships between elements using deep indentation. How can I create a nested list as: some element some ...
1 vote
3 answers
38 views

Finding the minimum value in lists inside a dataframe with TypeError: 'float' object is not iterable

I've generated a Dataframe with a column of lists, but if there are no values, there's a NaN instead. import pandas as pd df = pd.DataFrame(columns=['Lists', 'Min']) df['Lists'] = [ [1,2,3], [4,5,6], [...
0 votes
2 answers
965 views

Geopy Google v3 - Extracting address components from location.raw

I have this python script where I get a list of addresses from a SQL table and then pass them to googles api using Geopy to get them Geocoded then write the data back to a different SQL table. I'm ...
4 votes
2 answers
96 views

How would you hoist latitude and longitude from a dataset in one stroke

I have been playing with nested lists lately and being able to extract data from deep levels. I run into a little problem with tidyr function hoist(). I am able to pull latitude and longitude for 5 ...
0 votes
1 answer
45 views

How to get the benefit of list_rbind() names_to when I have have a list of lists of differing lengths?

I have two large objects I got from JSON downloads. In raw form, order is important. Length(species) is the same as length(colors). I'm happy to add another column or use row names. From list_rbind(), ...
0 votes
1 answer
462 views

R: nested list from JSON/XML (clinicaltrials.gov) to data.frame (tidy)

The purpose For university research I try to process data of clinical studies publicly available here. For reproducibility, I would like to directly use the downloaded JSON or XML files (and not to ...
-5 votes
1 answer
51 views

HTML Nested list for week

I'm trying to figure out how to create a list like this using HTML, but I can't seem to figure out how to keep the numbers going...they just keep on going back to 1. https://i.stack.imgur.com/C3cxs....
0 votes
0 answers
25 views

How to Create a Three Level Table of Contents in Jaspersoft Studio?

I created: - main report (chapter) -- with sub-report (section) --- where there is another sub-section. Unfortunately, when I add the main report to the report book it does not appear and I do not ...
-1 votes
1 answer
113 views

Fail to pass some Gomoku/Caro game test cases

This is the question: Gomoku or Caro is a board game where each player alternatively places a stone of his color at an empty intersection of the board. A player wins the game if he is the first player ...
1 vote
2 answers
88 views

How would I add the sum of a nested list of numbers using recursion? How would I do it using iteration?

I need to write two functions that find the sum of a nested list of numbers, one that uses iteration and one that uses recursion. I have written two functions that successfully find the sum of a non-...
0 votes
0 answers
48 views

Python, How to make a new class from an item in list? [duplicate]

I have a 2D list and a class as shown below. How do I make an element in the list the object name of the class? class XYZclass(): stuff in class xyzList = [[ someThing1, str1, str2 ],[ ...
-1 votes
1 answer
49 views

How can I iterate through a list that goes out of range in a for loop?

I have a for loop that iterates through a list. However, at the end of the loop, the list goes out of range. for i in range(0, 4): x = case1[row + i][col:] y = longest_chain(x) one_counter.append(y) ...
0 votes
0 answers
88 views

How do I get the filtered gallery to work using the nested list?

I've got wanted to categorize the images/projects into 4 categories:all,urbanism,acrhitecture, and interior design.Then when you click on the subcategories but it's also filtered and when you click on ...
-1 votes
1 answer
210 views

How to find nested object Mongodb with query?

Here is the mongodb nested document i want to take only not null 'manuelActivityInfo' object. How can i write Mongo query i shared my query but it takes null activities i need only not null records ...
0 votes
0 answers
58 views

In Kotlin how do I implement a list of elements which each belong to the same super class defined using generics

I have several closely related classes that are all derived from the same super class. open class Fruit() {} class Apple() : Fruit() {} class Orange() : Fruit() {} I need to perform certain ...
0 votes
0 answers
38 views

How to query nested josn structure in mongodb using python

from pymongo import MongoClient client = MongoClient('mongodb://localhost:27017/') db = client['AnalyzeMEdb'] collection = db['counters'] json_object = { "82188999": { "...
1 vote
1 answer
65 views

Convert the R dataframe to the nested list as required

I have a dataframe as follows: df <- data.frame( all = c("All product","All product","All product","All product","All product","All ...
2 votes
5 answers
72 views

remove specific values from each element of a nested list

I have a nested list, like so: nested.list <- list(c(46270L, 103154L, 159944L, 193405L, 199925L), c(24049L, 30454L, 55710L, 106407L, 122059L, 174131L), c(14520L, 46270L, 153636L, 188626L, ...
0 votes
0 answers
29 views

Add undo to a SortableJS list with nested list(s)

I have a single HTML list which may contain zero or more nested lists. A nested list is never be more than one level down ie nested lists cannot contain itself nest a list. Users can add/remove nested ...
0 votes
1 answer
92 views

Is there a better way using nested listview in flutter?

I want to design a page where multiple listview builders are used horiz. Can anyone suggest me the better way or using the nested effect the performance of the app. This is the desired design i want ...
0 votes
3 answers
124 views

Assigning to nested list with list of indices

Given a nested list, you can access the elements with something like data = [[12, 15], [21, 22], [118, 546], [200, 1200]] assert data[0][0] == 12 The issue is that in this case, I want to index into ...
1 vote
1 answer
42 views

Flattern sublists within nested list for tidy json file output without unwanted array brackets

so in a nutshell I barely figured out how to generate a huge nested list from a csv file and the aim was to output it in nice, tidy json format. However, the problem is my json output has given each ...
0 votes
1 answer
57 views

Can I reshuffle data in nested tibble in R?

I want to be able to randomize when ("date.time") a "type" occurred for each "pair", and ultimately repeat this process 10,000 for a permutation reference model. As I was ...
2 votes
2 answers
805 views

How to create a nested for-loop over zipmaps and lists in terraform resources

I've 2 zipmaps over which I would like to loop via a nested for-loop, i.e. an inner and an outer loop. In Python that would be very easy, for instance: for i in list_1: for j in list_2: # do sth....
0 votes
1 answer
35 views

VueDraggable nested lists issue

I would like to use VueDraggable library and create nested lists. So I made a component accodring documentation. Everything works fine till I try to make nested item. I can not. Only if nested list ...
1 vote
1 answer
67 views

Change nesting structure of a nested list stored in a data.table

Outline I am trying to find numbers in a list that amount to a given sum. I managed to calculate all combinations of numbers and their sums with a concise syntax. But I do not manage to restructure ...
0 votes
0 answers
50 views

How to preallocate and name nested lists in R

I'm going to be running models and I want to save the output of the individual models to a list so that I can access them later. Each of the individual models will also be run with different sets of ...
3 votes
1 answer
431 views

How to keep drag overflow visible in react-native-draggable-flatlist

In react-native-draggable-flatlist, there is a an option dragItemOverflow, which makes it possible to drag items outside the list. To keep the items visible when they pass the list border I also had ...
0 votes
2 answers
49 views

need to rotate a square matrix by 90degree clockwise. works for 1st loop but gives index out of range the moment it enters next cycle

class Solution: def rotate(self, matrix: List[List[int]]) -> None: for i in range(0, len(matrix)//2): x = i y = len(matrix)-i-1 for j in range(i,len(...
2 votes
3 answers
107 views

F# Is there a more effective or idiomatic way to reference a table of values

If there was an unchanging tables of values that functions will need to look up from occasionally , say a 4x5 table, where the columns are fruits and the rows are birds. And I want a function that ...
0 votes
2 answers
186 views

Why does Flutter/Dart List.from() work while .toList() doesn't

I spent a day and half racking my brain trying to figure out how to create a chained selector for my redux store to get IDs from a set of nested objects. In the docs and all the examples I've read, I ...
1 vote
0 answers
58 views

How to Set Names for Nested Lists in R of Depth 5

I'm working with a deeply nested list structure in R, and I'm having trouble setting names for lists at a depth of 5. I've managed to do it for lists of depth 4, but I'm unsure how to proceed further. ...
0 votes
0 answers
54 views

Handling Recursive Nested Object Lists in C# for CSV Output

I'm grappling with a C# object structure intended for CSV export. This structure has multi-layered nested lists, some potentially empty, and they can be recursive. While I'm presenting a simplified ...
0 votes
1 answer
65 views

How do I stop the category from getting pushed up whenever I display the subcategory?

I have 4 categories in a form of a list; All, Urbanism,Architecture, and Interior Design. Urbanism,Architecture, and Interior Design all have subcategories in a form of a list. The code both filters ...
2 votes
1 answer
58 views

Decoding a nested list (list of lists with arbitrary depth) recursively

Consider this recursive type definition: type NestedList a = Elem a | SubList (List (NestedList a)) How can I write a decoder in order to decode a JSON list (e.g [1, [[2, [3, 4]], 5], 6, [7, ...
0 votes
1 answer
137 views

how to display nested variable height rows with react-virtualized

import * as React from "react"; import { render } from "react-dom"; import { List, CellMeasurerCache, CellMeasurer, WindowScroller, AutoSizer } from "react-...
1 vote
1 answer
37 views

Specify value from data frame when list name matches

I have a very large nested list and I would like to take a random sample from each nested list, but the sample size for each of the lists differs. The sample size is defined in a data frame. I would ...
0 votes
1 answer
57 views

li overlapping in a nested list (Navigation menu)

I'm trying to create a navigation menu, I've been following this tutorial: https://www.youtube.com/watch?v=vb_u7mj84Tc&ab_channel=TheWebShala I'm stuck at minute 28:56 where the submenu should ...
0 votes
0 answers
92 views

I'm struggling with nested comment feature for my blog app

So I'm working on the backend of a blog where a user can interact with a post. I'm trying to implement a type of comment feature where a comment can have as much nested replies as possible. here are ...
0 votes
1 answer
52 views

How to use a list comprehension to make the first item in a nested list 0?

For example if I have a list that is something like: num_list = [ [1234, 1244123, 453242], [123123, 78421, 76433], [46345, 578542, 47463] ] and I need it to return [ [0, 1244123, ...
0 votes
2 answers
49 views

Confused with list append in Python

a=[10, 23, 56, [78]] b=list(a) a[3][0]=95 a[1]=34 print(b) # why is the out this [10, 23, 56, [95]] and not this [10, 34, 56, [95]] >>[10, 23, 56, [95]] I know how the append works I guess but ...
0 votes
1 answer
31 views

Why on smaller screens, does my nested-menu not work?

On smaller screens, I want the dropdown menu and nested menu to only appear when they're clicked. I.e you click apple, and red apple and green apple appear, if you click red apple, tasty appears. Etc. ...
657 votes
7 answers
484k views

Proper way to make HTML nested list?

The W3 docs have a nested list example prefixed by DEPRECATED EXAMPLE:, but they never corrected it with a non-deprecated example, nor explained exactly what is wrong with the example. So which of ...
0 votes
2 answers
69 views

How to modify a list of lists if it contains x or -x?

I'm trying to modify a list of lists with certain conditions, if a nested list contains x, I'd like to remove that list from the list, if a nested list contains -x, I'd like to remove -x from that ...
2 votes
5 answers
103 views

Compare Between Two Nested List With Different Index Amount

I have two nested list : data1 = [["tr1", 1000, 6798381], ["tr1", 1000, 6798381], ["tr2", 1200, 6798381], ["tr4", 1200, 6798381]] data2 = [["tr1", ...

1
2
3 4 5
65