Download the Jupyter Notebook for this section: build_id_data.ipynb

Building ID Data Example

[1]:
import pyblp
import numpy as np

np.set_printoptions(linewidth=1)
pyblp.__version__
[1]:
'0.10.1'

In this example, we’ll build a small panel of market and firm IDs.

[2]:
id_data = pyblp.build_id_data(T=2, J=5, F=4)
id_data
[2]:
rec.array([([0], [0]),
           ([0], [0]),
           ([0], [1]),
           ([0], [2]),
           ([0], [3]),
           ([1], [0]),
           ([1], [0]),
           ([1], [1]),
           ([1], [2]),
           ([1], [3])],
          dtype=[('market_ids', 'O', (1,)), ('firm_ids', 'O', (1,))])