Category "dictionary"

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"

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