Category "dictionary"

Is there an expiring map in Java that expires elements after a period of time since *first* insertion?

I tried looking at cache mechanisms, such as Guava's Cache. Their expiration is only since last update. What I'm looking for is a data structure that stores ke

CSV adding values to an existing column and calling from a dictionary (no pandas)

I need to add some additional values to an existing column for my CSV file. So this is what I have so far: Sample input CSV file: Alfa,Beta,Charlie,Delta,Echo,F

Plotting nested lists seperately, which are inside nested dictionaries

I have a list consisting of multiple nested dictionaries and nested lists MyList = [{dict0}, {dict1}, {dict2} ... {dict2422}] dict0 = {'type': 'Feature', 'geom

Adding new key values in a dictionary that was imported from an CSV file?

Sorry But I can't use pandas. I have a sample input csv file that looks like this: Alfa,Beta,Charlie,Delta,Echo,Foxtrot,Golf,Hotel,India,Juliett,Kilo A1,B1,C1,D

converting a string to dot notation to access value in nested list in python

items={ "fruits": { "summerFruits": { "Mangoes":5, "melo

How to create objects from a dict where the keys are the name objects and the values are the attributes? Using a loop

class Cars(object): def __init__(self,brand=None,color=None,cost=None): self.brand = brand self.color = color self.cost = cost ima

Dart: why is a list or map not equal to [] and {} respectively

void main() { var a = []; var b = []; print(a == []); print(a == b); var c = ['c']; print(c == ['c']); var d = 'd'; print(d == 'd'); } fa

Dart: why is a list or map not equal to [] and {} respectively

void main() { var a = []; var b = []; print(a == []); print(a == b); var c = ['c']; print(c == ['c']); var d = 'd'; print(d == 'd'); } fa

Convert a list of dict of [{str:int}, {str:int}, ... ] to a single dict of {str:int}

Given a data-structure like this: [{'a':1, 'b': 2}, {'c':3 }, {'a':4, 'c':9}, {'d':0}, {'d': 0, 'b':6}] The goal is to parse the data to produce: {'a': 2.5, 'b

I have used circle marker to show places on a world map in react. How to add popup on circle marker to shows up the location when circle is clicked?

I have used circle marker to show places on a world map in react. How to add popup on circle marker to show details when circle is clicked. Currently the code s

What are dictionary view objects?

In python 2.7, we got the dictionary view methods available. Now, I know the pro and cons of the following: dict.items() (and values, keys): returns a list, s

How to make the dataframe faster ? either by using dictionary or numpy?

I am new to data structures and I would like to make my code faster (this is just part of a bigger code). Using dataframes while looking up variables is slowing

How to create a Dataframe from multiple dictionaries

I have a little issue with my the data I have (multiple dictionaries) to process and create a Dataframe from them. This what the data look like: print(data) 0

Load item description from json file

Recently i saw a post about someone making a program that could control a computer it was launched on. (it was this one) Add commands to user input I was really

emplace and try_emplace with copy constructor

I have an issue with emplace and try_emplace as they always use the copy constructors when moving an object in. #include <iostream> #include <unordered

Comparing lists with order

I wish to compare lists and output the similar matches that following each other in the same order. list1 = ['a','b', 'b', 'c'] list2 = ['b', 'a', 'a', 'c'] #

SWI-Prolog: Looking for a way to print dictionary values in seperate lines

I am searching a way to print some dictionary values in a way every value is on a separate line in the terminal. For example if I have X = abc{a:1,b:2,c:3,d:4,e

How to create a dictionary, where the key is the key of a dictionary of lists and the value is the longest list

I have this dictionary of lists of dictionaries: dict_countries ={'uk': [{'datetime': '1955-10-10 17:00:00', 'city': 'chester'},{'datetime': '1956-09-10 13:00:0

Iterate through a nested python dict

I have a JSON file that looks like this: { "returnCode": 200, "message": "OK", “people”: [ { “details: {

Create jinja template from dictionary in ansible

how can I access stdout and item values in a dictionary? My inventory file: all: hosts: server1: dict: custom_mountpoints: - /srv/