[Python] What are the technical differences between loadTable, table, and run for loading...

Discussão em 'Python' iniciado por Stack, Agosto 8, 2025.

  1. Stack

    Stack Membro Participativo

    I’m using DolphinDB’s Python API (dolphindb package) and need clarification on the technical distinctions between three methods of loading in-memory tables. Given an in-memory table named test:

    For a in-memory table "test":

    import dolphindb as ddb
    s = ddb.session(<ip>, <port>, "admin", "123456")
    s.run("test = table(1 2 3 as id)")


    method 1:using loadTable

    t1 = s.loadTable(tableName="test")
    print(t1)
    <dolphindb.table.Table object at 0x0000026AC46B5B10>


    method 2:using table

    t2 = s.table(data='test')
    print(t2)
    <dolphindb.table.Table object at 0x0000026AC0F64F70>


    method 3:using run

    t3 = s.run("test")
    print(t3)
    id
    0 1
    1 2
    2 3


    I found that loadTable and table return DolphinDB Table objects, But run returns a pandas DataFrame directly.

    Here are my questions:


    1. What is the formal difference between loadTable and table in the API design? Are they aliases, or do they have specific use cases (e.g., loading vs. referencing)?


    2. What are the technical constraints or optimizations that justify preferring loadTable/table over run for large tables?


    3. Is there a way to convert a Table object to a DataFrame after applying operations

    Continue reading...

Compartilhe esta Página