Discussions

Expand all | Collapse all

how to use ROUND_TO_DIGIT in pymapd

  • 1.  how to use ROUND_TO_DIGIT in pymapd

    Posted 04-01-2019 22:43
    can you share an example of how to use round_to_digit in pymapd
    #Examples

    ------------------------------
    nagulan [[Unknown]]
    [[Unknown]]
    salem
    ------------------------------


  • 2.  RE: how to use ROUND_TO_DIGIT in pymapd

    Posted 04-02-2019 05:27
    Edited by Randy Zwitch 04-02-2019 05:26
    Using this function in pymapd is the same as in the query interface, as pymapd just submits queries to the backend. So you would do something like this:


    import pymapd

    conn = pymapd.connect()
    sql = "select round_to_digit(colname, 3) from table limit 100"
    df = conn.execute(sql).fetchall()


    ------------------------------
    Randy Zwitch
    Senior Director of Developer Advocacy
    OmniSci
    Philadelphia PA
    ------------------------------