<jupyter_start><jupyter_text>Tableau and Tabpy Getting Started:1. In a new terminal window, type:- ```pip install tabpy```- ```pip install tabpy-client```- ```tabpy```This should start a server allowing you to use that terminal window as a server for Tableau to connect to. Reference: https://github.com/tableau/TabPy/blob/master/docs/server-install.md  Loading TableauOpen Tableau and connect to the "Sample - Superstore" dataset - (probably in `Documents > My Tableau Repository > Datasources > 2020.2 > en_US-US > Sample Superstore.xls` )In order to connect to the Tableau server the first time, you'll have to do the following: - Help > Settings and performance > Manage analytics extension connection- Choose `TabPy/External API` from the from the `Select an Analytics Extension` dropdown- Choose `localhost` from the `Server` dropdown.- Type `9004` in the `Port` section Next, import the necessary libraries:<jupyter_code>import numpy as np
import tabpy_client<jupyter_output><empty_output><jupyter_text>Define a connection for later, so we know which server to send the function to<jupyter_code>connection = tabpy_client.Client('http://localhost:9004/')<jupyter_output><empty_output><jupyter_text>Let's do a little feature-engineering by multiplying two columns together.This is a very simple manipulation, but you can use `tabpy` to make machine-learning models and more.<jupyter_code>def multiply_two_columns(col1, col2):
    """
     Multiplies two columns

    Arguments
    ---------
    col1 : list
        A column from Tableau
        
    col2 : list
        A column from Tableau

    Returns
    -------
    col3 : list
        A new column for the DataFrame
    """

    col3 = np.multiply(col1, col2)
    
    return col3.tolist()
# Sends the function to the server to be used by Tableau
connection.deploy('ColumnMultiplier',  # name, can be anything. This is the name you'll be referencing later
                  multiply_two_columns,   # the name of the function we're sending
                  description = 'Returns the product of two columns', # A short docstring
                  override=True)  # force update (in case you want to change the function)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08461538461538462, 'fraction_numerical': 0.010407239819004524, 'mean_word_length': 3.6645569620253164, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 20, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '557351', 'license': 'MIT', 'n_tokens_mistral': 633, 'n_tokens_neox': 599, 'n_words': 244, 'path': 'tutorial.ipynb', 'repo_name': 'matthewconnell/tableau_tutorial', 'size': '2210'}