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

coerce float if string or tuple #569

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

dcolinmorgan
Copy link
Contributor

for rare cases first encountered in avr-59k['Source_IP4_Subnet_16'] dataset, for example

graphistry.nodes(avr59k_splunk['Source_IP4_Subnet_16'].dropna()).umap()

would throw type error

see end of this thread

@@ -393,6 +393,28 @@ def convert_money_string_to_float(money: str):
mask = where_is_currency_column(df, col)
df[col, mask] = df[col, mask].apply(convert_money_string_to_float)

def try_coerce_to_numeric(ndf: pd.DataFrame):
try:
nndf = ndf.copy()
Copy link
Contributor

Choose a reason for hiding this comment

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

:(

nndf = ndf.copy()
object_columns = nndf.select_dtypes(include=['object']).columns
for j in object_columns:
num_floats = sum(isinstance(x, float) for x in nndf[j].dropna())
Copy link
Contributor

Choose a reason for hiding this comment

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

This is slow, and weird to check for floats in a col marked as object?

Copy link
Contributor

@lmeyerov lmeyerov left a comment

Choose a reason for hiding this comment

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

@silkspace @tanmoyio this seems slow and surprising to put in the critical path for most gpu umap calls?

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