code: def setup(self, nobs, freq):
      self.data = pd.DataFrame(
          {
              "p": pd.period_range(
                  start="2000-01-01", periods=nobs, freq=freq
              ),
              "r": [np.random.uniform()] * nobs,
          }
      )
      self.data["i"] = self.data["p"]
      self.data.set_index("i", inplace=True)
      if freq == "D":
          self.default_fmt = "%Y-%m-%d"
      elif freq == "h":
          self.default_fmt = "%Y-%m-%d %H:00"
  
imports: import numpy
  import pandas
  from pandas import offsets
label_desc: Use image node_id 1 for calling the PeriodStrftime obj's underlying member method code with example usage: obj.setup(nobs, freq) without return types