pyjanitor-devs / pyjanitor

Clean APIs for data cleaning. Python implementation of R package Janitor
https://pyjanitor-devs.github.io/pyjanitor
MIT License
1.35k stars 169 forks source link

`.clean_names()` should replace `@` with `_` #1257

Open GegznaV opened 1 year ago

GegznaV commented 1 year ago

Brief Description

Consider the following example in which @ symbol is not converted into _ in Column@Three:

import pandas as pd
import janitor

df = pd.DataFrame({
    'Column One': [1, 2, 3],
    'Column-Two': [4, 5, 6],
    'Column@Three': [7, 8, 9],
})

df_cleaned = df.clean_names()
print(df_cleaned)
#>    column_one  column_two  column@three
#> 0           1           4             7
#> 1           2           5             8
#> 2           3           6             9

.clean_names() should replace @ with _ as it does in R:

janitor::make_clean_names("Column@Tree")
#> [1] "column_tree"

System Information

Minimally Reproducible Code

See above

Error Messages

None.

samukweku commented 1 year ago

@GegznaV thanks for raising this issue. Would you be open to raising a PR for this?

deltahedge1 commented 12 months ago

is this repo part of hacktoberfest? would like to try and tackle this one as part of that event

ericmjl commented 12 months ago

@deltahedge1 we can make it part of Hacktoberfest! I'll tag this as part of hacktoberfest, I think that should make the repo eligible, right?

deltahedge1 commented 12 months ago

perfect! let me take a look at this one. Thanks for adding the tag. full disclosure I am unsure if adding the tag makes it part of the event but one way to find out

ericmjl commented 12 months ago

@deltahedge1 let's see if that works! If you do need me to vouch for your PR, then you can send the Hacktoberfest organizers my way.