4.33 Tuesday, May 2, 2017

================================== 
Top new questions this week: 
==================================

[Count works differently depending on how an association was created] https://mathematica.stackexchange.com/questions/144813/count-works-differently-depending-on-how-an-association-was-created

Bug introduced in 10.4 and persisting through 11.1.1

I create two associations, that are supposed to be exactly the same. And then I want to count the elements at the second level. And I get ...

- asked by Stitch (19 votes), answered by WReach (12 votes)

—————————-

[Why is Plus so much slower than Total?] https://mathematica.stackexchange.com/questions/145019/why-is-plus-so-much-slower-than-total

Why is Plus so much slower than total for summing lists?

list = RandomReal[1, 10000000]; 
AbsoluteTiming[Plus @@ list] 
AbsoluteTiming[Total[list]] 
 
 
Output: 
 
{1.67408, 5.00073*10^6} 
{0.00570379,  ...

- asked by Jorge Perez (14 votes), answered by Shadowray (17 votes)

—————————-

[Delete duplicates from list of lists as if on a necklace] https://mathematica.stackexchange.com/questions/144696/delete-duplicates-from-list-of-lists-as-if-on-a-necklace

Given a list of lists of integers, all of the same length, I want to regard two elements as equivalent if one is the rotated and/or reflected version of another (that is, if the two lists are the same ...

- asked by rogerl (13 votes), answered by Shadowray (13 votes)

—————————-

[Exchanging numpy arrays between Python and Mathematica?] https://mathematica.stackexchange.com/questions/144770/exchanging-numpy-arrays-between-python-and-mathematica

I've been using np.savetxt(location, result, delimiter=',') 
in Python followed by Import[location,"CSV"] in Mathematica. 
 Some of my files are around 1GB, opening seems a bit slow, what else do people  ...

- asked by Yaroslav Bulatov (12 votes), answered by xslittlegrass (16 votes)

—————————-

[How to plot planar graphs in a visually pleasing way?] https://mathematica.stackexchange.com/questions/144594/how-to-plot-planar-graphs-in-a-visually-pleasing-way

Cross posted to Wolfram Community

Mathematica has a layout algorithm to plot planar graphs without edge crossings. This typically produces an ugly triangular layout where some vertices and edges ...

- asked by Szabolcs (11 votes), answered by Szabolcs (6 votes)

—————————-

[Where are my Cloud Credits going?] https://mathematica.stackexchange.com/questions/144859/where-are-my-cloud-credits-going

In less than a month I've used 5k cloud credits (half of my quota) 
and all I did was deploying a bunch of static notebooks with 
CloudDeploy[CurrentNotebook[],permissions->Public] (more  ...

- asked by Yaroslav Bulatov (10 votes)

—————————-

[Mathematica erroneously says this integral does not converge] https://mathematica.stackexchange.com/questions/144965/mathematica-erroneously-says-this-integral-does-not-converge

Mathematica (as of v. 11.1.0) does not recognize that this special case of Frullani’s integral converges:

Integrate[(ArcTan[a*x] - ArcTan[b*x])/x, {x, 0, Infinity}] 
(* Integrate::idiv: Integral of  ...

- asked by Pillsy (10 votes), answered by Michael E2 (16 votes)

================================== Greatest hits from previous weeks: ==================================

[Generating a Sierpinski carpet] https://mathematica.stackexchange.com/questions/22052/generating-a-sierpinski-carpet

I am trying to draw a Sierpinski_carpet. I have code that works, but I think there is a more elegant way to do than my way. Maybe I couls use Tuples or Permutations or some similar function to ...

- asked by chyaong (46 votes), answered by Mr.Wizard (75 votes)

—————————-

[Alternatives to procedural loops and iterating over lists in Mathematica] https://mathematica.stackexchange.com/questions/7924/alternatives-to-procedural-loops-and-iterating-over-lists-in-mathematica

While there are some cases where a For loop might be reasonable, it’s a general mantra one I subscribe to myself that "if you are using a For loop in Mathematica, you are probably doing it wrong". ...

- asked by Mr.Wizard (154 votes), answered by Mr.Wizard (104 votes)

================================== Can you answer these? ==================================

[How to get parent key in Query on Association/Dataset?] https://mathematica.stackexchange.com/questions/144995/how-to-get-parent-key-in-query-on-association-dataset

Is there a general and terse method to obtain the parent key of the current "position" in a Query of an Association/Dataset?

Say I have the following Association.

assoc = 
 <|"A" -> 
     ...

- asked by Edmund (3 votes)

—————————-

[Can anyone help me decipher these few lines? Also, converting this code for a 2x2 matrix input to a 3x3 matrix input?] https://mathematica.stackexchange.com/questions/145049/can-anyone-help-me-decipher-these-few-lines-also-converting-this-code-for-a-2x

Here’s the code. I’m completely new to Mathematica so bear with me.

clear[ug]; 
ug[{{a11_, a12_}, {a21_, a22_}}] := 
 Module[{A, f, b1, b2, y1, y2, U, P1, P2, UG}, 
  A = {{a11, a12}, {a21, a22}}; 
   ...

- asked by Pacotacobell (2 votes)

—————————-

[Bifurcation package like AUTO?] https://mathematica.stackexchange.com/questions/144795/bifurcation-package-like-auto

I was wondering if there is any available continuation and bifurcation analysis package for Mathematica. I’m looking for something like AUTO. I’ve seen there is already a Matlab version of the ...

- asked by Mirko Aveta (3 votes)