Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Tableau prep encoding to a set of fields in a flow

def encode(input):     
  le = preprocessing.LabelEncoder()
  Return pd.DataFrame({
    'Opportunity Number' : input['Opportunity Number'],
    'Supplies Subgroup Encoded' : le.fit_transform(input['Supplies Subgroup']),
    'Region Encoded' : le.fit_transform(input['Region']),
    'Route To Market Encoded' : le.fit_transform(input['Route To Market']),
    'Opportunity Result Encoded' : le.fit_transform(input['Opportunity Result']),
    'Competitor Type Encoded' : le.fit_transform(input['Competitor Type']),
    'Supplies Group Encoded' : le.fit_transform(input['Supplies Group']),
})
Source by help.tableau.com #
 
PREVIOUS NEXT
Tagged: #Tableau #prep #encoding #set #fields #flow
ADD COMMENT
Topic
Name
1+9 =