Skip to content

GDB from Pandas error #117

@orerocks

Description

@orerocks

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions