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

GDB from Pandas error #117

Open
orerocks opened this issue Oct 1, 2019 · 1 comment
Open

GDB from Pandas error #117

orerocks opened this issue Oct 1, 2019 · 1 comment
Labels

Comments

@orerocks
Copy link

orerocks commented Oct 1, 2019

As described in the GX Developer Forum, creating a GDB from a Pandas dataframe where the dataframe contains text fields throws an error since the dataframes report the text fields as dtype.type==np.object_ instead of np.str_. A simple addition to the function gx_dtype in the gxpy utility.py code avoids the error:

    if dtype.type is np.str_:
        # x4 to allow for full UTF-8 characters
        return -int(dtype.str[2:])*4
    elif dtype.type is np.object_:
        # My edit, assign length 80 to all strings
        return -int(80)

but I assume this is only a partial fix?

@orerocks
Copy link
Author

orerocks commented Nov 14, 2019

I think a side-effect of this change is that all new fields created in the database within Geosoft default to being strings - even when numeric Channel Math or Coordinate Conversion calculations are performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants