-
Notifications
You must be signed in to change notification settings - Fork 94
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
Drop column with no information #736
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,7 +210,12 @@ def get_identifier_description_mp(arg_tup): | |
|
||
def get_identifier_description(data, column_name, data_dtype): | ||
data = list(data) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we make this a list? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if it's already in a series form you can simply do something like len(data.unique()) |
||
unquie_pct = len(set(data)) / len(data) | ||
nr_unique = len(set(data)) | ||
|
||
if nr_unique == 1: | ||
return 'No Information' | ||
|
||
unquie_pct = nr_unique / len(data) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix the spelling |
||
|
||
spaces = [len(str(x).split(' ')) - 1 for x in data] | ||
mean_spaces = np.mean(spaces) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are we doing this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In order to mark the column for dropping under the "identifier / foreign-keys" rule, if this function returns a string (rather than |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type hint
data: Iterable, column_name: str, data_dtype: str