Skip to content

ascii codec error with "Ñ" char in column name #6

Description

@carlos-merida

df = pd.read_sql(query, con)

Response:

UnicodeDecodeError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\ibm_db_dbi.py in __get_description(self)
1035 column_desc.append(ibm_db.field_name(self.stmt_handler,
-> 1036 column_index))
1037 type = ibm_db.field_type(self.stmt_handler, column_index)

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 1: ordinal not in range(128)

During handling of the above exception, another exception occurred:

Error Traceback (most recent call last)
in
----> 1 df = pd.read_sql(query, con)

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\sql.py in read_sql(sql, con, index_col, coerce_float, params, parse_dates, columns, chunksize)
410 coerce_float=coerce_float,
411 parse_dates=parse_dates,
--> 412 chunksize=chunksize,
413 )
414

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\sql.py in read_query(self, sql, index_col, coerce_float, params, parse_dates, chunksize)
1632 args = _convert_params(sql, params)
1633 cursor = self.execute(*args)
-> 1634 columns = [col_desc[0] for col_desc in cursor.description]
1635
1636 if chunksize is not None:

C:\ProgramData\Anaconda3\lib\site-packages\ibm_db_dbi.py in __get_description(self)
1080 except Exception as inst:
1081 self.messages.append(_get_exception(inst))
-> 1082 raise self.messages[len(self.messages) - 1]
1083
1084 return self.__description

Error: ibm_db_dbi::Error: UnicodeDecodeError('ascii', b'A\xd1O', 1, 2, 'ordinal not in range(128)')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions