Questions tagged [nested]

This tag relates to any of various nested entities or operations in programming.

This tag relates to any of various nested entities in programming, including but not limited to:

  • Nested data structures
  • Nested queries
  • Nested calls to a procedure, subroutine, method or operation

For example, nesting queries in SQL means to create a subquery. Its result is used in the query itself and provides a query order and subsets.


Related tags :

16389 questions
3
votes
1 answer

vscode not showing object more than 3 nests deep in terminal window/output

I tried to print a multi-nested object or array to my vscode terminal window and vscode output. My result is a simplified version of what I was trying to print where a generic array/object is shown for anything deeper than 3 layers of nesting. Is…
Yin
  • 96
  • 6
3
votes
4 answers

C# nested class/struct visibility

I'm trying to figure out what the proper syntax is to achieve a certain API goal, however I am struggling with visibility. I want to be able to access a Messenger instance's member like msgr.Title.ForSuccesses. However, I do not want to be able to…
Olson.dev
  • 1,766
  • 2
  • 19
  • 39
3
votes
1 answer

javascript, nested navbar from json

My aim is to replicate this structure automatically from a json file.
Spatial Digger
  • 1,883
  • 1
  • 19
  • 37
3
votes
2 answers

How can I retrieve dynamically specified, arbitrary and deeply nested values from a Javascript object containing strings, objects, and arrays?

UPDATE: While there is good value to the code provided in the answers below, an improved version of this question, and its answer, can be found here. EDIT: Correcting the sample data object and simplifying (hopefully) the question GOAL: Given the…
Joe H.
  • 147
  • 1
  • 10
3
votes
0 answers

Created Nested Dictionary using data from Pandas DataFrame

I've data stored in pandas dataframe and I want to create a nested dictionary using that data. The data looks like as follows: +---------+------+----------+----------+---------------+-------+ | Product | Zone | start | end | seq |…
Lopez
  • 461
  • 5
  • 19
3
votes
3 answers

haml/javascript/erb escaping

I have an odd situation, but here it is: # a HAML file :javascript #{ if session[:view].blank? "$.ajax({ url: 'url_for params.merge(:action => 'index')', dataType: 'script'})" else "$.ajax({ …
sscirrus
  • 55,407
  • 41
  • 135
  • 228
3
votes
1 answer

Convert json to csv using jq, with array nested within array

How can I flatten this json array and write out to a csv file using jq so that each row contains all the fields i.e. I'm a bit of a novice with jq but started with this, which does not capture the inner nested array jq -r '(.[0] | keys_unsorted) as…
William Grimes
  • 675
  • 2
  • 11
  • 29
3
votes
2 answers

MongoDB how to filter in nested array

I have below data. I want to find value=v2 (remove others value which not equals to v2) in the inner array which belongs to name=name2. How to write aggregation for this? The hard part for me is filtering the nestedArray which only belongs to…
harryk
  • 123
  • 1
  • 10
3
votes
2 answers

Pandas Dataframe from nested dictionary of pandas dataframes

I have a dictionary with keys of 2 levels, and values at the second level being dataframes: my_dict = { 'elem1':{'day1': pd.DataFrame(columns=['Col1', 'Col2']), 'day2': pd.DataFrame(columns=['Col1', 'Col2']) …
dsForev
  • 45
  • 6
3
votes
1 answer

Mapstruct: custom mapping method for nested objects

I would like to use mapstruct to map between these objects: MyObj1 -List myObj2List --List myObj3List ---string field1 MyObj4 -List myObj5List --List myObj6List ---int field1 Question: can i somehow tell mapstruct…
KGBR
  • 435
  • 1
  • 8
  • 17
3
votes
2 answers

How to sort my dictionary using this condition

How to sort my dictionary using this condition in python. I have a Nested Dictionary which is describe below. my_dict={ "Moli": {"Price": 226, "Quantity": 300, "PreOrder": "Yes", "PostOrder": "No", "Dif": 36}, "Anna": {"Price":…
ammely
  • 85
  • 1
  • 8
3
votes
1 answer

How to query data in Android Room CrossReference entity for a special "many-to-many relationship" use case?

I followed the android dev guide to define Room many-to-many relationship: https://developer.android.com/training/data-storage/room/relationships#many-to-many data class Playlist( @PrimaryKey val playlistId: Long, val playlistName:…
fffionaa
  • 31
  • 4
3
votes
2 answers

How to convert list of dictionaries into a dictionary of dictionaries by using inner key:value pair

So, instead of trying to explain things first, I will just show you what I have and what I want (this is easier): What I have: dict_list = [ {'some': 1.2, 'key': 1.3, 'words': 3.9, 'label': 0}, {'other': 1.2, 'wordly': 1.3, 'words': 3.9,…
MehmedB
  • 1,059
  • 1
  • 16
  • 42
3
votes
3 answers

Get the n-smallest values from a nested python list

I have the following list: l = [(('01001', '01003'), 4.15), (('01001', '01005'), 2.83), (('01001', '01007'), 3.32), (('01001', '01008'), 2.32), (('01001', '01009'), 9.32), (('01001', '01007'), 0.32), (('01002', '01009'), 6.83), (('01002',…
cwohlfart
  • 167
  • 1
  • 9
3
votes
1 answer

Django: 'int' object is not iterable when different serializers in a Viewset

I have an issue when making a GET request on this endpoint: /api/vacancy/{hotel_id}/. It should return vacancy information for a specific Hotel ID. In my schema, the Vacancy model contains the following properties: hotel_id as a foreign…
Seb
  • 363
  • 1
  • 18