Try using pandas.DataFrame

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

Try using pandas.DataFrame
Try using Tkinter
Try using docker-py
Try using PDFMiner
Try using geopandas
Try using Selenium
Try using scipy
Try using django-swiftbrowser
Try using matplotlib
Try using tf.metrics
Try using PyODE
Try using virtualenv (virtualenvwrapper)
[Azure] Try using Azure Functions
Try using virtualenv now
Try using W & B
Try using Django templates.html
[Kaggle] Try using LGBM
Try using Python's feedparser.
Try using Python's Tkinter
Try using Tweepy [Python2.7]
Try using Pytorch's collate_fn
Try using PythonTex with Texpad.
[Python] Try using Tkinter's canvas
Try using Jupyter's Docker image
Try using scikit-learn (1) --K-means clustering
Try function optimization using Hyperopt
Try using Azure Logic Apps
[Kaggle] Try using xg boost
Try using the Twitter API
Try using OpenCV on Windows
Try using Jupyter Notebook dynamically
Try tweeting automatically using Selenium.
Try using the Twitter API
Try using SQLAlchemy + MySQL (Part 2)
Try using Django's template feature
Try using the PeeringDB 2.0 API
Try using Pelican's draft feature
Try using pytest-Overview and Samples-
Try using folium with anaconda
Try using Janus gateway's Admin API
[Statistics] [R] Try using quantile regression.
Try using Spyder included in Anaconda
Try using design patterns (exporter edition)
Try using Pillow on iPython (Part 1)
Try using Pillow on iPython (Part 2)
Try using LevelDB in Python (plyvel)
Try using pynag to configure Nagios
Try using ArUco on Raspberry Pi
[Sakura rental server] Try using flask.
Try using Pillow on iPython (Part 3)
Reinforcement learning 8 Try using Chainer UI
Try to get statistics using e-Stat
Try using Python argparse's action API
Try using the Python Cmd module
Try using Python's networkx with AtCoder
Try using Leap Motion in Python
Try using GCP Handwriting Recognition (OCR)
Try using Amazon DynamoDB from Python
code-server Local environment (3) Try using VSCode Plugin
Try using the Wunderlist API in Python
Try mathematical formulas using Σ with python