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

column description bug #386

Closed
reza1615 opened this issue Jan 4, 2021 · 5 comments
Closed

column description bug #386

reza1615 opened this issue Jan 4, 2021 · 5 comments

Comments

@reza1615
Copy link

reza1615 commented Jan 4, 2021

In the column description, these metric have bugs

  • Rows w/ Hidden char: count Arabic charters as hidden char for example count تست as hidden which is not hidden
  • Rows w/ accent: count as
    • Num
    • Accent
    • Hidden
  • Rows w/ number: doesn't count number form example if a row is foo123 it doesn't count it as num

image

Test: on http://alphatechadmin.pythonanywhere.com/dtale/main/4

  • In the str_val modify cells as
    • 123
    • تست
    • foo123
    • fooÀ
    • ZWNJ

The correct column description should be

  • numeric chars: 2
  • accent chars: 1
  • hidden char: 1

I checked the regexes in the #335 and it was ok
https://regex101.com/r/GPxA1F/1
https://regex101.com/r/GPxA1F/2

@aschonfeld
Copy link
Collaborator

So the issue with numeric chars was just a front-end mapping issue. Accent charts seems to be fine using the data you gave me:
image

This is the regex I'm using to compute hidden characters:

from string import printable
df['var1'].str.count(r'[^{}]+'.format(printable)`).astype(bool).sum()

Looks like it is saying that تست, fooÀ & ZWNJ contain hidden characters. Is there something wrong with string.printable?

@reza1615
Copy link
Author

reza1615 commented Jan 5, 2021

printable just check ASCII table so it is perfect for English language and doesn't support accent characters and Unicode characters

  • for numeric chars please use [\d]+ it supports all languages numbers like ۱۲۳123
  • for hidden chars please use this regex
printable =r'\w \!\"#\$%&\'\(\)\*\+,\-\./:;<»«؛،ـ\=>\?@\[\\\]\^_\`\{\|\}~'
df['var1'].str.count(r'[^{}]+'.format(printable)`).astype(bool).sum()

test the regex: https://regex101.com/r/cF5AVW/6

@reza1615
Copy link
Author

reza1615 commented Jan 5, 2021

Also please update the Cleaning function (remove hidden characters)
image

@reza1615
Copy link
Author

reza1615 commented Jan 5, 2021

And remove numbers cleaning function
image

@aschonfeld
Copy link
Collaborator

fixed in v1.31.0

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

No branches or pull requests

2 participants