Category "dictionary"

Need help on Array VBA

I don't understand some parts in the following code: For i = 2 To UBound(a, 1) txt = Join$(Array(a(i, 3), a(i, 4)), Chr(2)) If Not dic.exist

Fastest and most efficient way to save and load a large dict

I have a problem. I have a huge dict. I want to save and load this huge dict. But unfortunately I got an MemoryError. The dict should not be too big. What is r

function that takes directory of .txt file and returns a dictionary based on set parameters?

I want to make a function that takes the directory of a .txt file as an input and returns a dictionary based on specific parameters. If the .txt file is empty,

Java time-based map/cache with expiring keys [closed]

Do any of you know of a Java Map or similar standard data store that automatically purges entries after a given timeout? This means aging, whe

Create Dictionary of Specific Keys and Values from a Lst of Dictionaries

I have a list of dictionaries which looks like this: dic = [ {'id': 'Team1', 'name': 'Team One', 'description': 'This is team 1', 'type': 'team'}, {'id': 'Tea

C# Deserialize dictionary with complex properties names to JSON string

I have the following dictionary, each dictionary key potentially needs to be split by '.' and represented as json object/property/array etc. var data = new Dict

How to estimate similarity between sensor data based on the number of occurrence?

Following is my sample data: data = {850.0: 6, -852.0: 5, 992.0: 29, -993.0: 25, 990.0: 27, -992.0: 28, 965.0: 127, 988.0: 37, -994.0: 24, 996.0: 14, -996.0: 1

How to map single column in pandas using multiple columns (text and numbers) in a separate df

I'm trying to convert U.S. geolocation codes for states, counties and cities. The problem is, the county and city codes are duplicated -- meaning, multiple stat

how to parse yaml file that contains dictionary and structure at multiple levels in C++

I am trying to parse a yaml file that likes like below in C++: test_case_0: - input: a: 10 b: 5 - output: area: 50 delta: 5 test_case_1: - input

Type hint for an exhaustive dictionary with Enum/Literal keys

I'm working on code bases with extensive type hints, checked by mypy. There's several instances where we have a mapping from an enum.Enum or other small finite

How can you iterate through a tuple (str), then return a dictionary containing the keys (from the tuple) and the index of the keys as the values?

How can you iterate through a tuple (str), then return a dictionary containing the keys (from the tuple) and the index of the keys as the values? Input: tup = (

how to create a dataframe from a list of dictionary value?

I have a list - elements_listed = [{'data': {'data/2022/04/1': '26-Apr-2022 07:47', 'data/2022/04/2': '24-Apr-2022 17:27', 'data/2022/04/3': '22-Apr-2022 14:20'

Inserting multiple values into a string

I am trying to run this command but need to insert new two variables for every time I run this command. I think the right approach is to loop through a dictiona

Re-ordering columns in a csv but with Dictionaries

I need to re-order columns in a csv but I'll need to call each column from a dictionary. EXAMPLE: Sample input csv File: $ cat file.csv A,B,C,D,E a1,b1,c1,d1,e1

Changing key name of a dictionary by comparing while keeping key value python

I have a dict with two strings "Candy-one" and "Candy-two" as the key and Capacity as the key pair. I wish to replace the strings "Candy-one" and "Candy-two" wi

Bytes object has not attribute json with requests

I am extracting BTC history data from a website and want to store these results. I want to run this in a function and then use map because it's much faster than

How to convert rows under a column into a list under a dictionary under a list under a dictionary?

I have an excel file with the below column name as variantID and corresponding elements. I want the final output as {"filters":[{"tags":[{"k":201,"v":"201"},{"k

update dictionnary through a list

I have this problem in my dictionary I have this list : l=['a','b','c'] so I'd like to append it in my list of dictionary d=[{ "type": "text",

Split / Explode a column of dictionaries into separate columns with pandas

I have data saved in a postgreSQL database. I am querying this data using Python2.7 and turning it into a Pandas DataFrame. However, the last column of this dat

Return a dictionary from multiple line string in swift

I am new to swift. Is there a simple way to convert the following string to dictionary format. Example: input = "Name: Jack\\n Area: Place\\n FavColor: Blue\\n"