Skip to main content

Questions tagged [dictionary]

A dictionary maps keys to values allowing efficient retrieval of values by keys. Use the [map-function] tag for mapping functions; use the [maps] tag for geography.

dictionary
-4 votes
1 answer
49 views

Why do I get "NoneType object is not iterable" when filtering a list of dictionaries with list comprehension and handling None? [closed]

In Python, I am filtering a list of dictionaries with a key using list comprehension. I am handling None but still get an error "NoneType object is not iterable". I know this must be a ...
Harold's user avatar
  • 5
-4 votes
1 answer
48 views

Dictionary Update Stops at Index 35

I'm trying to iterate through a list (config_patterns) and add each element as a key to a dictionary (predefined_patterns) with a value of 0. There are 40 elements in this list. However, the final ...
Chi Pham's user avatar
1 vote
2 answers
41 views

Converting JSON list with multiple nested dictionaries to csv or excel

I have a JSON that I download from a website that has multiple nested dictionaries inside the main list. This is a very simplified version of it. [ { "id": 1, "...
TxHemi's user avatar
  • 11
2 votes
2 answers
35 views

Dictionary indexing with Numpy/Jax

I'm writing an interpolation routine and have a dictionary which stores the function values at the fitting points. Ideally, the dictionary keys would be 2D Numpy arrays of the fitting point ...
LordCat's user avatar
  • 482
0 votes
0 answers
6 views

Showing TIF image as overlay on top of Folium map in Python Jupyter

I am a bit of a newbie to more complex mapping in Python and Jupyter. I am trying to display a TIF image as an overlay on top of a Folium map I created. I tried various approaches (after intensive ...
zixy99's user avatar
  • 33
-4 votes
1 answer
50 views

How to convert a tuple which includes a [string] to a dictionary item

I have this list: address_table3 = [(1, ['21 South Main']), (2, ['1560 West St']), (3, ['1900 Broadway'])] I want to convert it to a dictionary with the address as key and integer as value. When I ...
John Fox's user avatar
0 votes
1 answer
15 views

Modify the values in a (global) list of dictionary without reference

I'm new to python - being an educator trying to write to python script to score student's performance downloaded from an online polling platform. I've solved most problems until something like this: I'...
Chris H's user avatar
0 votes
1 answer
19 views

How to make a flexible argument list for cursor.execute in python3?

In fact, I want to increase and decrease the mysql query items and the values ​​(arguments) according to the status of the variable values. based on my scenario I need to make a flexible mysql query ...
Alireza Mirhabibi - IRAN's user avatar
1 vote
0 answers
30 views

Unable to insert array and map data into the databricks table programmatically in python

Trying to insert array and map (dictionary/json) data into Azure databricks table using both SQLAlchemy as well as databricks-sql-connector. getting differenet error from sqlalchemy import ...
Chinmaya's user avatar
1 vote
2 answers
39 views

Unpack values from column, which consist of list of dictionaries

I have dataframe, which looks like this: import pandas as pd df = pd.DataFrame({"item_id": [1, 2, 3], "item_properties":[ ...
Artem's user avatar
  • 11
2 votes
2 answers
54 views

find value in column, which contains list and take another value from next column and put it in first table to new column

I have two tables df1 = pd.DataFrame([{'a': 1}, {'a': 2}, {'a': 8}]) df1['b'] = "" df2 = pd.DataFrame([{'e': [1,2,3], 'f': 1},{'e': [4,5,6], 'f': 2},{'e': [7,8,9], 'f': 3}]) e f I ...
Joe Dhirk's user avatar
1 vote
1 answer
36 views

Can't access local dataframe from dictionary comprehension expression [duplicate]

I am using dictionary comprehension to compare each dataframe from within a dictionary to its corresponding dataframe in locals(). For some reason, I am getting a key error when accessing the locals()...
user2153235's user avatar
  • 1,038
-1 votes
1 answer
46 views

How to merge two array using .map and .find by avoiding iterating twice

I have two arrays below. I am trying to merge conditions array based on customerLOB.code match. The problem is, I am getting the results added twice because the loop gets iterated twice. How can I ...
Nancy's user avatar
  • 989
0 votes
1 answer
41 views

Need to edit values inside USX (XML) file based on a map

I have a special case, I want to adjust the chapter and verse numbers inside a USX file which is a special format of XML. Documentation: https://ubsicap.github.io/usx/index.html Here are the first 2 ...
Daniel Agafonov's user avatar
0 votes
2 answers
33 views

make groups by a dictionary in R

I have the task of identifying the group to which a sentence belongs according to the use of specific words, for example identifying which color has been used to describe an animal. I have a ...
Dan G's user avatar
  • 21

15 30 50 per page
1
2 3 4 5
5749