code: def test_view_asi8(self):
      idx = PeriodIndex([], freq="M")
  
      exp = np.array([], dtype=np.int64)
      tm.assert_numpy_array_equal(idx.view("i8"), exp)
      tm.assert_numpy_array_equal(idx.asi8, exp)
  
      idx = PeriodIndex(["2011-01", NaT], freq="M")
  
      exp = np.array([492, -9223372036854775808], dtype=np.int64)
      tm.assert_numpy_array_equal(idx.view("i8"), exp)
      tm.assert_numpy_array_equal(idx.asi8, exp)
  
      exp = np.array([14975, -9223372036854775808], dtype=np.int64)
      idx = PeriodIndex(["2011-01-01", NaT], freq="D")
      tm.assert_numpy_array_equal(idx.view("i8"), exp)
      tm.assert_numpy_array_equal(idx.asi8, exp)
  
file_path: pandas/pandas/tests/indexes/period/test_period.py
imports: import numpy
  import pytest
  from pandas import Index, NaT, Period, PeriodIndex, Series, date_range, offsets, period_range
  import pandas._testing
label_desc: Use image node_id 1 for calling the TestPeriodIndex obj's underlying member method code with example usage: obj.test_view_asi8() without return types