Hide keyboard shortcuts

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 

3 

4__docformat__ = 'restructuredtext' 

5 

6COPYRIGHT = """Used with express permission of the original author, who 

7retains all rights.""" 

8TITLE = __doc__ 

9SOURCE = """ 

10William Greene's `Econometric Analysis` 

11 

12More information can be found at the web site of the text: 

13http://pages.stern.nyu.edu/~wgreene/Text/econometricanalysis.htm 

14""" 

15 

16DESCRSHORT = """William Greene's credit scoring data""" 

17 

18DESCRLONG = """More information on this data can be found on the 

19homepage for Greene's `Econometric Analysis`. See source. 

20""" 

21 

22NOTE = """:: 

23 

24 Number of observations - 72 

25 Number of variables - 5 

26 Variable name definitions - See Source for more information on the 

27 variables. 

28""" 

29 

30 

31def load_pandas(): 

32 """Load the credit card data and returns a Dataset class. 

33 

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) 

41 

42 

43def load(as_pandas=None): 

44 """Load the credit card data and returns a Dataset class. 

45 

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. 

51 

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) 

58 

59 

60def _get_data(): 

61 return du.load_csv(__file__, 'ccard.csv', convert_float=True)