Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding fix #32

Merged
merged 12 commits into from
Nov 12, 2024
Merged

Coding fix #32

merged 12 commits into from
Nov 12, 2024

Conversation

MariaGorodetski
Copy link
Contributor

conversion of single categories into Int16 when 'coding' is asked

Copy link
Contributor

@alondmnt alondmnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine and simple, left one question

@alondmnt
Copy link
Contributor

alondmnt commented Nov 6, 2024

I may have found a solution for sorted categories (assuming that I can still remember what we tried to achieve).
For example, for months:

pd.Categorical(['August', 'May', 'April', 'January'])\
    .set_categories(codings_df.loc['042_03'].sort_values('coding')['english'], ordered=True)\
    .sort_values()

generates a properly sorted series and ordered categorical type:

['January', 'April', 'May', 'August']
Categories (13, object): ['Was not absent at all' < 'January' < 'February' < 'March' ... 'September' < 'October' < 'November' < 'December']

I'll work on adding it and keep you updated.

@alondmnt alondmnt merged commit d2fee91 into master Nov 12, 2024
2 checks passed
@alondmnt alondmnt deleted the coding_fix branch November 12, 2024 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants