Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
excludeCompatible Functions

pytd.pandas_td.connect

pytd.pandas_td.connect(apikey=Noneendpoint=None**kwargs)[source]

...

Returns

Return type

pytd.Client

pytd.pandas_td.create_engine

pytd.pandas_td.create_engine(urlcon=Noneheader=Trueshow_progress=5.0clear_progress=True)[source]

...

  • date_format (str, default: None) – Format string for datetime objects

  • writer (str, {‘bulk_import’, ‘insert_into’, ‘spark’}, or pytd.writer.Writer, default: ‘bulk_import’) – A Writer to choose writing method to Treasure Data. If not given or string value, a temporal Writer instance will be created.

  • fmt (str, {'csv', 'msgpack'}, default: 'csv') –

    Format for bulk_import.

    • csv

      Convert dataframe to temporary CSV file. Stable option but slower than msgpack option because pytd saves dataframe as temporary CSV file, then td-client converts it to msgpack. Types of columns are guessed by pandas.read_csv and it causes unintended type conversion e.g., 0-padded string "00012" into integer 12.

    • msgpack

      Convert to temporary msgpack.gz file. Fast option but there is a slight difference on type conversion compared to csv.

IPython Magics

Use IPython magics to access to Treasure Data. Start by loading the magics.

In [1]: %load_ext pytd.pandas_td.ipython

pytd.pandas_td.ipyhton.MagicContext