TabPy | Execute Python code on the fly and display results | Dashboard library
kandi X-RAY | TabPy Summary
kandi X-RAY | TabPy Summary
TabPy (the Tableau Python Server) is an Analytics Extension implementation which expands Tableau's capabilities by allowing users to execute Python scripts and saved functions via Tableau's table calculations.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parse config file .
- Add or update an endpoint .
- Setup the tabpy package .
- Updates an endpoint .
- Called when the state file changes .
- Get authentication method for given API version .
- Generate an endpoint .
- Process a request .
- Generate a schema from input and output .
- Load an object .
TabPy Key Features
TabPy Examples and Code Snippets
import tabpy_client
import numpy as np
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler
connection = tabpy_client.Client('http://localhost:9004/')
def kmeans(var1,var2,kcluster):
X = np.column_stack([var1,var2])
DATE(DATETRUNC('month', DATEADD('month', [Months Forecast], [Month])))
LOOKUP(SUM([#Passengers]), [Months Forecast])
IF LAST() < [Months Forecast]
THEN 'Model Forecast'
ELSE 'Model Prediction'
END
Script_Str('
print("STARTING NEW SCRIPT RUN")
print(Sys.time())
print(.arg2) # grouping
print(.arg1) # selected country
# TEST VARIABLE (non-prod)
.MaxSourceDataRecords = 1000 # -1 to disable
# TABLEAU PARAMETER VARIABLES
.country = "'
def arg_parse():
parser = argparse.ArgumentParser()
parser.add_argument("input_file")
parser.add_argument("target_col")
parser.add_argument("--sep", default=",")
parser.add_argument("-n", "--new_col")
parser.add_arg
ReturnValues=[]
for row in cur.fetchall():
ReturnValues.append(row)
return ReturnValues
newList=[]
for x in _arg1:
newList.append(x > 0)
return newList
Community Discussions
Trending Discussions on TabPy
QUESTION
I want to create some code in TabPy that will count the frequency of words in a column and remove stop words for a word cloud in Tableau.
I'm able to do this easily enough in Python:
...ANSWER
Answered 2021-Mar-02 at 16:05I think that the best way to get familiar with Python related to Tableau could be this (old) thread on the Tableau community:
It explains step-by-step the initial set up and how to "call" Python via Tableau Calculated fields.
In addition, you'll find at the top of the post the reference to the more updated TabPy GitHub repository: https://github.com/tableau/TabPy
QUESTION
For getting the list of installed libraries, I run the following command in Jupyter Notebook:
...ANSWER
Answered 2020-Nov-17 at 11:03We can use os
module to create the pip list, then we use pandas.read_csv
with \s+
as seperator to read the pip list into a dataframe:
QUESTION
I want to connect Tableau to TabPy installed on GCP Compute Instance. For that purpose I created a Compute Instance with default settings. Then I assigned a static external IP address to that instance.
In Tableau I am using an External Service Connection option:
In the Server field I am providing my GCP Compute Instance external IP address. I leave Port on the default option. With that setup Tableau is not able to create a connection. Does someone know what I should change/add in the instance configuration to successfully create that connection?
I think I should be using Username and Password option, but I am not quite sure how to get username and password to my newly created GCP Compute Instance.
...ANSWER
Answered 2020-Feb-12 at 12:53To access your VM from the internet on port 9004, you'd need to:
- Create a new firewall rule allowing incoming traffic on 9004 with a tag.
- Assign your instance with above tag.
See documentation and/or short YouTube video
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install TabPy
You can use TabPy like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page