Closed Lijantropique closed 2 years ago
I will look into this as soon as I get a chance.
Thanks!
On Mon, Feb 8, 2016 at 2:15 PM, Oscar J. Delgado-Melo < notifications@github.com> wrote:
When reading the fixed length ASCII file, as the end value is lower than the start value the column gets clipped. To solve this I propose to read the ‘fstring’ value to determine the amount of positions, and add this value to the start point.
If this is solved, the note in the nsfg2 script (line 70) is no longer
required.
You can view, comment on, or merge this pull request online at:
https://github.com/AllenDowney/ThinkStats2/pull/36 Commit Summary
- Update nsfg2.py
- Update nsfg2.py
- Update thinkstats2.py
File Changes
- M code/nsfg2.py https://github.com/AllenDowney/ThinkStats2/pull/36/files#diff-0 (4)
- M code/thinkstats2.py https://github.com/AllenDowney/ThinkStats2/pull/36/files#diff-1 (2)
Patch Links:
- https://github.com/AllenDowney/ThinkStats2/pull/36.patch
- https://github.com/AllenDowney/ThinkStats2/pull/36.diff
— Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkStats2/pull/36.
Alternatively, you could change the way you determine the 'end' column by doing:
variables['end']= variables.start + variables.fstring.apply(lambda x: int(x[1:-1]))
This should correct the bug as well. Please let me know if there is something I can help you with. Best!
Thanks again!
On Tue, Feb 9, 2016 at 3:25 PM, Oscar J. Delgado-Melo < notifications@github.com> wrote:
Alternatively, you could change the way you determine the 'end' column by doing:
variables['end']= variables.start + variables.fstring.apply(lambda x: int(x[1:-1]))
This should correct the bug as well. Please let me know if there is something I can help you with. Best!
— Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkStats2/pull/36#issuecomment-182046360 .
This should be resolved by 82f6384
Thanks!
When reading the fixed length ASCII file, as the end value is lower than the start value the column gets clipped. To solve this I propose to read the ‘fstring’ value to determine the amount of positions, and add this value to the start point.
If this is solved, the note in the nsfg2 script (line 70) is no longer required.