list-manipulation
sorting with changes to the other part in mathematica
I am just wondering: given a list {{{3,1,2},{4,2,5}},{{7,1},{2,4}}}, I want to sort the first component, then have the second开发者_如何学编程 component change as the first one does. The desired resu[详细]
2023-02-16 03:51 分类:问答two list operations in mathematica
I have two list operations which I would like to ask for help. The way I implemented them is not very elegant, so I want to learn from you experts.[详细]
2023-02-15 12:53 分类:问答Lisp Exercises Involving List Manipulation
I trying to complete this exercise; Write a Lisp function that takes as input a list of elements, such as (A B C)[详细]
2023-02-07 08:38 分类:问答In python, how do I take the highest occurrence of something in a list, and sort it that way?
[3, 3, 3, 4, 4, 2] Would be: [ (3, 3), (4, 2), (2, 1) ] 开发者_JAVA百科 The output should be sorted by highest count first to lowest count. In this case, 3 to 2 to 1.You can use a Counter in Pytho[详细]
2023-02-06 08:38 分类:问答How can I get the concatenation of two lists in Python without modifying either one? [duplicate]
This question already has answers here: How do I concatenate two lists in Python? (31 answers) Closed 7 years ago.[详细]
2023-01-28 08:43 分类:问答Lazy "n choose k" in OCaml
As part of a bigger problem of enumerating a set, I need to write an OCaml function \'choose\' which takes a list and outputs as the list of all possible sequences of size k made up of elements of tha[详细]
2023-01-20 15:47 分类:问答Some built-in to pad a list in python
I have a list of size < N and I want to pad it up to the size N with a value. Certainly, I can use something like the following, but I feel that there should be something I mi开发者_如何学Cssed:[详细]
2023-01-10 15:05 分类:问答Does Linq/.NET3.5 support a 'zip' method?
In other languages (ruby, python, ...) I can use zip开发者_如何学C(list1, list2) which works like this:[详细]
2022-12-30 09:44 分类:问答In Perl, how can I get the Cartesian product of multiple sets?
I want to do permutation in Perl. For example I have three arrays: [\"big\", \"tiny\", \"small\"] and then I have [\"red\", \"yellow\", \"green\"] and also [\"apple\", \"pear\", \"banana\"].[详细]
2022-12-22 22:46 分类:问答