Data dodania Pytanie
2017-12-08 05:12 How to build index map with multiple value from list in python with elegant way? »
I want to build a dict in python from a list, the key of the dict is the first column and the value of the map is the second column. Is there any eleg...
(2) odpowiedzi
2017-12-07 09:12 Java streams: Add to map but avoid mutation »
I often find myself in a situation where I need to create a Map of objects from a Set or List. The key is usually some String or Enum or the like, and...
(3) odpowiedzi
2017-12-06 13:12 how to keep items of Dictionary in the same Order using python »
I use this code's example to store items of dictionary in variable doc{}. from collections import OrderedDict doc= OrderedDict() # it doesn't work b...
(2) odpowiedzi
2017-11-30 16:11 How to convert Map<Shape, int[]> to Map<Shape, Set<Integer>> in Java 8? »
I'm pretty new to Java 8 and I have the following requirement to convert: Map<Shape, int[]> --> Map<Shape, Set<Integer>> Any i...
(2) odpowiedzi
2017-11-28 16:11 Map application in scheme »
I am trying to understand procedure application and computation order in scheme. I have the following code: (map map (list map) (list (list list)) '(...
(1) odpowiedzi
2017-11-27 14:11 Making Dictionary out of List »
There is a list given: List= ["sugar:10", "coffee:23", "sugar:47", "salt:26"] From that list I need to get dictionary: Dict = {"sugar":57, "coffee...
(5) odpowiedzi
2017-11-25 21:11 How to iterate through this text file faster? »
I have a file with lots of sections in this format: section_name_1 <attribute_1:value> <attribute_2:value> ... <attribute_n:value> ...
(1) odpowiedzi
2017-11-24 13:11 How can I change this form of dictionary to pandas dataframe? »
I'm now processing tweet data using python pandas module, and I stuck with the problem. I want to make a frequency table(pandas dataframe) from this ...
(3) odpowiedzi
2017-11-22 06:11 React - Adding component in Map function not adding »
I want to add components into the dom through using the map function over an array. {books.map((book) => <Book/>)} However, it is not adding...
(3) odpowiedzi
2017-11-10 23:11 Is there a lodash function or a 'lodash way' to do a conditional _.map? »
So basically, I have an array of objects and I'd like to update only the objects in the array that satisfy a condition. I want to know if there's like...
(4) odpowiedzi
2017-11-09 04:11 Map cycle values (java) »
thanks for reading! So I'm making a program that gives you solutions for possible alphametics equations (if you don't know what that is keep on readi...
(0) odpowiedzi
2017-11-08 23:11 Java 8 extract non null and non empty value from HashMap »
Let consider a below HashMap HashMap<String, String> map = new HashMap<String, String>(); I have values in map like map.put("model", ...
(5) odpowiedzi
2017-11-08 06:11 What ordering does dict.keys() and dict.values() guarantee? »
This question arises from this answer where one user uses d.keys() and d.values() separately to initialise a dataframe. It's common knowledge...
(1) odpowiedzi
2017-11-07 20:11 "Regrouping" data from nested dictionaries »
I have a JSON document like this: { 'item1':{ 'value':[a,b], 'number':1 }, 'item2':{ 'value':[a], 'number':2 }, 'item3':{ 'val...
(1) odpowiedzi
2017-11-06 12:11 How to get a key in a JavaScript Map by its value? »
I have a js Map like this one let people = new Map(); people.set('1', 'jhon'); people.set('2', 'jasmein'); people.set('3', 'abdo'); what I want is...
(3) odpowiedzi
2017-11-03 14:11 Reading words from txt file - Python »
I have developed a code that is responsible for reading the words of a txt file, in my case "elquijote.txt" to then use a dictionary {key: value} to s...
(3) odpowiedzi
2017-11-03 10:11 Assigning python dictionary literals: are the semantics guaranteed? »
Simple question: Python 2.6.6 (r266:84292, Aug 9 2016, 06:11:56) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2 Type "help", "copyright", "credits...
(1) odpowiedzi
2017-10-31 23:10 How to merge two lists into dictionary without using nested for loop »
I have two lists: a = [0, 0, 0, 1, 1, 1, 1, 1, .... 99999] b = [24, 53, 88, 32, 45, 24, 88, 53, ...... 1] I want to merge those two lists into a di...
(6) odpowiedzi
2017-10-24 21:10 Using Dates as keys in a dictionary saved to a plist »
I have a dictionary which I save to and read from a plist file. When the dictionary type is [String : String], I can add entries and save it to the p...
(1) odpowiedzi
2017-10-16 13:10 Adding keys to dicts within a list, from values in a list »
How can I add keys to a dict within a list, if the dict contains a certain key, from values in another list? I have a list of dicts. Those dicts eith...
(3) odpowiedzi
2017-10-15 01:10 How can Swift Dictionaries be used to store generic objects [T : C<T>]? »
I am having difficulty using Swift Dictionaries to store generic objects. I am trying to stores objects in the following way: [C: Container<C>...
(1) odpowiedzi
2017-10-14 06:10 (Python 3) Sorting movies with dictionary and list »
I am working on this project for school and I can't seem to get it perfect. I got the majority of it working but there's two things I am struggling wi...
(4) odpowiedzi
2017-10-08 17:10 Multiples-keys dictionary where key order doesn't matter »
I am trying to create a dictionary with two strings as a key and I want the keys to be in whatever order. myDict[('A', 'B')] = 'something' myDict[('B...
(2) odpowiedzi
2017-10-08 04:10 Override dict() on class »
I'm trying to make a dict-like class in Python. When you make a class, you have certain methods that tell Python how to make a built-in class. For ex...
(2) odpowiedzi
2017-10-07 21:10 How to map using multiple variables in python? »
I need help with this, I have a list of lists and a list of dictionaries. The list of dictionaries has for its values, list of indexes that point to ...
(1) odpowiedzi
2017-10-06 20:10 creating dictionary from the list with each elements as key:value pairs in python »
I have a list where the content of list are key:value pairs something like shown below sample =['ldb:21', 'baseB:4', 'cache-6:55', 'Xauthority:1', '...
(4) odpowiedzi
2017-10-04 09:10 collection of key-value pairs where key depends on value »
I have a class MyClass class MyClass { public string Name { get; set; } // is unique among all instances public SomeClass Data { get; set; } ...
(2) odpowiedzi
2017-10-02 15:10 Pickle a dict subclass without __reduce__ method does not load member attributes »
I have the need to ensure that a dict can only accept a certain type of objects as values. It also have to be pickable. Here is my first attempt: ...
(1) odpowiedzi
2017-09-26 12:09 Multiple orderings on single sets or maps - how can this be achieved in Java 8? »
There is some probability that this question might be a duplicate, however, I have not found a satisfiable answer yet: I have a set (in the meta sens...
(0) odpowiedzi
2017-09-22 00:09 How do I create an Or condition on a dictionary of elements in Python? »
dict = {a:[1,2,3,4], b:[4,5,6]} I would like to create a function func1 that takes in a dictionary as an argument def func1(dict, elem1, elem2): ...
(1) odpowiedzi
2017-09-21 16:09 How to make a list of integers that is the sum of all the integers from a set of lists in a dict? »
Let's assume I have a created a dict that is made up of n keys. Each key is mapped to a list of integers of a consistent length. What I want to make ...
(2) odpowiedzi
2017-09-18 16:09 Check if line is a dictionary type and print the data? »
I have .txt file and its loaded with a lot of text but in between 2-3 paragraphs there is a text like dictionary: somerandomtextinthisline {"key1":"v...
(2) odpowiedzi
2017-09-16 14:09 Multiprocessing pool: How to call an arbitrary list of methods on a list of class objects »
A cleaned up version of the code including the solution to the problem (thanks @JohanL!) can be found as a Gist on GitHub. The following code snipp...
(1) odpowiedzi
2017-09-15 12:09 Splitting list of dictionary into sublists after the occurence of particular key of dictionary »
I have list of dictionaries. These dictionaries basically have just one key-value each. For example: lst = [{'x': 23}, {'y': 23432}, {'z': 78451}, ...
(5) odpowiedzi
2017-09-11 19:09 Best Data Structure for fast retrival, update, and keeping ordering »
The problem is as follows I need to keep track of url + click count. I need to be able to update url quickly with click count when user click on tha...
(5) odpowiedzi