dictionary tag

93 questions


2 answers
123 views
0
I want to read the json file on drive C with Python!!!!

I'm trying to get json file to python and use pandasI couldn't load the json filewith open('C:\BicData\dd.json') as k: data = json.load(k)


1 answers
55 views
0
I'm a beginner at Python. Help me! (Convert string > list > dictionary > string order)

To find out how many times certain words appear in a string (text file) and to create a program that organizes items in descending order according to the frequency, we wrote the following code: For ex...


1 answers
93 views
0
Combine the tuples to make a dictionary

keys = ('name', 'age', 'food')values = ('Monty', 42, 'spam')Counting indict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}I'm going to make.Please let me know if you have a better way than I've a c...

1 years ago

1 answers
78 views
0
Is there a way to remove the list when the elements in the Python list are dictionaries?

For example, test_list_1 = [{key_1:val_1},{key_2:val_2},{key_3:val_3},{key_4:val_4}]test_list_2 = [{key_3:val_3},{key_4:val_4},{key_5:val_5},{key_6:val_6}]# Desired Value# # test_list_2 - test_list_1 ...

1 years ago

2 answers
91 views
0
Put another array value in the Python for statement array.

aa.pyrecords1 = [(a,1),(b,2),(c,3)]records2 = [(a1,4)]# Each array value has a records2 value as many as the number of records2 value.i = 0while i < len(records1): records1[i].append(records2) i = ...


1 answers
64 views
0
You are about to sort the list in alphabetical order

You want to sort the list that stores the string in alphabetically.Where are the relevant methods?


2 answers
65 views
0
I have a question to get Python dictionary key, value value.

input_value={AAA': {'aa1': ['a1', 'b1', 'c1'], 'aaa2': ['a2', 'b2', 'c2']}, 'BBB': {'bb1', 'b1']}}target1 = input_value.keys()# # dict_keys(['AAA', 'BBB'])target2 = input_value.values()# # dict_values...

1 years ago

1 answers
97 views
0
Python - Find the desired value in the element in the dictionary form in the list

list = [{ key1:value1, key2:value2, key3:value3,........}, { key:value, key2:value2,...}, { key:value, key2:value2,...}] The elements of the list are in the form of DickshireHow can I find the value u...

1 years ago

1 answers
57 views
0
How do I extend dictionary?

In the list, you could have just attached it as an extension, but what should I do to extend the dictionary?I want to avoid for loop.a = { a : 1, b : 2 }b = { c : 3, d : 4 }'''I can't do thata.extend(...

1 years ago

1 answers
96 views
0
Is it possible to flip the dictionary like a keyword factor?

Is it possible to flip the dictionary like a keyword factor?d = dict(param='test')def f(param): print paramf(d)Output: {'param': 'test'} Now my code is running like this, but I just want to make test ...

« - 5 - »

© 2024 OneMinuteCode. All rights reserved.