156k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
2k views

### Why is the new PositionIndex horribly slow?

This issue has largely been mitigated in 10.0.1. New timings for the final test below are: ...
• 272k
2k views

### Accessing list elements by name

First, a bit of a long introduction to my problem: I only have a few weeks of Mathematica experience. I am creating a mathematica application that calculates some material properties of steel based ...
• 305
1k views

### How to search Dataset to find all keys share same Value

If I have the following Dataset ...
• 19.9k
975 views

### intersection between two 2D arrays with labeled data is slow

Here is how to Generate data the function is below with two images to generate data img1 img2 ...
• 8,960
491 views

### Total by a criteria

I am developing a weighted KNN algorithm. In a step, I need to do the sum of weights of each class. For example: ...
• 2,026
475 views

### Head of a MatrixForm expression?

An example in http://www-zeuthen.desy.de/theory/capp2005/Course/hahn/mathematica.pdf amounts to the following ...
• 11.9k
3k views

### efficient way to give nearest neighbour and next nearest neighbour of every point in a point set

Suppose we have a point set, the points are labeled 1,2,3,....n. And p[i] is the coordinate of the point. Now I want the label of nearest and next nearest point (...
• 17.2k
437 views

### Truncating a list once all members of a set have appeared?

Consider if you would the case where we have some list of elements: list0 = {54, 4, 7, 9, 3, 54, 4, 20, 2, 456, 2, 3}; And we have some target list: ...
302 views

### Change sublist based on position

Supposed that: list = {2, 3, 5, 7, 9}; sublist = {{3, 3, 5}, {2, 2, 2, 7, 9}}; I want to change each sublist in sublist as following: Find the positions of ...
• 251
482 views

### Held keys in associations

Bug introduced in 10.0 and persisting through 11.0.1 or later Bug introduced in 10.0 and fixed in 10.4 Association is new in 10.0. Bug still present: ...
• 272k
2k views

### Use map on a different level

I have just started to get used to Mathematica's Map, Apply, and related functions, and I can't figure out how to do maps that require working "one level down". For example, I am currently trying to ...
• 1,030
316 views

### Dispatch not behaving like a normal expression in Mathematica 10

In Mathematica 9, I used to be able to do rules = Dispatch[{'a' -> 1, 'b' -> 2}] rules[[1]] to extract the rules from ...
264 views

### What is the fastest way to get a list of subexpressions and their positions?

I have spent quite some time trying to figure out what the fastest way is to get a list lists of all subexpressions and their positions. I have tried things with MapIndexed, which seems ideal in cases ...
• 12.2k