Skip to content

[ENH] Add optional removal of accents on functions.clean_names, enabled by default. #506

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

Merged
merged 1 commit into from
Jul 28, 2019

Conversation

mralbu
Copy link
Contributor

@mralbu mralbu commented Jul 28, 2019

PR Description

Changes proposed in the pull request:

  • add optional removal of accents on functions.clean_names, enabled by default.

Example API:

# create test DataFrame
df = pd.DataFrame({"João": [1, 2], "Лука́ся": [1, 2], "Käfer": [1, 2]})

# remove column name accents
df = df.clean_names(strip_accents=True)
expected_columns = ["joao", "лукася", "kafer"]
assert set(df.columns) == set(expected_columns)

This PR resolves #502

PR Checklist

Please ensure that you have done the following:

  1. PR in from a fork off your branch. Do not PR from <your_username>:master, but rather from <your_username>:<branch_name>.
  1. If you're not on the contributors list, add yourself to AUTHORS.rst.
  1. Add a line to CHANGELOG.rst under the latest version header (i.e. the one that is "on deck") describing the contribution.
    • Do use some discretion here; if there are multiple PRs that are related, keep them in a single line.

Quick Check

To do a very quick check that everything is correct, follow these steps below:

  • Run the command make check from pyjanitor's top-level directory. This will automatically run:
    • black formatting
    • pycodestyle checking
    • running the test suite
    • docs build

Once done, please check off the check-box above.

If make check does not work for you, you can execute the commands listed in the Makefile individually.

Code Changes

If you are adding code changes, please ensure the following:

  • Ensure that you have added tests.
  • Run all tests ($ pytest .) locally on your machine.
    • Check to ensure that test coverage covers the lines of code that you have added.
    • Ensure that all tests pass.

Relevant Reviewers

Please tag maintainers to review.

@codecov
Copy link

codecov bot commented Jul 28, 2019

Codecov Report

Merging #506 into dev will increase coverage by 0.04%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##              dev     #506      +/-   ##
==========================================
+ Coverage   92.84%   92.88%   +0.04%     
==========================================
  Files           9        9              
  Lines         838      843       +5     
==========================================
+ Hits          778      783       +5     
  Misses         60       60

@ericmjl
Copy link
Member

ericmjl commented Jul 28, 2019

Superb, thanks @mralbu!

@ericmjl ericmjl merged commit a8bfabc into pyjanitor-devs:dev Jul 28, 2019
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.

[ENH] Add optional removal of accents on functions.clean_names, enabled by default.
2 participants