Items tagged with listtools listtools Tagged Items Feed

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...

List manipulations...

August 20 2013 erik10 341

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:


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


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