Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 10763

Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.

10 votes
2 answers
559 views

Generate cyclic list from a list

Given a list (for example, {3, 5}) I would like to make a function genCyclic[n_, list_] which generates a cyclic patterns of list with length n, such that genCyclic[5, {3, 5}] returns {3, 5, 3, 5, 3} …
Sungmin's user avatar
  • 2,305
8 votes
5 answers
1k views

Find (longest) overlapping elements between two lists

I am trying to write a function f that returns the overlapped sublist where A ends with this sublist while B starts with it. For examples, suppose I have two lists A = {1, 2, 1, 3, 1, 3}; B = {1 …
Sungmin's user avatar
  • 2,305
6 votes
5 answers
405 views

A variant of `Nearest`: Find the largest value that is smaller (larger) than a given value

We have a built-in function Nearest which returns a function for evaluating the nearest value of inputs. However, as a slight variant, I would like to construct a "function object" created from a one …
Sungmin's user avatar
  • 2,305
11 votes
2 answers
342 views

Why `Drop` and `Take` do not support a operator form

Since Mathematica 10 introduced the operator form, I have been a big fan of it. Whenever I use some buit-in functions, I first look up whether they support operator form. To me, it was quite surpris …
Sungmin's user avatar
  • 2,305
9 votes
3 answers
776 views

Generalization to AllTrue, AnyTrue and NoneTrue

I am wondering if there is a natural Mathematica way to generalize those functions. To be specific, All three functions AllTrue, AnyTrue and NoneTrue return a Boolean value when a list of length L con …
Sungmin's user avatar
  • 2,305
3 votes
1 answer
268 views

Finding pairs where the intersection of them is empty set from a nested list

It would be better to give an example first. Suppose I have a nested list of the form list = {{ 1,2,3,6}, { 3,6,10,20}, { 4,7,11}, { 10,20}}; where each element of list is a list of integers from …
Sungmin's user avatar
  • 2,305
14 votes
2 answers
901 views

Choose between `Apply` and `Map`

Even though this might be too general question(or not answerable), I want to get some advice here. I apologize in advance if it is not a relevant question. I frequently have to process large list of …
Sungmin's user avatar
  • 2,305