An empty header cell is named Unnamed: 1 by pandas and an empty string by the web engine
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #1060 by @AnayDhawan — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, pandas, python
- Domain
- data
Research direction
Start with assets/profiler-engine.js and its dedupeHeaders() function, then read faircode/loaders.py to compare how pandas names blank columns. Run the reproduction from the issue and inspect tests/test_js_parity_profile_parsing.py. Done when blank headers receive matching Unnamed: N names in both engines and the parity tests cover the cases described.
Written by the indexing model from the issue text.
Description
Where: assets/profiler-engine.js dedupeHeaders(), faircode/loaders.py (pandas names the column), tests/test_js_parity_profile_parsing.py.
Current gap: a CSV with a blank header cell (a spreadsheet export with an unnamed index or note column) is profiled with the column Unnamed: 1 by Python and "" by JS; an all-blank header row gives Unnamed: 0..2 against "", .1, .2. The name appears in exports, --map/--cross arguments and the copyable CLI command, so a report from one engine cannot be matched with the other.
Repro:
$ printf 'sex,,race\n' > h.csv; for i in $(seq 10); do printf 'm,a,x\nf,b,y\n' >> h.csv; done
$ python3 -m faircode profile h.csv --json | python3 -c "import json,sys; print([d['name'] for d in json.load(sys.stdin)['dimensions']])"
['sex', 'Unnamed: 1', 'race'] # JS: ['sex', '', 'race']
Suggested approach: name blank headers Unnamed: N (N is the zero-based column index) in dedupeHeaders(), matching pandas, and add both files above to the parity tests.
- Dominant language
- HTML
- Stars
- 47
- Forks
- 45
- Avg merge
- 2h 59m
- Merged PRs (30d)
- 70
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from yakew7/Fair-Code
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 1/5 Under an hour Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Numeric column headers keep their type in Python (the integer 2020) and are text in the web enginePossibly taken @snehal1931 claimed this today. Openbug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yakew7/Fair-Code#1045 · 1 comment ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
All issues in yakew7/Fair-Code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Imbad0202/academic-research-skills#987 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
OpenEuroLLM/training-data-packer#132 ·
Maintainers usually reply within 1 day
-
essspectroscopy
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days