ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 08 Nov 2020 07:12:02 +0100Combining and sorting multiple enumerated listshttps://ask.sagemath.org/question/54156/combining-and-sorting-multiple-enumerated-lists/ Hi,
I have a bunch of lists that have been enumerated. I would like to combine them into a single list in the number order of the lists. For example: I have these lists a = [2,8,10], b = [0,3,5], c = [1,4,7], d = [6,9,11] I would like to combine them into one list like this [b,c,a,b,c,b,d,c,a,d,a,d]. However, due to my actual work all enumerated lists are of different lengths. Even a few of them are null sets at this time until I am ready to process a much bigger set.nooniensoong97Sun, 08 Nov 2020 07:12:02 +0100https://ask.sagemath.org/question/54156/How do you sort Beker and Piper characteristic frequencies in order from least common to most common frequency?https://ask.sagemath.org/question/53360/how-do-you-sort-beker-and-piper-characteristic-frequencies-in-order-from-least-common-to-most-common-frequency/ Hello, I am trying to figure out how to sort the characteristic frequency of each letter in the table for beker and piper. I currently only have the code that will output the beker and piper table in order from the alphabet but I was wondering if there is a way to sort them from least to greatest based on their frequency?
Any information helps and here is the code I have so far
N = AlphabeticStrings()
table = N.characteristic_frequency(table_name="beker_piper")
sorted(table.items())HoeckinMon, 07 Sep 2020 17:48:23 +0200https://ask.sagemath.org/question/53360/update a value entry following some rulehttps://ask.sagemath.org/question/46660/update-a-value-entry-following-some-rule/ i have a vector $(x_1, \dots,x_n)$ where $x_i$ belongs to some set $E$ how can i assign randomly a letter $a,b,c$ to each vector than update it following some rule these vector ?
Example $E=\{ x_1, x_2,x_3 \}$
$(x_1, x_2,x_3)=a$
$(x_2,x_3,x_1)=a$
$(x_3,x_1,x_2)=c$
$(x_3,x_2,x_1)=whatever$
$(x_1,x_1,x_1)=whatevre$ etc...
i have a rule that if $(x_1, x_2,x_3)=a$ and $(x_2,x_3,x_1)=a$ then $(x_3,x_1,x_2)$ must be equal to $a$
TWJSat, 25 May 2019 09:15:17 +0200https://ask.sagemath.org/question/46660/Call to sort() returns "None"https://ask.sagemath.org/question/10119/call-to-sort-returns-none/I am using SAGE to calculate the arguments of the eigenvalues of a randomly-generated matrix. Here is my code.
evals = Mat(CDF,10).random_element().eigenvalues()
eval_args = map(arg, evals)
print eval_args.sort()
For some reason, the call to `.sort()` does not work, and what is printed is "None." Why does this happen?Alan ChangTue, 14 May 2013 12:33:02 +0200https://ask.sagemath.org/question/10119/Finding the permutation that sorts a listhttps://ask.sagemath.org/question/9948/finding-the-permutation-that-sorts-a-list/Given a list (say, of numbers) `L`, the method `L.sort()` will put its elements in order. The function `sorted(L)` returns a new list with the elements of `L` in order. I would like a version of `sorted` that will not return the elements of `L` in sorted order, but rather, the *permutation* that puts them in sorted order. Does this exist in Sage? Thanks.Ed ScheinermanWed, 27 Mar 2013 19:44:08 +0100https://ask.sagemath.org/question/9948/