Questions tagged [idiomatic-usage]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers

Intervals v.s. Domains: when to use which and why?

or: How to use Interval correctly? Mathematica provides these constructs for various symbolic deductions tasks. Among those constructs are symbolic number sets ...
Gravifer's user avatar
  • 812
1 vote
0 answers

Idiomatic pattern for subtracting a function from a list

I would like to know a more idiomatic way to subtract a function from a list of pairs than this: Table[point-{0,fitFunction[point[[1]]]}, {point,data}] I use this ...
Diffycue's user avatar
  • 1,721
2 votes
2 answers

Concise / idiomatic replacement for a For loop [closed]

I am using the following For loop to measure the misclassification errors in a Classifier. ...
Saqib Ali's user avatar
  • 275
2 votes
0 answers

Purpose of construct `With[{var=myComputation[...]}, var/;True]`? [duplicate]

Could someone please give an illustrative example showing the purpose of construct of form With[{var=myComputation[...]}, var/;True]? Also, I wonder what kind of ...
qazwsx's user avatar
  • 8,626
14 votes
3 answers

Zero-dimensional matrices

In a recent Mathematica project, $(n \times 0)$- and $(0 \times n)$-dimensional matrices have suddenly become a frustratingly common edge case for me. For instance, consider the following two ...
Eric Peterson's user avatar
22 votes
4 answers

Getting lengths of sublists that sum to more than one

I have a long list of numbers, and I'm interested in finding the length of each sublist that totals to more than 1, so for the list ...
Pillsy's user avatar
  • 18.2k
28 votes
7 answers

Efficient way to count the number of zeros at the (right) end of a very large number

If I want to count the number of zeros at the (right) end of a large number, like $12345!$, I can use something like: Length[Last[Split[IntegerDigits[12345!]]]] ...
Isaac's user avatar
  • 3,169