Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

psql use query result convert Decimal python numpy psycopg2

DEC2FLOAT = psycopg2.extensions.new_type(
    psycopg2.extensions.DECIMAL.values,
    'DEC2FLOAT',
    lambda value, curs: float(value) if value is not None else None)
psycopg2.extensions.register_type(DEC2FLOAT)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #psql #query #result #convert #Decimal #python #numpy
ADD COMMENT
Topic
Name
7+4 =