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"""El Nino dataset, 1950 - 2010""" 

2from statsmodels.datasets import utils as du 

3 

4__docformat__ = 'restructuredtext' 

5 

6COPYRIGHT = """This data is in the public domain.""" 

7 

8TITLE = """El Nino - Sea Surface Temperatures""" 

9 

10SOURCE = """ 

11National Oceanic and Atmospheric Administration's National Weather Service 

12 

13ERSST.V3B dataset, Nino 1+2 

14http://www.cpc.ncep.noaa.gov/data/indices/ 

15""" 

16 

17DESCRSHORT = """Averaged monthly sea surface temperature - Pacific Ocean.""" 

18 

19DESCRLONG = """This data contains the averaged monthly sea surface 

20temperature in degrees Celcius of the Pacific Ocean, between 0-10 degrees South 

21and 90-80 degrees West, from 1950 to 2010. This dataset was obtained from 

22NOAA. 

23""" 

24 

25NOTE = """:: 

26 

27 Number of Observations - 61 x 12 

28 

29 Number of Variables - 1 

30 

31 Variable name definitions:: 

32 

33 TEMPERATURE - average sea surface temperature in degrees Celcius 

34 (12 columns, one per month). 

35""" 

36 

37 

38def load_pandas(): 

39 data = _get_data() 

40 dataset = du.Dataset(data=data, names=list(data.columns)) 

41 return dataset 

42 

43 

44def load(as_pandas=None): 

45 """ 

46 Load the El Nino data and return a Dataset class. 

47 

48 Parameters 

49 ---------- 

50 as_pandas : bool 

51 Flag indicating whether to return pandas DataFrames and Series 

52 or numpy recarrays and arrays. If True, returns pandas. 

53 

54 Returns 

55 ------- 

56 Dataset instance: 

57 See DATASET_PROPOSAL.txt for more information. 

58 

59 Notes 

60 ----- 

61 The elnino Dataset instance does not contain endog and exog attributes. 

62 """ 

63 return du.as_numpy_dataset(load_pandas(), as_pandas=as_pandas) 

64 

65 

66def _get_data(): 

67 return du.load_csv(__file__, 'elnino.csv', convert_float=True)