testdata.py 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. """
  2. Test Data is from part of https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data
  3. """
  4. from pandas import DataFrame
  5. adults01 = DataFrame([
  6. [39, 'Bachelors', 'Not-in-family', '<=50K', '06/26/1980'],
  7. [50, 'Bachelors', 'Husband', '<=50K', '06/18/1969'],
  8. [38, 'HS-grad', 'Not-in-family', '<=50K', '06/27/1981'],
  9. [53, '11th', 'Husband', '<=50K', '06/16/1966'],
  10. [28, 'Bachelors', 'Wife', '<=50K', '07/05/1991'],
  11. [37, 'Masters', 'Wife', '<=50K', '06/28/1982'],
  12. [49, '9th', 'Not-in-family', '<=50K', '06/19/1970'],
  13. [52, 'HS-grad', 'Husband', '>50K', '06/17/1967'],
  14. [31, 'Masters', 'Not-in-family', '>50K', '07/02/1988'],
  15. [42, 'Bachelors', 'Husband', '>50K', '06/24/1977'],
  16. [37, 'Some-college', 'Husband', '>50K', '06/28/1982'],
  17. [30, 'Bachelors', 'Husband', '>50K', '07/03/1989'],
  18. [23, 'Bachelors', 'Own-child', '<=50K', '07/08/1996'],
  19. [32, 'Bachelors', 'Not-in-family', '<=50K', '07/02/1987'],
  20. [34, '7th-8th', 'Husband', '<=50K', '06/30/1985'],
  21. [25, 'HS-grad', 'Own-child', '<=50K', '07/07/1994'],
  22. [32, 'HS-grad', 'Unmarried', '<=50K', '07/02/1987'],
  23. [38, '11th', 'Husband', '<=50K', '06/27/1981'],
  24. [43, 'Masters', 'Unmarried', '>50K', '06/23/1976'],
  25. [40, 'Doctorate', 'Husband', '>50K', '06/26/1979'],
  26. [54, 'HS-grad', 'Unmarried', '<=50K', '06/15/1965'],
  27. [35, '9th', 'Husband', '<=50K', '06/29/1984'],
  28. [43, '11th', 'Husband', '<=50K', '06/23/1976'],
  29. [59, 'HS-grad', 'Unmarried', '<=50K', '06/11/1960'],
  30. [56, 'Bachelors', 'Husband', '>50K', '06/14/1963'],
  31. [19, 'HS-grad', 'Own-child', '<=50K', '07/11/2000'],
  32. [39, 'HS-grad', 'Not-in-family', '<=50K', '06/26/1980'],
  33. [49, 'HS-grad', 'Husband', '<=50K', '06/19/1970'],
  34. [23, 'Assoc-acdm', 'Not-in-family', '<=50K', '07/08/1996'],
  35. [20, 'Some-college', 'Own-child', '<=50K', '07/11/1999']
  36. ], columns=['age', 'education', 'relationship', 'salary', 'birth'])
  37. adults02 = DataFrame([
  38. [19, 'HS-grad', 'Own-child', 'Male', '<=50K', '07/11/2000'],
  39. [26, 'Bachelors', 'Own-child', 'Male', '<=50K', '07/06/1993'],
  40. [27, 'Some-college', 'Not-in-family', 'Male', '<=50K', '07/05/1992'],
  41. [41, 'Masters', 'Husband', 'Male', '<=50K', '06/25/1978'],
  42. [33, 'Doctorate', 'Husband', 'Male', '<=50K', '07/01/1986'],
  43. [56, 'Some-college', 'Not-in-family', 'Male', '<=50K', '06/14/1963'],
  44. [43, 'Bachelors', 'Husband', 'Male', '>50K', '06/23/1976'],
  45. [29, 'HS-grad', 'Wife', 'Female', '<=50K', '07/04/1990'],
  46. [44, '11th', 'Husband', 'Male', '>50K', '06/23/1975'],
  47. [37, 'Some-college', 'Own-child', 'Female', '<=50K', '06/28/1982'],
  48. [24, 'Some-college', 'Not-in-family', 'Male', '<=50K', '07/08/1995'],
  49. [38, 'HS-grad', 'Husband', 'Male', '<=50K', '06/27/1981'],
  50. [35, 'Masters', 'Husband', 'Male', '>50K', '06/29/1984'],
  51. [39, 'Bachelors', 'Own-child', 'Female', '<=50K', '06/26/1980'],
  52. [47, 'HS-grad', 'Husband', 'Male', '>50K', '06/20/1972'],
  53. [51, 'HS-grad', 'Husband', 'Male', '>50K', '06/17/1968'],
  54. [38, 'HS-grad', 'Husband', 'Male', '<=50K', '06/27/1981'],
  55. [44, 'Some-college', 'Unmarried', 'Female', '<=50K', '06/23/1975'],
  56. [24, 'HS-grad', 'Other-relative', 'Female', '<=50K', '07/08/1995'],
  57. [41, 'HS-grad', 'Unmarried', 'Female', '<=50K', '06/25/1978'],
  58. [51, 'Assoc-voc', 'Unmarried', 'Female', '<=50K', '06/17/1968'],
  59. [60, 'HS-grad', 'Husband', 'Male', '<=50K', '06/11/1959'],
  60. [40, 'Bachelors', 'Husband', 'Male', '>50K', '06/26/1979'],
  61. [27, 'Some-college', 'Wife', 'Female', '<=50K', '07/05/1992'],
  62. [36, 'HS-grad', 'Husband', 'Male', '>50K', '06/29/1983'],
  63. [44, 'HS-grad', 'Husband', 'Male', '<=50K', '06/23/1975'],
  64. [33, 'Some-college', None, 'Female', '<=50K', '07/01/1986'],
  65. [53, '7th-8th', 'Husband', 'Male', '<=50K', '06/16/1966'],
  66. [43, 'HS-grad', 'Husband', 'Male', '>50K', '06/23/1976'],
  67. [44, 'Assoc-acdm', 'Not-in-family', 'Male', '<=50K', '06/23/1975'],
  68. ], columns=['age', 'education', 'relationship', 'sex', 'salary', 'birth'])
  69. adult_with_head = 'age, education, relationship, sex, salary, birth\n' \
  70. '19, HS-grad, Own-child, Male, <=50K, 07/11/2000\n' \
  71. '41, Masters, Husband, Male, <=50K, 06/25/1978\n' \
  72. '44, HS-grad, Husband, Male, <=50K, 06/23/1975'
  73. adult_without_head = '19, HS-grad, Own-child, Male, <=50K, 07/11/2000\n' \
  74. '41, Masters, Husband, Male, <=50K, 06/25/1978\n' \
  75. '40, Masters, Husband, Female, <=50K, 06/21/1977\n' \
  76. '44, HS-grad, Husband, Male, <=50K, 06/23/1975'
  77. adult_with_head_res = DataFrame([
  78. [19, 'HS-grad', 'Own-child', 'Male', '<=50K', '07/11/2000'],
  79. [41, 'Masters', 'Husband', 'Male', '<=50K', '06/25/1978'],
  80. [44, 'HS-grad', 'Husband', 'Male', '<=50K', '06/23/1975']
  81. ], columns=['age', 'education', 'relationship', 'sex', 'salary', 'birth'])