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

KINC 3D viewer attempts to read in p_value as character string #183

Open
JohnHadish opened this issue Apr 23, 2021 · 0 comments
Open

KINC 3D viewer attempts to read in p_value as character string #183

JohnHadish opened this issue Apr 23, 2021 · 0 comments

Comments

@JohnHadish
Copy link
Collaborator

JohnHadish commented Apr 23, 2021

If the first row of p_value use exponential format (X.XXXe-XX) rather than long form (X.XXXXX), python will attempt to read that column as a string. This will cause python to fail with this error:

Traceback (most recent call last):
  File "/usr/local/bin/kinc-3d-viewer.py", line 1764, in <module>
    main()
  File "/usr/local/bin/kinc-3d-viewer.py", line 1738, in main
    bin_edges(net)
  File "/usr/local/bin/kinc-3d-viewer.py", line 225, in bin_edges
    net['Pval_Bin'] = np.round(-np.log10(net['p_value']))
  File "/home/jah/.local/lib/python3.8/site-packages/pandas/core/series.py", line 679, in __array_ufunc__
    result = getattr(ufunc, method)(*inputs, **kwargs)
TypeError: loop of ufunc does not support argument 0 of type str which has no callable log10 method

This can be partially fixed by addressing issue #182, but KINC extract will sometimes still use the exponential format when it is extracting a network, which will also cause failure:

image

Suggested Fix:

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

1 participant