YXu120 commited on
Commit
f827258
1 Parent(s): d5239ab
Files changed (2) hide show
  1. Dataset loading script.ipynb +1 -0
  2. README.md +106 -0
Dataset loading script.ipynb ADDED
@@ -0,0 +1 @@
 
 
1
+ {"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyNO+e07xDwTXLgso0Smk0vJ"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","source":["import json\n","import os\n","\n","import datasets\n","\n","_DESCRIPTION = \"\"\"\n","The datasets were collected and published to present the educational level of NC population in different areas. The educational attainment for the black population data can raise concern for the educational equity issue in North Carolina. The combined dataset aims to offer a holistic perspective on educational levels and equity, with a specific focus on the educational attainment of the Black population aged 25 and over.\n","\"\"\"\n","\n","_HOMEPAGE = \"https://huggingface.co/datasets/YXu120/NC_Education\"\n","\n","_LICENSE = \"cc-by-sa-4.0\"\n","\n","_URL = \"/content/drive/MyDrive/Colab_Notebooks/NC_Education/NC_Education_Final.csv\"\n","\n","class NCEducationDataset(datasets.GeneratorBasedBuilder):\n"," VERSION = datasets.Version(\"1.0.0\")\n","\n"," def _info(self):\n"," features = datasets.Features(\n"," {\n"," \"area_name\": datasets.Value(\"string\"),\n"," \"area_type\": datasets.Value(\"string\"),\n"," \"years\": datasets.Sequence(\n"," {\n"," \"year\": datasets.Value(\"string\"),\n"," \"variables\": datasets.Sequence(\n"," {\n"," \"variable\": datasets.Value(\"string\"),\n"," \"value\": datasets.Value(\"int32\"),\n"," \"value_black\": datasets.Value(\"int32\"),\n"," }\n"," ),\n"," }\n"," ),\n"," }\n"," )\n","\n"," return datasets.DatasetInfo(\n"," description=_DESCRIPTION,\n"," features=features,\n"," homepage=_HOMEPAGE,\n"," license=_LICENSE,\n"," )\n","\n"," def _split_generators(self, dl_manager):\n"," data_file = dl_manager.download(_URL)\n"," return [\n"," datasets.SplitGenerator(\n"," name=datasets.Split.TRAIN,\n"," gen_kwargs={\n"," \"filepath\": data_file,\n"," },\n"," )\n"," ]\n","\n"," def _generate_examples(self, filepath):\n"," with open(filepath, \"r\", encoding=\"utf-8\") as file:\n"," data = json.load(file)\n"," for idx, (area_name, area_data) in enumerate(data.items()):\n"," years_data = []\n"," for year, variables in area_data[\"years\"].items():\n"," year_data = {\n"," \"year\": year,\n"," \"variables\": [\n"," {\n"," \"variable\": variable[\"variable\"],\n"," \"value\": variable[\"value\"],\n"," \"value_black\": variable.get(\"value_black\"),\n"," }\n"," for variable in variables\n"," ],\n"," }\n"," years_data.append(year_data)\n","\n"," yield idx, {\n"," \"area_name\": area_name,\n"," \"area_type\": area_data[\"area_type\"],\n"," \"years\": years_data,\n"," }"],"metadata":{"id":"EydAuFx4AKlR","executionInfo":{"status":"ok","timestamp":1710722455431,"user_tz":240,"elapsed":124,"user":{"displayName":"Yangxuan Xu","userId":"16693520489565507742"}}},"execution_count":9,"outputs":[]}]}
README.md ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: cc-by-sa-4.0
5
+ pretty_name: STA 663 Project 1 Proposal
6
+ ---
7
+ netid: yx264
8
+
9
+ # Dataset Description
10
+ - **Homepage:** https://linc.osbm.nc.gov/pages/home
11
+ - **(1) Education data:** https://linc.osbm.nc.gov/explore/dataset/education/information/?disjunctive.area_name&disjunctive.area_type&disjunctive.variable
12
+ - **(2) Educational attainment for the black population:** https://linc.osbm.nc.gov/explore/dataset/educational-attainment-for-the-black-population-c15002b/information/?disjunctive.area_name&disjunctive.area_type&disjunctive.year&disjunctive.variable
13
+
14
+ ### Dataset Summary
15
+ The education datasets can be found at North Carolina Office of State Budget and Management (NC OSBM) open data portal.
16
+
17
+ The first data includes public school enrollment and finances, SAT score, higher education enrollment, educational attainment data for North Carolina and counties, and the second one includes educational attainment for the Black population aged 25 and over for North Carolina and counties. The processed final data will combine the information of them, providing a profound insight into NC educational level and equity.
18
+
19
+ ### Supported Tasks
20
+ The tasks/methodologies are:
21
+ - **(1)** Data checking and cleaning
22
+
23
+ Since the first dataset is pretty large and includes some information we don't care, like the SAT score. Before proprecessing, we first check the datasets, do some visualization and summarizing, to decide whether to drop certain rows.
24
+
25
+ - **(2)** Re-structure the datasets to present the values according to county-level distinctions
26
+
27
+ The original dataset architecture lacks depth, as all variables reside on a single plane. Considering the significance of these variables, it’s nature to contemplate reorganizing the hierarchy to reflect county-level distinctions and convey the data accordingly.
28
+
29
+
30
+ - **(3)** Keywords-based data matching
31
+
32
+ The data matching process relies on all columns except the 'value' column. While 'area_name', 'area_type', and 'year' offer straightforward matching points across datasets, it's important to acknowledge the potential disparity in the 'variable' column. For instance, one dataset may contain the variable 'Less than High School Diploma', while another might list 'Less than High School Black'. Despite conveying the same meaning and requiring alignment, a direct join isn't feasible due to this discrepancy. One potential approach involves extracting keywords from the variables, such as 'Less' and 'High School', and cross-referencing them to determine potential matches between the datasets.
33
+
34
+ ### Languages
35
+ English
36
+
37
+ # Dataset Structure
38
+ ### Data Instances
39
+ - **(1) Education data:** https://linc.osbm.nc.gov/explore/dataset/education/api/?disjunctive.area_name&disjunctive.area_type&disjunctive.variable
40
+
41
+ An example of records (note that specific details are subject to change):
42
+ ```json
43
+ {
44
+ "area_name":"Alexander County",
45
+ "area_type":"County",
46
+ "year":"2010",
47
+ "variable":"Elementary School Education or Less Age 25 Up",
48
+ "value":2325
49
+ }
50
+ ```
51
+
52
+ - **(2) Educational attainment for the black population:** https://linc.osbm.nc.gov/explore/dataset/educational-attainment-for-the-black-population-c15002b/api/?disjunctive.area_name&disjunctive.area_type&disjunctive.year&disjunctive.variable
53
+
54
+ An example of records (note that specific details are subject to change):
55
+ ```json
56
+ {
57
+ "area_name":"Burke County",
58
+ "area_type":"County",
59
+ "year":"2020",
60
+ "variable":"Less than High School Diploma",
61
+ "value":568
62
+ }
63
+ ```
64
+
65
+ - **(3) Anticipated structure we aim to achieve:**
66
+ ```json
67
+ {
68
+ "area_name":"Alamance County",
69
+ "area_type":"County",[("year": "2010", [
70
+ {"variable": "High School Graduate (includes Equivalency)", "value": 6443},
71
+ {"variable":"Some College or Associate's Degree","value":5242},
72
+ ...
73
+ ]),
74
+ ...]
75
+ ...
76
+ }
77
+ ```
78
+
79
+
80
+ ### Data Fields
81
+ - Area Name (string): name of the area
82
+ - Area Type (string): type of the area
83
+ - Year (integer): the year that the data was collected
84
+ - Variable (string): level of education or other situations
85
+ - Value (integer): population count
86
+
87
+ # Dataset Creation
88
+ ### Curation Rationale
89
+ The datasets were collected and published to present the educational level of NC population in different area. The educational attainment for the black population data can rise the concern for educational equity issue in North Carolina. The combined dataset aims to offer a holistic perspective on educational levels and equity, with a specific focus on the educational attainment of the Black population aged 25 and over.
90
+
91
+ ### Source Data
92
+ The original data were published by North Carolina Department of Public Instruction, North Carolina Community College System and US Census Bureau.
93
+
94
+ # Considerations for Using the Data
95
+ The records are only for limited years, making it challenging to discern timely patterns or trends.
96
+
97
+ The second data is quite small compared to the first one. Combining may result in many missing values.
98
+
99
+ # Additional Information
100
+ ### Citation Information
101
+ Bureau, US Census. Census.Gov, 21 Jan. 2024, www.census.gov.
102
+
103
+ NC Budget & Management Open Data Portal Home Page - NC OSBM, https://linc.osbm.nc.gov/pages/home.
104
+
105
+ ### Contributions
106
+ Thanks North Carolina Department of Public Instruction, North Carolina Community College System and US Census Bureau for these datasets.