Category "dictionary"

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"

Python tuple to dict - ValueError: too many values to unpack

Here's the tuple I'm trying to convert to a dict: rule_tuple = tuple((('rule1', 'col1', 'val1'), ('rule1', 'col2', 'val2'), ('rule1', 'col3', 'val3'), ('rule2',

How do I Concatenate or Combine the dictionary of same data to One

I have the below set of 7 Dictionaries {'empid':785, 'empname':'Ibrahim', 'date(2022,5,1)':'Unmarked'} {'empid':785, 'empname':'Ibrahim', 'date(2022,5,2)':'Unma

How to display dictionary with dataframes on a localhost (using Flask and Python)?

I have the following dict: {'id': 1, 'df': pd.DataFrame({'id': [1,2,3], 'col1': ['kuku', 'dudu', 'lulu'], 'col2': [8,9,10]}), 'df_size': 3} When I am trying to

Creating a half Byte dictionary of hexadecimals - without built in functions

base_destination (dict_create - the function receives as input the target base (8 or 16) as an integer And returns a dictionary so that the keys in the dictiona

Freeing up memory from Matlab's Map

I've got a problem which requires me to keep track of a large amount of data in a hard to predict way. I do know a few rules however that allow me to determine

Strange Plotly behaviour with Choropleth Mapbox

I want to create a choropleth map out of a GeoJSON file that looks like this: {"type": "FeatureCollection", "features": [ {'type': 'Feature', 'geometry': {'type

how to check whether specific word are included in dictionary value - Python

I want to make a search program but i stuck in specific alogrithm. First, I will get any word from users Then check wheter user's words are included in any keyw

How to move a key in a dictionary to upper level in python? [closed]

I am trying to move 2 pairs of key-value "time:1000" and "time:5000" from below dictionary to upper level, and then delete the original one un

Python match/case using dictionary keys and values

I'm making a pygame game, and whenever I run my code I get the error expected ':'. I am aware that using [ and ] in match/case blocks is used for something else

Conditional cast always succeed in swift dict

Hello I have a little problem. I am triying to build a swift dictionnary that will later be translated to json for a network code. A simpliflied version of the

How to display (Google) Maps on .Net Maui

I'm playing around with .Net Maui. I'd like to add a map to my demo app. Unfortunately it seems that the map control has not been migrated yet. Also it seems th

Python - Extract value from list of dictionaries that match a specified key

I have a list of names: names = ['london','paris'] and I have a list of dictionaries: data = [ { "_id": "ebef3cb1-9053-4d1e-b409-b682236445b7",

Delete (a, b) in dictionary_1 if a in dictionary_2

I have two dictionaries D1 = {('one', 'two'): 3, ('three', 'four'): 5, ('five', 'six'): 7, ('eight', 'nigh'):8} D2 = {'one':1, 'five': 2} I want to delete ('o

Is it possible to get the sum of a dictionary JSON with values of different data types in python

I am trying to get the sum of the values from a dictionary within a JSON file, but some of the values are a different data type. Only the values that are number

How to get the key of a map using the value in C++ STL

Get key by inputting the value of that key in C++ STL map<int,int> m; m[0]=8; m[8]=7; m[1562]=4; m[100]=1; auto i=m.find(1562); cout<

Fill Map<String, Object> with two strings

I want to fill my Map with two strings. For my Map I have to use <String, Object>. Using <String, String> would instantly solve my problem, but that