I can use CityData[{Large, "California", "United States"}] to get all the large cities in CA. How can I see how Large is defined, so that I can substitute my own kinds of entity properties into the CityData invocation?
@C.E. I understand that "large" means something roughly like EntityProperty["City", "Population" ⇒ 100000]. How do I see Mathematica's symbolic definition of Large? I'd like to make my own criterion (e.g., cities with population between 500k and 1M, or cities with an area of at least 10 square miles, etc.).
Basically I'm hoping to use the Large definition as a starting point because that'll probably be the easiest to modify to get what I want. Failing that, I'd settle for just being able to tell Mathematica directly via an EntityProperty.
I'm attempting to draw from a six-dimensional probability distribution (namely, the Boltzmann distribution over three dimensions each of position and momentum) using RandomVariate, and I'm getting the error "Sampling from the probability distribution […] is not implemented".
I've read through mathematica.stackexchange.com/questions/2635/…, and am wondering whether there are any newer workarounds available for newer versions (10 or 11) of Mathematica, as this would get extremely tedious when applied to > 2 dimensions.
(I would also be open, of course, to other methods besides those given by Sasha in the linked answer)
@Kuba @b3m2a1 and anyone else playing with paclets: you should be aware that the PacletManager` context will not be in the $ContextPath when the notebook's default context is set to "Unique to this Notebook". This when giving instructions to people on how to install something with PacletInstall, it is best to tell then to start with Needs["PacletManager`"].
@b3m2a1 I don't know how these "unique to notebook" contexts work. They cause some system variables (which are in the System context) to also be unique to the notebook. Examples are $Line and $ContextPath. As far as I can tell, the only effect here is that in that notebook the PacletManager context is not in the $ContextPath. But the package is still properly loaded (and loaded only once).
@Szabolcs I meant more like, since it's loaded via a non-core mechanism it's not included on the standard $ContextPath. But it looks like the $ContextPath is even more bare-bones than I had expected. It's just the notebook context and "System`"
@JohnFeminella it's set at the level of DataPaclets`CityDataDump`ComputeFunction. See this for more info on what that means. You can set that at the EntityStore level.
Also this is the actual definition that computes Large:
Sometimes I write / do things that I think the community might be interested in, but I don't want to spam the community with junk and don't want to be / people think I'm self-promoting. And I'm wondering if there's any good, unobtrusive way to mention such things here.
This came to mind because ...
@hftf You don't. At least not like this. Associations are atomic which means your questions is basically, why {1, 2, 1.2} /. 2->foo doesn't give {1, foo, 1.foo}.
@hftf Yes. The problem is that there is no general way of accessing atomic structures (that don't look atomic). Let's say you replace the number 2 with a 3 and your list contains an image, then you need a completely different way of accessing the pixel structure.
Because with your simple replacement, pixels with the value 2 won't be replaced either.
And in version 11 there are quite a lot atomic structures, like Graphs and stuff. So the best you can do is to make a general replace function that handles you corner cases.
Which leads to interesting stuff like this: Hold[Association[1 -> 2]] not formatting and this being possible: Hold[Association[1 -> 2]] /. (1 -> 2) -> 3
But this doesn't work: Hold[Evaluate@Association[1 -> 2]] /. (1 -> 2) -> 3
On that Evaluate call the expression itself is pegged as atomic
Effectively Association is a constructor for an Association instance. And all the nice stuff we do is defined for instances, not expressions containing the constructor.
@J.M., thanks. I'm not experienced with rolling my own RNGs, are there any resources you would recommend reading up on, or any third-party utilities worth considering?
So I sunk a few hours yesterday into looking at how questions score as a function of when they were asked. You can read the primary report of what I found here.
Probably the most interesting part is this graph:
That's a break down of average score for a question as a function of when in the d...