Go to Sign up
Note: Your files never leave your device. We don't upload, transfer, or store your data.
|
|
|
|
|---|---|---|
|
|
|
The Markdown To Pandas DataFrame Converter on A.Tools transforms Markdown pipe-delimited tables into Python pd.DataFrame() constructor code — valid Python you can paste into Jupyter notebooks, scripts, or any data science workflow. All processing runs in your browser. No data leaves your device.
Data is often documented in Markdown tables within README files, research papers, and wikis. Pandas requires Python data structures to create DataFrames. This tool converts between the two, with 6 configurable settings including three output formats, number parsing, and automatic import generation.
Click Enter Data to paste a Markdown table into the input area, or click Choose File to drag and drop a .md file. Press Sample to load example data.
Once parsed, an interactive spreadsheet appears. Use the toolbar to:
Add or delete rows and columns
Transpose the table (swap rows and columns)
Remove duplicate rows
Delete empty rows and columns
Change text case (UPPERCASE, lowercase, Capitalize)
Find and replace values — supports case-sensitive search and regex
Toggle First Row as Header to define column names
Right-click any cell for context-menu operations.
In the Properties panel, choose from 6 options:
| Setting | Default | Description |
|---|---|---|
| Data Format | Dict of Lists | How the data is structured in the generated Python code |
| Variable Name | df | The Python variable name for the DataFrame |
| Indent Size | 2 spaces | Indentation within the data structure |
| Quote Style | Single Quotes | String quote character in the output |
| Parse Numbers | Off | Automatically convert numeric strings to int/float |
| Include Import | Off | Prepend import pandas as pd to the output |
Click Convert to generate Python code. Use Copy to Clipboard or Download File to save as a .py file.
Two input modes: Paste Markdown directly or upload a .md file via drag-and-drop
Full table editor: Edit, transpose, deduplicate, find-and-replace before converting
Three output formats: Dict of Lists, List of Dicts, or 2D List
Custom variable name: Set any valid Python identifier
Configurable indentation: 2, 4, 8 spaces or tabs
Quote style choice: Single or double quotes
Smart number parsing: Optionally convert "42" → 42, "3.14" → 3.14
Auto import statement: Optionally prepend import pandas as pd
Client-side processing: Files never leave the browser — zero data upload
Undo/Redo: Full edit history with revert support
Context menu: Right-click for quick row/column/cell operations
Header toggle: Treat the first row as column names or regular data
Validation indicator: Real-time feedback on input validity
Given this Markdown input:
| name | age | city |
|-------|-----|-------------|
| Alice | 30 | New York |
| Bob | 25 | Los Angeles |
import pandas as pd
df = pd.DataFrame({
'name': ['Alice', 'Bob'],
'age': ['30', '25'],
'city': ['New York', 'Los Angeles']
})
import pandas as pd
df = pd.DataFrame([
{'name': 'Alice', 'age': '30', 'city': 'New York'},
{'name': 'Bob', 'age': '25', 'city': 'Los Angeles'}
])
import pandas as pd
df = pd.DataFrame(
[['Alice', '30', 'New York'],
['Bob', '25', 'Los Angeles']],
columns=['name', 'age', 'city']
)
import pandas as pd
df = pd.DataFrame({
'name': ['Alice', 'Bob'],
'age': [30, 25],
'city': ['New York', 'Los Angeles']
})
Numeric values are converted to int or float automatically. Non-numeric values remain as strings.
Each column name maps to a list of values. This is the most common format for creating DataFrames:
df = pd.DataFrame({
'name': ['Alice', 'Bob'],
'age': [30, 25]
})
Best for: Wide tables with many rows, when you think in columns.
Each row is a dictionary with column names as keys. This format mirrors JSON records:
df = pd.DataFrame([
{'name': 'Alice', 'age': 30},
{'name': 'Bob', 'age': 25}
])
Best for: API responses, JSON data, row-oriented thinking.
A flat list of lists with column names passed separately. Most compact:
df = pd.DataFrame(
[['Alice', 30],
['Bob', 25]],
columns=['name', 'age']
)
Best for: Compact code, embedded data, minimal syntax.
| Format | Readability | Compactness | JSON-like | Default |
|---|---|---|---|---|
| Dict of Lists | Column-oriented | Medium | No | Yes |
| List of Dicts | Row-oriented | Verbose | Yes | No |
| 2D List | Grid-oriented | Compact | No | No |
Official reference: pandas.DataFrame constructor
Sets the Python variable that holds the DataFrame. Must be a valid Python identifier (letters, numbers, underscores, no spaces, cannot start with a number).
# Variable name: "sales_data"
sales_data = pd.DataFrame({...})
Controls indentation within the data structure. Options: 2 spaces, 4 spaces, 8 spaces, or tabs.
Choose between single quotes ('text') and double quotes ("text"). Both are valid Python. PEP 8 does not mandate a preference. Single quotes are the default.
When enabled, the tool inspects each cell value and converts:
Integers (e.g., "42" → 42)
Floats (e.g., "3.14" → 3.14)
Non-numeric strings remain quoted
When disabled (default), all values are output as quoted strings.
When enabled, import pandas as pd is prepended to the output. Disable it if you are pasting into a file that already imports Pandas.
| Scenario | Why Convert |
|---|---|
| Jupyter notebooks | Paste documented data directly into analysis notebooks |
| Data exploration | Convert reference tables into DataFrames for df.head(), df.describe() |
| Machine learning | Generate feature DataFrames from specification tables |
| Unit testing | Create test fixtures from documented example data |
| Documentation | Include runnable code examples in Python documentation |
| Education | Transform textbook tables into executable Python |
| Data cleaning | Move documented data into Pandas for transformation |
| Dashboard prototyping | Generate sample DataFrames for Streamlit or Dash apps |
import pandas as pd
df = pd.DataFrame({
'product': ['Widget A', 'Widget B', 'Widget C'],
'price': ['19.99', '29.99', '39.99'],
'stock': ['150', '80', '200']}
)
df['price'] = df['price'].astype(float)
df['stock'] = df['stock'].astype(int)
df.describe()
import streamlit as st
import pandas as pd
df = pd.DataFrame({
'name': ['Alice', 'Bob', 'Charlie'],
'department': ['Engineering', 'Marketing', 'Engineering'],
'salary': ['95000', '78000', '102000']}
)
df['salary'] = df['salary'].astype(int)
st.dataframe(df)
st.bar_chart(df, x='name', y='salary')
No. All file parsing and conversion runs in your browser using JavaScript. Your data stays on your device. A.Tools never receives, stores, or transmits your file contents.
The tool supports standard pipe-delimited Markdown tables following the CommonMark specification, including tables with or without leading/trailing pipes and alignment indicators.
Dict of Lists maps column names to value lists. List of Dicts creates one dictionary per row. 2D List is a flat list of lists with columns specified separately. All three produce identical DataFrames — choose based on readability preference.
When enabled, the tool converts numeric-looking strings to Python int or float types. For example, "42" becomes 42 and "3.14" becomes 3.14. Non-numeric values remain as strings.
When enabled, import pandas as pd is added at the top of the output. Disable it if you are pasting into a script that already imports Pandas.
Yes. The generated code is valid Python 3.x syntax. Paste it into any .py file, Jupyter notebook cell, or Python REPL.
Yes. Enter any valid Python identifier in the Variable Name field. Python variables should start with a letter or underscore and contain only letters, numbers, and underscores.
Yes. After parsing, the full table editor lets you modify cells, add or remove rows and columns, transpose, deduplicate, change text case, and find-and-replace values.
Processing is client-side, so the limit depends on your browser's memory. Tables with tens of thousands of rows work reliably on modern browsers.