Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/statsmodels/datasets/stackloss/data.py : 73%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""Stack loss data"""
2from statsmodels.datasets import utils as du
4__docformat__ = 'restructuredtext'
6COPYRIGHT = """This is public domain. """
7TITLE = __doc__
8SOURCE = """
9Brownlee, K. A. (1965), "Statistical Theory and Methodology in
10Science and Engineering", 2nd edition, New York:Wiley.
11"""
13DESCRSHORT = """Stack loss plant data of Brownlee (1965)"""
15DESCRLONG = """The stack loss plant data of Brownlee (1965) contains
1621 days of measurements from a plant's oxidation of ammonia to nitric acid.
17The nitric oxide pollutants are captured in an absorption tower."""
19NOTE = """::
21 Number of Observations - 21
23 Number of Variables - 4
25 Variable name definitions::
27 STACKLOSS - 10 times the percentage of ammonia going into the plant
28 that escapes from the absoroption column
29 AIRFLOW - Rate of operation of the plant
30 WATERTEMP - Cooling water temperature in the absorption tower
31 ACIDCONC - Acid concentration of circulating acid minus 50 times 10.
32"""
35def load(as_pandas=None):
36 """
37 Load the stack loss data and returns a Dataset class instance.
39 Parameters
40 ----------
41 as_pandas : bool
42 Flag indicating whether to return pandas DataFrames and Series
43 or numpy recarrays and arrays. If True, returns pandas.
45 Returns
46 -------
47 Dataset instance:
48 See DATASET_PROPOSAL.txt for more information.
49 """
50 return du.as_numpy_dataset(load_pandas(), as_pandas=as_pandas)
52def load_pandas():
53 """
54 Load the stack loss data and returns a Dataset class instance.
56 Returns
57 -------
58 Dataset instance:
59 See DATASET_PROPOSAL.txt for more information.
60 """
61 data = _get_data()
62 return du.process_pandas(data, endog_idx=0)
65def _get_data():
66 return du.load_csv(__file__, 'stackloss.csv').astype(float)