dictionary

String search partial dictionary keys within second dictionary keys

String search partial dictionary keys within second dictionary keys Question: I have two dictionaries: {‘001-002’: [100, 1.5, 150.0, 50.0, -75.0, 60.0, -55.0], ‘001-003’: [100, 1.5, 150.0, 50.0, -75.0, 60.0, -55.0], ‘001-005’: [100, 1.5, 150.0, 50.0, -75.0, 60.0, -55.0]} {‘002-004’: [200, 2.5, 250.0, 20.0, -95.0, 80.0, -95.0], ‘003-004’: [100, 1.5, 150.0, 50.0, -75.0, 60.0, -55.0], ‘005-004’: …

Total answers: 1

Create dictionary through text file

Create dictionary through text file Question: In a lab for class we are to read from a text file containing line by line world cup winners with their country name, year, captain, and coach. We are expected to make a dictionary using the country name as keys. I was trying to make a dictionary in …

Total answers: 4

How to import data form lists in a dictionary in Python?

How to import data form lists in a dictionary in Python? Question: I want to create a program that takes 3 different inputs and stores them in 3 separate lists and then be able to combine them in a dictionary and print on screen. So far I got this : size = input("Enter size of …

Total answers: 1

How do I access using Python Dict and List

How do I access using Python Dict and List Question: Here I am giving two variables namely "a", "result". If "result" matches with any of the record in "a" in "city" then it should return entire record of the "a" variable. a = { "output": [ {"name": "India", "state": [ { "city": ["c", "d" ] …

Total answers: 2

Transform a dictionary into a list of tuples with Python

Transform a dictionary into a list of tuples with Python Question: I want to transform a dictionary into a list of tuples, but doing it ‘row-wise’: the first tuple should cointain the first values, the second tuple the second values, and so on. I have some working code, but I wonder if there is a …

Total answers: 2

How to use a dictionary to standardize terminology across lists

How to use a dictionary to standardize terminology across lists Question: I have been trying to solve this issue for a while but I can’t seem to think of a right solution. Basically, I am parsing few pdfs and depending on the source of the pdf, the terminology used is different. For example, source A1 …

Total answers: 1

Python Find matching item in a list of dictionaries

Python Find matching item in a list of dictionaries Question: I have a big list of dictionaries. Each dictionary contains timeseries data of each sensor when each data point is collected. I want to know the index location of a specific sensor and date. So, I can update the sensor value. My code: big_list = …

Total answers: 7