Python equivalent of Wolfram Language Query for JSON?

The Wolfram Language has a Query function that can traverse data structures and apply functions at different levels of the structure. I am working with multi-level JSON structures and need a function that has similar functionality as that of Query in the Wolfram Language. Which Python package and function(s) best replicates this? For a minimal working example, say I have the following JSON structure. (String escapes omitted for simplicity) x = { "Dims1":[ { "Apple":{ "Baking":[ "Pie", "Tart" ], "Plant":"Tree", …
Category: Data Science

R code that gives results like Wolfram Alpha for the expectation of a function of a random variable?

When I ask Wolfram Alpha to calculate $E[f(X)]$ where $f(x) = e^{-x^2}$ and $X \sim \mathcal{N}(1,4)$, it gives the result $$ E[f(X)] = \frac{1}{3\sqrt[9]{e}} \approx 0.29828, $$ and the following plot which appears to be based on taking a number of simulations: How can I generate the same type of plot using R?
Category: Data Science

Algorithm or JS graph drawing library that can generate a graph of 100,000+ nodes and edges while minimizing edge crossings

I'm trying to plot a directed graph of $2^{16}$ nodes and $2^{16}$ edges (but not simply a cycle). Ultimately, I need to be able to share an interactive graph (zooming, panning, labels). Mathematica did a fine job of drawing this graph in a way that minimized edge crossings: What you're seeing is a mass of nodes (blue) mashed up, totally hiding all the edges. This isn't a viable solution because it (1) requires an installation of Mathematica, (2) takes several …
Category: Data Science

Python equivalent of Wolfram Language ParametricPlot3D?

The Wolfram Language as a ParametricPlot3D that can be used to interactively examine parametric functions in 3D. Which Python package and function(s) best replicates this? I have several series of data that I would like to represent as categorical curves in an interactive 3D plot in a Python project. As a minimal example on a set of 10 series with 20 observations in each, in Wolfram Language I can SeedRandom[987] obs = RandomVariate[StudentTDistribution[3, 1, 5], {10, 20}]; foos = PDF@*SmoothKernelDistribution …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.