4

I'm using Tableau's Python API to export a NumPy array as a data extract. All the examples I've seen from the library docs and elsewhere loop over each row. I'd like to just import an array as an entire table column, but it isn't clear this is easily possible. Iterating over each row is inefficient, and I would imagine there's a simple way to speed this up with arrays.

Any experience using NumPy or pandas with the Tableau API would be much appreciated. Thanks!

  • 3
    Haha. I find it very funny that a column-oriented DBMS has an API that only supports adding one row at a time. Hope someone with better knowledge than me comes here to say otherwise, but I only know the insert(row) method – Inox May 21 '15 at 23:59

2 Answers2

0

If performance is a concern you should check out pantab

You are correct in that Tableau requires a row-oriented insert which can be painfully slow if working in Python. pantab mitigates this by implementing performance critical functions in C while providing the end user the high level abstractions needed to interface pandas and Tableau

Will Ayd
  • 6,767
  • 2
  • 36
  • 39
0

You can also try pandleau. Looks like two lines to go from a pandas dataframe to tde or hyper.

import pandas as pd
import pandleau
df = pd.read_csv('file.csv')

df = pandleau(df)
df.to_tableau('name.hyper', add_index=False)
vizyourdata
  • 1,338
  • 1
  • 17
  • 44