# Experiments Visualization Toolkit (ExpViz)
Welcome to the Experiments Visualization Toolkit (ExpViz), a Python-based solution designed to facilitate the handling and visualization of experiment results, particularly those stored in JSON format. Whether your results are stored in files or represented as JSON-like dictionaries, ExpViz is here to streamline your data visualization process.
[![GitHub Repo](https://img.shields.io/badge/github-repo-green.svg?style=flat&logo=github)](https://github.com/fuzihaofzh/expviz)
## Features
- **Read Results**: Directly input JSON-like dictionaries or read experiment results from JSON files in a specified directory.
- **Convert to DataFrame**: Elegantly transform nested dictionaries into customizable Pandas DataFrames.
- **Table Rendering**: Convert DataFrames to LaTeX and Markdown tables for seamless integration into documents and web pages.
- **Jupyter Display**: Render and showcase DataFrames interactively within Jupyter notebooks.
## Installation
```sh
# Clone the repository
git clone https://github.com/fuzihaofzh/expviz.git
# Navigate to the cloned repository
cd expviz
# (Optional) Install any dependencies listed in requirements.txt
pip install -r requirements.txt
```
## Usage
### 1. Reading Results
```python
# Directly using a JSON-like dictionary
data_dict = {
"exp1": {"Score1": 10.1, "Score2": 20},
"exp2": {"Score1": 30, "Score2": None}
}
results = read_results(data_dict=data_dict)
# Alternatively, using the base URL and experiment names
baseurl = "path/to/experiment/results"
expnames = ["experiment1", "experiment2"] # or {"exp1": "experiment1", "exp2": "experiment2"}
results = read_results(baseurl, expnames, filename="eval.json")
```
### 2. Converting to DataFrame
```python
# Format and convert the results to a DataFrame
df = dict_to_dataframe(results, fmt='{:,.3g}', transpose=False)
print(df)
```
### 3. Rendering as LaTeX or Markdown
```python
# Convert the DataFrame to a LaTeX table
latex_table = to_latex(results, fmt='{:,.3g}', transpose=False)
print(latex_table)
# Convert the DataFrame to a Markdown table
markdown_table = to_markdown(results, fmt='{:,.3g}', transpose=False)
print(markdown_table)
```
### 4. Displaying in Jupyter
```python
# Visualize the DataFrame in a Jupyter notebook
show(results, fmt='{:,.3g}', transpose=False)
```
## Examples
- **Using JSON-like Dictionary**
```python
data_dict = {
"exp1": {"Score1": 10.1, "Score2": 20},
"exp2": {"Score1": 30, "Score2": None}
}
results = read_results(data_dict=data_dict)
```
- **Using a List of Experiments**
```python
results = read_results("path/to/results", ["experiment1", "experiment2"])
```
- **Using a Dictionary of Experiments**
```python
results = read_results("path/to/results", {"exp1": "experiment1", "exp2": "experiment2"})
```
- **Visualizing in Jupyter Notebook**
```python
show(results)
```
- **Rendering as Markdown**
```python
md_table = to_markdown(results)
print(md_table)
```
## Contributing
Contributions are warmly welcomed! For information on how to contribute, please refer to our [contributing guidelines](CONTRIBUTING.md).
## License
ExpViz is under the MIT License. For more details, check out the [LICENSE.md](LICENSE.md) file in our GitHub repository.
Raw data
{
"_id": null,
"home_page": "https://github.com/fuzihaofzh/expviz",
"name": "expviz",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Shell env",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/4d/fd/88e996876b8d0b58f55d2d00ef4ad500582ff84dd1a1144d7df3168f5afe/expviz-0.0.3.tar.gz",
"platform": null,
"description": "# Experiments Visualization Toolkit (ExpViz)\n\nWelcome to the Experiments Visualization Toolkit (ExpViz), a Python-based solution designed to facilitate the handling and visualization of experiment results, particularly those stored in JSON format. Whether your results are stored in files or represented as JSON-like dictionaries, ExpViz is here to streamline your data visualization process.\n\n[![GitHub Repo](https://img.shields.io/badge/github-repo-green.svg?style=flat&logo=github)](https://github.com/fuzihaofzh/expviz)\n\n## Features\n\n- **Read Results**: Directly input JSON-like dictionaries or read experiment results from JSON files in a specified directory.\n- **Convert to DataFrame**: Elegantly transform nested dictionaries into customizable Pandas DataFrames.\n- **Table Rendering**: Convert DataFrames to LaTeX and Markdown tables for seamless integration into documents and web pages.\n- **Jupyter Display**: Render and showcase DataFrames interactively within Jupyter notebooks.\n\n## Installation\n\n```sh\n# Clone the repository\ngit clone https://github.com/fuzihaofzh/expviz.git\n\n# Navigate to the cloned repository\ncd expviz\n\n# (Optional) Install any dependencies listed in requirements.txt\npip install -r requirements.txt\n```\n\n## Usage\n\n### 1. Reading Results\n\n```python\n# Directly using a JSON-like dictionary\ndata_dict = {\n \"exp1\": {\"Score1\": 10.1, \"Score2\": 20},\n \"exp2\": {\"Score1\": 30, \"Score2\": None}\n}\nresults = read_results(data_dict=data_dict)\n\n# Alternatively, using the base URL and experiment names\nbaseurl = \"path/to/experiment/results\"\nexpnames = [\"experiment1\", \"experiment2\"] # or {\"exp1\": \"experiment1\", \"exp2\": \"experiment2\"}\nresults = read_results(baseurl, expnames, filename=\"eval.json\")\n```\n\n### 2. Converting to DataFrame\n\n```python\n# Format and convert the results to a DataFrame\ndf = dict_to_dataframe(results, fmt='{:,.3g}', transpose=False)\nprint(df)\n```\n\n### 3. Rendering as LaTeX or Markdown\n\n```python\n# Convert the DataFrame to a LaTeX table\nlatex_table = to_latex(results, fmt='{:,.3g}', transpose=False)\nprint(latex_table)\n\n# Convert the DataFrame to a Markdown table\nmarkdown_table = to_markdown(results, fmt='{:,.3g}', transpose=False)\nprint(markdown_table)\n```\n\n### 4. Displaying in Jupyter\n\n```python\n# Visualize the DataFrame in a Jupyter notebook\nshow(results, fmt='{:,.3g}', transpose=False)\n```\n\n## Examples\n\n- **Using JSON-like Dictionary**\n\n ```python\n data_dict = {\n \"exp1\": {\"Score1\": 10.1, \"Score2\": 20},\n \"exp2\": {\"Score1\": 30, \"Score2\": None}\n }\n results = read_results(data_dict=data_dict)\n ```\n\n- **Using a List of Experiments**\n\n ```python\n results = read_results(\"path/to/results\", [\"experiment1\", \"experiment2\"])\n ```\n\n- **Using a Dictionary of Experiments**\n\n ```python\n results = read_results(\"path/to/results\", {\"exp1\": \"experiment1\", \"exp2\": \"experiment2\"})\n ```\n\n- **Visualizing in Jupyter Notebook**\n\n ```python\n show(results)\n ```\n\n- **Rendering as Markdown**\n\n ```python\n md_table = to_markdown(results)\n print(md_table)\n ```\n\n## Contributing\n\nContributions are warmly welcomed! For information on how to contribute, please refer to our [contributing guidelines](CONTRIBUTING.md).\n\n## License\n\nExpViz is under the MIT License. For more details, check out the [LICENSE.md](LICENSE.md) file in our GitHub repository.\n",
"bugtrack_url": null,
"license": null,
"summary": "Visualize experiments tables and figures.",
"version": "0.0.3",
"project_urls": {
"Homepage": "https://github.com/fuzihaofzh/expviz"
},
"split_keywords": [
"shell",
"env"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "278a45e03a75a7b99ccf548c94ed807a723a5f4771af1e4988f1241172719c1e",
"md5": "b92af27f795709604295b8c96c8f34da",
"sha256": "625d8d70c6a24778378660606dbe0ac7234e7dd5145b44e13e947aa1b71c71e3"
},
"downloads": -1,
"filename": "expviz-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b92af27f795709604295b8c96c8f34da",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5479,
"upload_time": "2024-05-17T17:36:02",
"upload_time_iso_8601": "2024-05-17T17:36:02.672867Z",
"url": "https://files.pythonhosted.org/packages/27/8a/45e03a75a7b99ccf548c94ed807a723a5f4771af1e4988f1241172719c1e/expviz-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4dfd88e996876b8d0b58f55d2d00ef4ad500582ff84dd1a1144d7df3168f5afe",
"md5": "aad5b4e3dea3af1fa99d3f73aede9c7d",
"sha256": "5d6974bdd2a7374fcfe478628f543748bbcf86f5d3d65ae94235e4f70fa8127b"
},
"downloads": -1,
"filename": "expviz-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "aad5b4e3dea3af1fa99d3f73aede9c7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5812,
"upload_time": "2024-05-17T17:36:04",
"upload_time_iso_8601": "2024-05-17T17:36:04.257700Z",
"url": "https://files.pythonhosted.org/packages/4d/fd/88e996876b8d0b58f55d2d00ef4ad500582ff84dd1a1144d7df3168f5afe/expviz-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-17 17:36:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "fuzihaofzh",
"github_project": "expviz",
"github_not_found": true,
"lcname": "expviz"
}