2021-05-13 23:48:51 +00:00
---
title: Tables Reporting (Pandas and CSV Files)
---
The [pandas_reporting.py ](https://github.com/allegroai/clearml/blob/master/examples/reporting/pandas_reporting.py ) example demonstrates reporting tabular data from Pandas DataFrames and CSV files as tables.
2023-09-13 07:58:54 +00:00
ClearML reports these tables, and displays them in the **ClearML Web UI** ** >** experiment details ** >** **PLOTS**
2022-05-22 07:27:30 +00:00
tab.
2021-05-13 23:48:51 +00:00
2023-09-04 12:40:42 +00:00
When the script runs, it creates an experiment named `table reporting` in the `examples` project.
2021-05-13 23:48:51 +00:00
2021-09-09 10:17:46 +00:00
## Reporting Pandas DataFrames as Tables
2021-05-13 23:48:51 +00:00
2023-09-13 07:58:54 +00:00
Report Pandas DataFrames by calling [`Logger.report_table()` ](../../references/sdk/logger.md#report_table ),
and providing the DataFrame in the `table_plot` parameter.
2021-05-13 23:48:51 +00:00
2021-12-14 13:12:30 +00:00
```python
# Report table - DataFrame with index
df = pd.DataFrame(
{
"num_legs": [2, 4, 8, 0],
"num_wings": [2, 0, 0, 0],
"num_specimen_seen": [10, 2, 1, 8],
},
index=["falcon", "dog", "spider", "fish"],
)
df.index.name = "id"
Logger.current_logger().report_table(
2024-08-12 13:04:50 +00:00
title="table pd",
series="PD with index",
2021-12-14 13:12:30 +00:00
iteration=iteration,
table_plot=df
)
```
2021-05-13 23:48:51 +00:00
![image ](../../img/examples_reporting_12.png )
2021-09-09 10:17:46 +00:00
## Reporting CSV Files as Tables
2021-05-13 23:48:51 +00:00
Report CSV files by providing the URL location of the CSV file in the `url` parameter. For a local CSV file, use the `csv` parameter.
2021-12-14 13:12:30 +00:00
```python
# Report table - CSV from path
csv_url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv"
Logger.current_logger().report_table(
2024-08-12 13:04:50 +00:00
title="table csv",
series="remote csv",
2021-12-14 13:12:30 +00:00
iteration=iteration,
url=csv_url
)
```
2021-05-13 23:48:51 +00:00
![image ](../../img/examples_reporting_11.png )