<commit_before>"""
Test index support in time series models

1. Test support for passing / constructing the underlying index in __init__
2. Test wrapping of output using the underlying index
3. Test wrapping of prediction / forecasting using the underlying index or
   extensions of it.

Author: <NAME>
License: BSD-3
"""
from __future__ import division, absolute_import, print_function

import warnings
import numpy as np
import pandas as pd
import os

from numpy.testing import (assert_allclose, assert_almost_equal, assert_equal,
                           assert_raises)
from nose.exc import SkipTest

from statsmodels.tsa.base import tsa_model

nobs = 5
base_dta = np.arange(nobs)
dta = [
    base_dta.tolist(),
    base_dta,
    pd.Series(base_dta),
    pd.DataFrame(base_dta)
]

base_date_indexes = [
    # (usual candidates)
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='D'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='W'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='M'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='Q'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='A'),
    # (some more complicated frequencies)
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='2Q'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='2QS'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='5s'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='1D10min')]

# Note: we separate datetime indexes and period indexes because the
# date coercion does not handle string versions of PeriodIndex objects
# most of the time.
base_period_indexes = [
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='D'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='W'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='M'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='Q'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='A'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='2Q'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='5s'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='1D10min')]
<commit_msg>TST/COMPAT: Early Pandas Period with mult. freqs.<commit_after>"""
Test index support in time series models

1. Test support for passing / constructing the underlying index in __init__
2. Test wrapping of output using the underlying index
3. Test wrapping of prediction / forecasting using the underlying index or
   extensions of it.

Author: <NAME>
License: BSD-3
"""
from __future__ import division, absolute_import, print_function

import warnings
import numpy as np
import pandas as pd
import os

from numpy.testing import (assert_allclose, assert_almost_equal, assert_equal,
                           assert_raises)
from nose.exc import SkipTest

from statsmodels.tsa.base import tsa_model

nobs = 5
base_dta = np.arange(nobs)
dta = [
    base_dta.tolist(),
    base_dta,
    pd.Series(base_dta),
    pd.DataFrame(base_dta)
]

base_date_indexes = [
    # (usual candidates)
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='D'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='W'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='M'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='Q'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='A'),
    # (some more complicated frequencies)
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='2Q'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='2QS'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='5s'),
    pd.DatetimeIndex(start='1950-01-01', periods=nobs, freq='1D10min')]

# Note: we separate datetime indexes and period indexes because the
# date coercion does not handle string versions of PeriodIndex objects
# most of the time.
base_period_indexes = [
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='D'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='W'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='M'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='Q'),
    pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='A')]
try:
    # Only later versions of pandas support these
    base_period_indexes += [
        pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='2Q'),
        pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='5s'),
        pd.PeriodIndex(start='1950-01-01', periods=nobs, freq='1D10min')]
except:
    pass

{'fraction_non_alphanumeric': 0.14364397444371008, 'fraction_numerical': 0.06697510464860101, 'mean_word_length': 4.550122249388753, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1071903', 'n_tokens_mistral': 1747, 'n_tokens_neox': 1546, 'n_words': 359}