Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/statsmodels/datasets/ccard/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"""Bill Greene's credit scoring data."""
2from statsmodels.datasets import utils as du
4__docformat__ = 'restructuredtext'
6COPYRIGHT = """Used with express permission of the original author, who
7retains all rights."""
8TITLE = __doc__
9SOURCE = """
10William Greene's `Econometric Analysis`
12More information can be found at the web site of the text:
13http://pages.stern.nyu.edu/~wgreene/Text/econometricanalysis.htm
14"""
16DESCRSHORT = """William Greene's credit scoring data"""
18DESCRLONG = """More information on this data can be found on the
19homepage for Greene's `Econometric Analysis`. See source.
20"""
22NOTE = """::
24 Number of observations - 72
25 Number of variables - 5
26 Variable name definitions - See Source for more information on the
27 variables.
28"""
31def load_pandas():
32 """Load the credit card data and returns a Dataset class.
34 Returns
35 -------
36 Dataset instance:
37 See DATASET_PROPOSAL.txt for more information.
38 """
39 data = _get_data()
40 return du.process_pandas(data, endog_idx=0)
43def load(as_pandas=None):
44 """Load the credit card data and returns a Dataset class.
46 Parameters
47 ----------
48 as_pandas : bool
49 Flag indicating whether to return pandas DataFrames and Series
50 or numpy recarrays and arrays. If True, returns pandas.
52 Returns
53 -------
54 Dataset instance:
55 See DATASET_PROPOSAL.txt for more information.
56 """
57 return du.as_numpy_dataset(load_pandas(), as_pandas=as_pandas)
60def _get_data():
61 return du.load_csv(__file__, 'ccard.csv', convert_float=True)