I am working with a JSON file that I pulled from Github using:
curl https://api.github.com/repos/mbostock/d3/stats/commit_activity > d3_commit-activity.json
Then, within Pandas I ran the following commands:
import pandas as pd
import numpy as np
import matplotlib.pylab as plt
df = pd.io.json.read_json("d3_commit-activity.json")
One of the columns in df is called "days" and its values are lists formatted like this:
[0,0,0,1,0,1,0]
[0,0,0,0,0,1,1]
[3,0,0,0,0,0,0]
In other words, each list is composed of exactly seven numbers. I want to create seven new columns out each element in these lists but I am completely baffled by explanations to similar problems. I tried following Bradley's solution to this problem (pandas: How do I split text in a column into multiple rows?) but have been told that "name 'Series' is not defined". Tried changing to "pd.Series" which seems to work for that command but fails in the later commands.
Surely there must be a simple, straightforward way to take these lists and break them up into individual columns?