A system with a lot of json data
a = [{"poko": 1, "hoge":2}, {"poko": 1, "hoge":2}, {"hoge":2}, {"poko": 1}]
Like
from pandas import DataFrame
frame = DataFrame(a)
When I output frame with ipython
Out:
hoge poko
0 2 1
1 2 1
2 2 NaN
3 NaN 1
Typical
In: frame[“poko”]
Out:
0 1
1 1
2 NaN
3 1
Name: poko, dtype: float64
In: frame[“poko”][:2]
Out:
0 1
1 1
Name: poko, dtype: float64
Like
When you want a count up
In: frame["poko"].value_counts()
Out:
1 3
dtype: int64
like
Recommended Posts