Questions tagged [function-comparison]
For topics about very similar functions. Use this tag for questions that are about to resolve differences between two or more functionalities.
2
votes
1answer
36 views
What's the difference between $Context<>“*” and “`*”?
When set context unique to this notebook:
ClearAll @@ { $Context<>"*" }
Clear["`*"]
can both clear the variables I assigned. I just wonder what's the ...
1
vote
2answers
98 views
Is there a meaningful difference between two ways of writing a Manipulate expression?
What is the difference between
Manipulate[Graphics[Disk[{x, 0}, 1], Axes -> True], {x, 0, 10}]
and
...
12
votes
2answers
185 views
Listable built-in functions - Why are they so fast on numerical vectors?
Consider the following small example, where I calculate Exp on a large vector by employing the listability which many mathematical built-in functions have:
...
4
votes
0answers
63 views
Export/Put and Import/Get
I have questions about importing and exporting that don't seem to have up-to-date answers anywhere.
What's the difference between Export and Put? Which should I use if I care about how long it takes ...
2
votes
0answers
37 views
Is there any reason to use FindFit over NonlinearModelFit? [duplicate]
Given that FindFit seems to just be able to return estimated coefficients and none of the other goodies (standard errors, confidence bands, residuals, etc.), under ...
8
votes
1answer
156 views
Difference between Import and Get of mx file
The documentation says
Import["file.mx"] is equivalent to Get["file.mx"]
.
However, I have at least one instance where <...
10
votes
1answer
294 views
Why use pure functions?
I've now read the official documentation of wolfram on (anonymous) pure functions, and the part about (anonymous) pure functions in the book "mathematica programming intro".
I believe I understand ...
3
votes
2answers
133 views
ListStepPlot vs ListLinePlot
When I plot the data I have using ListStepPlot and ListLinePlot[data,InterpolationOrder -> 0] I am getting two different plot....
6
votes
1answer
157 views
Classify vs LogitModelFit
Can someone explain me what is the difference between Classify[trainingset, Method -> "LogisticRegression"] function and ...
26
votes
3answers
928 views
What are the counterparts in Wolfram to left and right division of a matrix in other programming language, e.g. Julia and MATLAB?
Sometimes, to find the inverse of a matrix is a labor-consuming task, or even "disgusting", especially when the matrix is "ill". It is said, e.g. in Julia, that the left/right division operation is ...
0
votes
0answers
191 views
Derivative of list of points: DifferentiatorFilter versus DerivativeFilter
I need to calculate the derivative from a list of experimental points. Mathematica has two functions which seem to do this: DifferentiatorFilter and DerivativeFilter. Which one is better for ...
7
votes
0answers
285 views
Difference between UnitStep and HeavisideTheta?
In Mathematica, UnitStep[0] == 1 and HeavisideTheta[0] remains unevaluated. In addition, ...
9
votes
2answers
214 views
Reconstructing ContourPlot with ListContourPlot
Let f be some numeric function with two arguments
f[x_?NumericQ, y_?NumericQ] := x y
For the purposes of this question ...
1
vote
1answer
77 views
ContourPlot ClippingStyle?
In Plot3D, Mathematica by default imposes a scheme for clipping the plot if it exceeds the PlotRange. You can change the default ...
5
votes
1answer
60 views
Performance issue of Merge function
I am using mma 11.0.1
This post is related to my previous faster way to merge data.
enlightened by Edmund's answer, I found a subtle performance issue of Merge
...
31
votes
3answers
2k views
6
votes
1answer
280 views
6
votes
0answers
107 views
Difference between Timing, AbsoluteTiming, and Elapsed?
In the picture below,
Difference between Timing, AbsoluteTiming, Time and ...
10
votes
0answers
98 views
URL functions overload
All these functions seem capable of doing the same things: Import, URLFetch, URLSave, ...
5
votes
1answer
141 views
What is the point of StringForm?
I never really understood the point of StringForm returning a StringForm rather than a String...
42
votes
3answers
2k views
Is manual adjustment of AccuracyGoal and PrecisionGoal useless?
This is a problem confusing me for years.
AccuracyGoal and PrecisionGoal are two options that I never truly understand and, to ...
14
votes
2answers
477 views
Good clearing practices
I have been using Mathematica for about 2 years and I'm pretty ok to write and optimize my code. Wanting to improve my practice, I often look at code examples. However, I can not determine if there is ...
7
votes
1answer
131 views
Difference between Initialization Cell and Group
Is there a difference between setting a Cell or a Group of cells to be an Initialization Cell...
4
votes
1answer
114 views
Difference between `StringJoin` and `StringExpression`
When does one need StringJoin as opposed to StringExpression? I don't know of an example where ...
24
votes
1answer
594 views
Defer, Hold, Unevaluated, Inactivate — which one when?
What are some guidelines on which function to select from among the superficially similar functions Defer, Hold, ...
16
votes
1answer
686 views
What is the difference between MathLink and WSTP? Which one should I use?
What is the difference between MathLink and WSTP programs? Will the use of MathLink protocol be maintained or not?
13
votes
2answers
525 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 ...
10
votes
2answers
752 views
Difference between Evaluation ► Quit Kernel and Quit[]
What is the difference between Evaluation ► Quit Kernel and Quit[]?
Both seem to quit the kernel (and clearing all definitions)...
28
votes
1answer
855 views
Why some built-in functions are slow
I just wonder why some built-in functions are slower compared to some other ways using more than one built-in functions for doing same job.
consider this example:
...
15
votes
8answers
673 views
Product of elements of a list
Sum is for functions; Total is for a list. Product is for a function; what is the command ...
45
votes
4answers
1k views
What's the difference between Inactive and HoldForm?
In version 10, Mathematica not only added Inactive / Activate but also highlighted this change in the "New in 10" page (in Core ...
44
votes
2answers
5k views
Scan vs. Map vs. Apply
I cannot understand the difference between Apply, Scan, and Map.
I have tried to play with ...
33
votes
1answer
537 views
Why is multidimensional Reverse slow?
Bug introduced in 6.0 or earlier and persisting through 11.1.1 or later
I have found that multidimensional Reverse is ~10 times slower than exact ...
23
votes
1answer
2k views
Two ways to map a function on a list: Which one is faster?
There are two ways to make a function listable on the list: Use Map or use SetAttributes. My question is, which one is faster, ...
60
votes
2answers
4k views
when is f@g not the same as f[g]?
I have always thought that f@g will give the same result as f[g] in all cases, and it is just a matter of style which one to use ...
7
votes
1answer
187 views
Difference between Directory[] and NotebookDirectory[] .. a trailing /?
The following was the code:
Directory[]
NotebookDirectory[]
The output was
...
10
votes
0answers
732 views
What are the known differences between Save and DumpSave, and how to account for them?
Edit: I changed the title and (slightly) the wording of this question in order to make it more easily answerable.
If I evaluate this in Mathematica 9:
...
85
votes
2answers
18k views
What is the difference between Reduce and Solve?
Solve and Reduce both can be used for solving equations.
Just by working with them, I know there are some differences between ...
26
votes
4answers
666 views
What is the point of Refresh if Dynamic has an UpdateInterval option?
I haven't found an example where I can't get rid of Refresh[]:
...
35
votes
2answers
5k views
Difference between AbsoluteTiming and Timing
I need to evaluate the efficiency of my code. Therefore I would like to evaluate the time the code need for some calculations. Mathematica gives me two possibilities for this kind of evaluation:
<...
33
votes
2answers
1k views
18
votes
2answers
726 views
Part extraction vs functions like First, Last?
There are many ways to extract different parts of lists in Mathematica. For example, the first part of a list v can be accessed either as ...
209
votes
7answers
11k views
What are the use cases for different scoping constructs?
Mathematica includes three functions that I know of which can be used to effectively (if not actually) define a variable and give it a value within a local scope: ...
92
votes
4answers
3k views
What best practices or performance considerations are there for choosing between Cases, Position, Pick and Select?
Cases, Select,Pick and Position each have different ...