def period_array(<EOL>data: Sequence[Optional[Period]],<EOL>freq: Optional[Tick] = None,<EOL>copy: bool = False,<EOL>) -> PeriodArray:
if is_datetime64_dtype(data):<EOL><INDENT>return PeriodArray._from_datetime64(data, freq)<EOL><DEDENT>if isinstance(data, (ABCPeriodIndex, ABCSeries, PeriodArray)):<EOL><INDENT>return PeriodArray(data, freq)<EOL><DEDENT>if not isinstance(data, (np.ndarray, list, tuple)):<EOL><INDENT>data = list(data)<EOL><DEDENT>data = np.asarray(data)<EOL>if freq:<EOL><INDENT>dtype = PeriodDtype(freq)<EOL><DEDENT>else:<EOL><INDENT>dtype = None<EOL><DEDENT>if is_float_dtype(data) and len(data) > <NUM_LIT:0>:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>data = ensure_object(data)<EOL>return PeriodArray._from_sequence(data, dtype=dtype)<EOL>
Construct a new PeriodArray from a sequence of Period scalars.

Parameters
----------
data : Sequence of Period objects
    A sequence of Period objects. These are required to all have
    the same ``freq.`` Missing values can be indicated by ``None``
    or ``pandas.NaT``.
freq : str, Tick, or Offset
    The frequency of every element of the array. This can be specified
    to avoid inferring the `freq` from `data`.
copy : bool, default False
    Whether to ensure a copy of the data is made.

Returns
-------
PeriodArray

See Also
--------
PeriodArray
pandas.PeriodIndex

Examples
--------
>>> period_array([pd.Period('2017', freq='A'),
...               pd.Period('2018', freq='A')])
<PeriodArray>
['2017', '2018']
Length: 2, dtype: period[A-DEC]

>>> period_array([pd.Period('2017', freq='A'),
...               pd.Period('2018', freq='A'),
...               pd.NaT])
<PeriodArray>
['2017', '2018', 'NaT']
Length: 3, dtype: period[A-DEC]

Integers that look like years are handled

>>> period_array([2000, 2001, 2002], freq='D')
['2000-01-01', '2001-01-01', '2002-01-01']
Length: 3, dtype: period[D]

Datetime-like strings may also be passed

>>> period_array(['2000-Q1', '2000-Q2', '2000-Q3', '2000-Q4'], freq='Q')
<PeriodArray>
['2000Q1', '2000Q2', '2000Q3', '2000Q4']
Length: 4, dtype: period[Q-DEC]