Items tagged with listtools listtools Tagged Items Feed

Hello

I am working my way back to use Maple for some calculations I did in the past.   ListTools seems to have some of the functions I need but I couldn't find anything that gives me the position of all groups of repeated elements in a list of a list.  For instance, ListTools:~MakeUnique removes the copies of all repeated elements but it seems that there is no counterpart function that gives the position of the repeated elements, is there?

Search and SearchAll return position but they seem to be the only ones.  

Example:

a:=[[x+y+z],[2*x+y+z],[x-y+z],[2*x+y+z]];

and the expected output would be

pos:=[[1],[2,4],[3]];

Many thanks

Ed

 

Hi

First question is, given a list of some positive integers, how can I normalize this list? Normalize here is in the sense that, for example, if 

L := [1,3,4,4,5,7,7,7,8]

then there really are only 6 different integers appear, so I would like to assign each part an integer from 1 to 6 in ascending order. So 1 becomes 1, 3 becomes 2, 4 becomes 3, 5 becomes 4, 7 becomes 5 and so on. Normalized list will be

NormalizedL := [1,2,3,3,4,5,5,5,6]

 

Second question is given a list, let's say [1,3,1,3,2,2,4,4], how can I normalize it in a similar way but now we assign each integer upon occurrence of a part. So [1,3,1,3,2,2,4,4] will be [1,2,1,2,3,3,4,4]. This is necessary for me because lists have repeating parts. 

Another example will be [2,4,4,1,2,2,3,3] will be [1,2,2,3,1,1,4,4]. 

Thank you 

I am pretty new to programming in Maple and trying to learn the language. One thing I needed was how to handle lists in a specific way. I have used many hours on this issue now and even asked questions in the Questions section. Other users helped me with clever tricks and I am grateful for that. What is left is however a feeling that one need to know a lot of rather Ad Hoc commands to accomplish your tasks. I looked for operations in the ListTools package, going through all...

Dear Maple users

I am looking for easy ways to manipulate lists. Especially I want to take a list of lists, say:

[[1,3], [5,8], [9,2], [5,12]]

and create a list of the second components:

[3,8,2,12]

Another problem: How do I collect every second element of a list, say:

[4,2,-1,9,5,6,2,0,14,7]

creating [2,9,6,0,7].

I can do it with loops, but I guess there is a smarter way to accomplish these tasks. I was looking...

I frequently have a list of numbers and what I want is a sorted list of unique elements with a count of how many times each element appears.  Is there some way to do this with ListTools?

Here is my code:

listhist := proc(L)
local S, T, i;
T := table(sparse):
for i in L do T[i] := T[i]+1; end do;
S := sort(map(op,[indices(T)]));
[seq([i,T[i]], i=S)];
end proc:

Dear Sir/Madam,

I have a list with positive and negative values. Now I want to count the amount of values less than 0. I tried a few things from the ListTools but nothing is working. I hope you can point me in the right direction.

Kind regards,

Nine Klaassen

Master student TU Delft

Using the Open Maple application program interface (API), the ExternalCalling module, a C compiler, and some basic understanding of the Maple data structure format, you can create Maple utilities that run nearly as fast as Maple builtin procedures.

To show how this is done, I will start with a simple example and then proceed to a slightly more complex procedure that improves ?ListTools[SearchAll]

hello everybody

please heeeelp

Page 1 of 1