6
votes
1answer
124 views

Path construction using `Nearest` shows ill behavior?

I have a dataSet that I'm trying to sort choosing a starting point and going to its nearest neighbor, and then to its nearest neighbor and so on. To do so, I've ...
0
votes
0answers
31 views

Check if a (possibly nested) list is real [duplicate]

I have a very large matrix of numbers. I want to check if all its entries are real. At the moment I am using realQ = And @@ Thread[Flatten[Im @ #] == 0] & Is ...
1
vote
2answers
128 views

Discretizing data using quantiles in Mathematica

I am trying to discretize a long array of real numbers into a uniformly distributed integer array. To do this I am identifying the quantile where each real value sits and writing it out to the output ...
5
votes
1answer
177 views

Selecting a list from a list of lists

In working through Programming Paradigms Via Mathematica (A First Course) I have come across this two part question: A permutation of length "n" is a list of the first n positive integers in ...
6
votes
2answers
695 views

Elegant way to handle columns operations

Inspired by this question from @sjdh and by my recurrent use of columns operations in database sets, I was looking for one way to make columns operations more symetric, so I can handle with matrix and ...
13
votes
9answers
548 views

Thread over list in different levels

I have these two lists, both with the same length in the first dimension: ...
11
votes
3answers
508 views

Simpler way to fill date gaps with zero values

One basic problem when working with data like sales and dates is the case where you dont't have sales in all days, so you have to fill it to take information as average or to make a plot. See this toy ...