Tag Info

New answers tagged

1

To answer the first question: ListAnimate[list] stores the list in the output, while Animate[code,...] stores only the code. Animate does not store the definitions of symbols referenced by code. If code is not self-contained, then the definitions will have to be executed before Animate will run properly. To answer the second question, which is also ...


1

You don't want to pass the full data set into the Manipulate. You just want to pass its name and have it evaluated inside the Manipulate. Try the following. Is it fast enough? SeedRandom[42]; data = RandomReal[{0, 1}, {500, 500, 500}]; SetAttributes[vizData, HoldFirst]; vizData[dataVar_Symbol] := Manipulate[Image[dataVar[[All, All, i]]], {i, 1, 500, 1}] ...


11

This function will be rewritten in C for 10.0.2 and should come down to average-case complexity of $O(n)$ from its current $O(n \log(n))$. Note that the version most users will be bothered to write (and the way we advertized this before in the docpage for DeleteDuplicates) is $O(n^2)$, so most users are probably already winning. In the meantime, my advice ...


23

Summary We can look at the code of DeleteDuplicatesBy and it turns out it uses GroupBy. The test cases proposed by Mr.Wizard are all handled by some part of the code of DeleteDuplicatesBy. Other parts of this code also seem to have some issues. Most of the members of the *By family of functions seem to have side effects. How DeleteDuplicatesBy works It ...


16

Attempting to analyze the performance of this function in the manner that Taliesin Beynon did for PositionIndex I shall use the same tools. The old method that will be compared in all cases below: myDeDupeBy[x_, f_] := GatherBy[x, f][[All, 1]] Speed A BenchmarkPlot of DeleteDuplicatesBy versus myDeDupeBy: Needs["GeneralUtilities`"] BenchmarkPlot[ ...



Top 50 recent answers are included