Skip to main content

WOLFRAM / Digging BIG Data for Visualization

My personal interest in Wolfram from the start is because of Wolfram's BIG KNOWLEDGE BASE. And also the way Wolfram could "filter" and "re-present" those data back to users in an interactive and rich kind of way.

I supposed it would be a really good personal case study and research for DATA VISUALIZATION.

If you are interested in Data Science, you should also check thing like R Programming. Or maybe look up some ways Python can process data.

SomethingData[]

Now, we know that Wolfram knows A LOT. However to access those knowledge, we need some kind of understanding about the way Wolfram store the data.

We can tell Wolfram to QUERY data using Wolfram Language SYMBOL, which I believe it will give you ENTITY, and further more the PROPERTIES of ENTITY.

For example:
1) Supposed we want to know more about our PLANET: Earth. Wolfram recognize this "Earth" as a String. What if we want to actually find out more about ENTITY called EARTH?
2) We could use the CTRL+ EQUAL and let Wolfram guess the ENTITY.
3) Which of course will give us back something like this: Entity["Planet", "Earth"]

By knowing the ENTITY, we can then further dig in the data.

Coincidentally, Wolfram Language has special SYMBOL, that deals with Planet Data, conveniently called: PlanetData[]

Please look up Wolfram Language Reference about PlanetData[] command to find out more details.

Quick example below is to query the AGE of EARTH:


You can apparently give it a list of planets:


Oppositely you can give it a list of properties you want to find out about.


And... something like this:



Further more, from documentation, you can see that the PlanetData[] command itself will give you all the list of the Planets. So we can do something like below:


And apparently you can add argument called: "EntityAssociation" and ended up with list like below.


That is a quick look at PlanetData[].

There are others, below are some of my favourite "SomethingData[]":

  • MovieData[]
  • CountryData[]
  • SpeciesData[]
  • PersonData[]
  • DictionaryLookup[]
  • CulturalData[]
I found something interesting, like with CountryData[], apparently giving it multiple list of PROPERTIES to query returns an error... but I can query PROPERTY for MANY COUNTRIES at the same time such as:

"Shape" (in Maps)



"Flag"

"Capital City"


I found that even at this level of exploration, Wolfram has amazing feature.

I could export out the Shape as SVG format for those countries and bring it into Blender 3D, for example and I could make a more interesting 3D render this way.

The Shape map of Australia is a bit screwed, maybe the SVG is not clean. Nevertheless, this is still interesting usage.
Country Flag Data as SVG, the color even comes with it.

FUNNY ACCIDENT

Actually during this exploration I found out few things. A long way, but sometimes more robust way, to get to the PROPERTY of ENTITY is by using EntityValue:

Table[   EntityValue[Table[Entity["Country", x], {x, {"Brazil", "Cuba"}}], x], {x, {"Name", "Population", "Flag"}}   ]


Above is actually a mistake, we should have done it like this:
EntityValue[ Table[Entity["Country", x], {x, {"Brazil", "Cuba"}}] , {"Name", "Population", "Flag"} ] 


Making "mistakes" like this is actually a great way to advance you in programming, only if you do not stop or giving up. We need to figure out the mistake and fix it. Read documentation and continue being curious to find out more.

TableForm[]


Grid[]







Comments

Popular posts from this blog

PYTHON / OpenCV, Recreate Uncanny Manga - Anime Style

Can you tell what it is? Computer Vision. Yesterday, I spend almost whole day exploring this opencv module using Python. What I discovered was revealing. Even at the very basic level, I could produce some interesting Image and Video manipulation using all the code collected from documentation and many, many blog tutorials. If you are a total noob like me, I am still getting used to knowing that the CV in OpenCV means Computer Vision! Actuallly, I recalled that I did try to get into OpenCV few years back ago, when I knew no Python and when Python opencv module was probably still early. It was all C++ code and it was a little bit too hard for me. I read a couple of books about opencv at the library, I did not understand a single thing. That was back then. Today, for strange reason, with a bit of knowledge of Python, I can go a little further. EDGE DETECT IN OPENCV Me holding you know what. What leads me this far is my curiosity on how we can replicate Wolfram Langu...

music21 / MIDI and Python

If you like to generate music with Python, the last time I checked, we have module for ChucK and also for Pi Sonic. They both require server to talk to Python, there might be slight latency and delay, but they are quite fun and easy to setup. And... there is also this fully Python module that deals with music: (a bit hard to use I found) http://ajaxsoundstudio.com/software/pyo/ I like the idea of being able to generate music on the fly via Python. Would be nice if realtime, and if I could connect it to ... Blender 3D for example. Anyhow, I remember apart from SYNTH there is also MIDI, and maybe Music Generation does not have to be realtime, if we can code certain BEAT and TRIGGER to match the animation or sampling of other stuff that we can visualize. PYTHON AND MIDI By some kind of magic I actually stumbled into this 'music21' module for Python. http://web.mit.edu/music21/doc/about/what.html I look through this 'music21' quickly and found lots of interesti...

SONICPI / Ruby, Python, MIDI and OSC

I have a big curiosity on how we can use OSC or MIDI to send message from one app to another app, potentially to generate (realtime) synth sound, visualization, and animation. This is especially a fun area and environment when we wanted to use CODE for CREATIVITY. Sonic Pi (by Sam Aaron) is one app I really love to use when dealing with Synth and Sonic generator. I remember using ChucK in the past by Ge Wang, ChucK is also cool, but Sonic Pi is a lot more friendly. http://sonic-pi.net Sonic Pi multi-threaded ness and LIVE LOOP is really something new for me. But Sam made it easy enough so that we could generate "listener" very easily. MAKING SOUND WITH CODE There are plenty of ways we can "trigger" Sonic Pi to generate sound. Obviously we can just use the built in RUBY language inside Sonic Pi app. Fairly simple and fun language to use and you can generate some noise in no time! Sonic Pi RUBY language documentation is really in depth and a full on progr...