PythonCheatSheetPDF
PythonCheatSheetPDF
Add metadata for new column: Run an individual cell: Ctrl + Enter df.column_1 = df.column_1.astype(int): convert
md['new_column'] = { Add a cell above current cell: Esc then A column_1’s datatype to integer
'name': ‘New Column Name', Add a cell below current cell: Esc then B
'type': 'String', Delete current cell: Esc then D twice df2 = df[df[column_1] > 3]: make new DataFrame
'length’: (8,) Set cell type as Code: Esc then Y from rows where column_1 value is greater than 3
} Set cell type as Markdown: Esc then M
Split cell in two at cursor location: Ctrl + Shift + _ RESOURCES
MATPLOTLIB ESSENTIALS Comment/uncomment line of code: Ctrl + /
Alteryx.help()
import matplotlib.pyplot as plt Use this function in the Jupyter interface for help.
Import matplotlib package with abbreviation to use INTERFACE TOOLS
functions commonly written with “plt.” Workflow Example
Alteryx.getWorkflowConstant() Click on the Python Tool and then Open Example.
plt.hist(column_1) Retrieve a specific workflow constant. Example:
Make a histogram (bar chart) of values in column_1. Alteryx.getWorkflowConstant("Engine.WorkflowDirectory") Tool Mastery | Python
plt.scatter(column_1, column_2) Alteryx.getWorkflowConstants( ) Python Tool Help Documentation
Make a scatter plot comparing column_1 (x-axis) to Returns a dictionary of the values of all Alteryx workflow
How to Reset the Python Tool to its Original State
column_2 (y-axis). constants.