Categories
data science

Character encoding in with JSON and PYTHON

I was data scraping the other day and saving the output to a JSON file, but the text in one of the entries was coming out wrong. Instead of “Antal Dovcs√°k”, it was coming out as “Antal Dovcs\u00e1k” instead. For context, my code looked something like this: And the output was this… After some googling […]

Categories
data science

From adjacency matrix to d3js network graph

So yeah, I’m back in this. Very simple script to turn an adjacency matrix to a D3js network json file. This is the file that we start with: node1 node2 node3 node1 0 8 1 node2 8 0 3 node3 1 3 0 As you can see, this is an undirected graph. This next bit […]

Categories
data science

Exploring jason files – Python

Working with json files can be freaking horrible, specially if you don’t know what data is in the file. Let me give you and example of how unreadable it can be. If you use Apple’s iTunes search API, and you search for user id 112018 you get this in return Which is crappy because you […]