Add Python/pandas equivalent tab to all playground pages with CI validation - #93
Merged
Conversation
Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/6dab294e-9636-49b9-bcf3-918c3a4b9c3c Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
…ages Add hidden <textarea class='playground-python'> elements after each playground-editor textarea in dtype.html (7 blocks) and dataframe.html (11 blocks). Each contains the equivalent pandas/numpy Python code for the TypeScript example shown in the editor. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Add <textarea class="playground-python"> sibling elements after each playground-editor with equivalent Python/pandas code for: - index-playground.html (9 blocks): Index creation, properties, label lookup, set operations, sorting, manipulation, missing values, RangeIndex, and scratch pad - groupby.html (11 blocks): sum, mean/min/max, count, std, first/last, size/ngroups, agg, transform, apply, filter, and scratch pad Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
…d pages Add hidden <textarea class="playground-python"> elements after each playground-editor block containing equivalent pandas code: - concat.html: 6 blocks with pd.concat() equivalents - merge.html: 5 blocks with pd.merge() equivalents - csv.html: 7 blocks with pd.read_csv()/to_csv() equivalents Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Add hidden playground-python textareas after each playground-editor textarea in string_accessor.html (9 blocks), datetime_accessor.html (8 blocks), and describe.html (7 blocks) with equivalent pandas code. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Add hidden <textarea class="playground-python"> elements after each playground-editor in json.html (7), corr.html (4), rolling.html (8), and ewm.html (9) with equivalent pandas code using proper Python conventions (snake_case, print(), pd.read_json, df.to_json, etc.). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
…layground pages Add hidden <textarea class='playground-python'> elements after each playground-editor textarea with equivalent pandas code: - melt.html: 4 blocks (pd.melt with id_vars, value_vars, var_name, value_name) - pivot.html: 5 blocks (df.pivot, pd.pivot_table with aggfunc, fill_value) - stack_unstack.html: 6 blocks (df.stack, s.unstack with dropna, fill_value) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
…ground pages Add hidden playground-python textareas with equivalent pandas code after each playground-editor textarea in rank.html (8 blocks), nlargest.html (8 blocks), and cum_ops.html (8 blocks). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Add hidden <textarea class="playground-python"> elements after each playground-editor textarea in elem_ops.html (7 blocks), value_counts.html (6 blocks), multi_index.html (8 blocks), and cat_accessor.html (8 blocks). Each Python block mirrors the corresponding TypeScript example using idiomatic pandas APIs (snake_case methods, keyword arguments, print() instead of console.log(), Python literals). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
- json.html: Add import io and wrap pd.read_json() string args with io.StringIO() in blocks 1-5 and 7 - stack_unstack.html: Remove deprecated dropna parameter from df.stack() calls; chain .dropna() after stack where needed - csv.html: Fix skiprows=2 to skiprows=range(1, 3) to preserve header row in block 5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
- index-playground.html: Replace .to_list() with .tolist() for numpy array results from isin(), argsort(), isna(), notna() - ewm.html: Add raw=True to ewm().apply() for pandas 3.0 compatibility - nlargest.html: Replace nlargest/nsmallest on string Series with sort_values().head() which works in pandas Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
…orkflows Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/6dab294e-9636-49b9-bcf3-918c3a4b9c3c Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Python equivalent tab for documentation and playground
Add Python/pandas equivalent tab to all playground pages with CI validation
Apr 10, 2026
mrjf
marked this pull request as ready for review
April 10, 2026 17:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every playground code block now has a switchable TypeScript/Python tab showing the equivalent pandas code side-by-side. Python tab is background by default. All 186 Python examples are validated in CI on every push.
Runtime (
playground-runtime.js)<textarea class="playground-python">siblings and renders a tab bar (TypeScript | Python)<pre>— switches hide the editor/run controls⏱ 2.3ms)Playground pages (25 files, 186 blocks)
Each
playground-editortextarea now has a hiddenplayground-pythonsibling with idiomatic pandas equivalent:CI validation
scripts/validate-python-examples.py— extracts Python blocks from HTML, runs each with pandas, reports failures with timingci.yml— newvalidate-python-examplesjob runs on PRspages.yml— Python validation gate before Pages deploymentAll examples target pandas 3.0+ (e.g.
io.StringIOforread_json, nodropnaparam onstack()).