What Fig Helpers Are
fig is a small, curated Python library built into every Go Fig Code node. It gives you five purpose-built functions for the data tasks that are painful to write from scratch in pandas: fuzzy matching, fiscal year conversion, statistical scoring, safe rate calculations, and near-duplicate detection.
You don’t install or import fig. It’s always available inside the Code node’s Python mode, right alongside pd (pandas) and np (numpy).
When to Use Fig Helpers
Usefig.* when:
- You need to match records across two sources where names or IDs aren’t exact (CRM ↔ accounting, messy leads, product SKUs)
- Your organization uses a non-January fiscal year and you need to group dates correctly
- You want a z-score, rolling z-score, or safe percentage change without writing the edge cases yourself
- You’re cleaning a list with near-duplicate entries and
DISTINCTwon’t catch them
- A built-in node can do the same job. The XLOOKUP node handles exact joins without code
- The task is simple enough for plain pandas (adding columns, basic filtering,
.groupby)
Available Functions
The examples below reference
B1 as a second parent table. In Go Fig, each parent connected to a code node is exposed as a DataFrame named after its step label (A1, B1, C1, …), the same label you see on the node in the canvas. The position-0 parent is also bound to data. See Joining Multiple Parents in the Code node docs.fig.fuzzy_join
Match rows between two tables by approximate string similarity. For each row in the left table, finds the best match in the right table that scores above your similarity threshold.
Signature:
_match_score column (0.0 to 1.0). Unmatched rows get NaN on the right-side columns and on _match_score.
Example: reconcile HubSpot deals with QuickBooks customers:
fig.to_fiscal
Convert a date column into a fiscal-year integer, named by the calendar year the fiscal year starts in. Supports any fiscal-year start month.
Signature:
fig.zscore
Calculate z-scores, or how many standard deviations a value is from the mean. Useful for anomaly detection and identifying outliers.
Signature:
fig.pct_change_safe
Percentage change between consecutive rows, with division-by-zero and missing-first-row handled safely.
Signature:
fill value instead of NaN or inf.
Example: month-over-month revenue change:
fig.dedupe
Drop duplicates by exact match on a column subset, or cluster near-duplicates by fuzzy string similarity.
Signature:
Recipe Picker
Everyfig function has a matching snippet in the Insert recipe dropdown at the top of the Python Code editor. Pick a recipe, edit the column names to match your data, and you’re done. No typing required.
Usage Notes
fig is only available in Python mode of the Code node. SQL mode has no equivalent.Related Topics
Code Node
Write custom SQL or Python directly in your flow
XLOOKUP Node
Exact-match joins without code

