Pandas DataFrames converted to TensorBoard Format
Project description
Pandas2TensorBoard
Pandas2TensorBoard
is a library for transforming the pandas DataFrame
into the data fomrat of TensorBoard. Pandas2TensorBoard
relies on
torch utilities for the data transformation.
Installation
-
Regular installation via
pip
:pip install pandas2tensorboard
-
With modin backend for
pandas
pip install pandas2tensorboard[modin]
-
With Dask and omnisci support for
pandas
pip install pandas2tensorboard[backend]
-
With Dask and omnisci support for
pandas
and modin backend forpandas
pip install pandas2tensorboard[all]
Usage
Currently the following types of export from pandas
to tensorboard
are
supported:
pd.DataFrame
->scalars
pd.DataFrame
->scalars
with timestamppd.DataFrame
->scatter
via hyperparameters
For initializing the pandas2tensorboard
library, the current syntax of Torch's
tensorboard.SummaryWriter is used.
Examples
-
Exporting a regular
pd.DataFrame
totensorboard
by removing columns withstr
:import seaborn as sns from pandas2tensorboard import pandas2tensorboard as p2t pt = p2t.Pandas2TensorBoard() pt.regular_df( sns.load_dataset("planets"), label="planets", remove_nan=True, remove_str=True, ) pt.close()
-
Exporting a
pd.DataFrame
with time column totensorboard
:import seaborn as sns from pandas2tensorboard import pandas2tensorboard as p2t pt = p2t.Pandas2TensorBoard() pt.timeseries_df( sns.load_dataset("attention"), time="score", label="attention", remove_nan=True, remove_str=True, time_convert=True, ) pt.close()
The time column with name
score
is transformed intofloat
with timestamp. -
Exporting a
pd.DataFrame
with hyperparameters totensorboard
:import seaborn as sns from pandas2tensorboard import pandas2tensorboard as p2t pt = p2t.Pandas2TensorBoard() pt.scatter_df( sns.load_dataset("anagrams"), x_axis="subidr", group="anagrams", remove_nan=True, remove_str=True, ) pt.close()
The
x-axis
corresponds tohparam_dict
; the dataframe without columnx_axis="subidr"
corresponds tometric_dict
.
Contributing
Please feel free to open an issue or create a pull request; see also contributing.
License
Check MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Pandas2TensorBoard-0.1.1a1.tar.gz
.
File metadata
- Download URL: Pandas2TensorBoard-0.1.1a1.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.8.12 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98c048edca1f60af86bc09a892e6b1a10d8022406aa4619a8716f2fa1df78b2c |
|
MD5 | 910892725c5143f2ea757874822cc68b |
|
BLAKE2b-256 | d1c9c4c2f626ca95fef5935ad920515f62cfa32dad6c6b9a9c6942d9fb90be01 |
File details
Details for the file Pandas2TensorBoard-0.1.1a1-py3-none-any.whl
.
File metadata
- Download URL: Pandas2TensorBoard-0.1.1a1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.8.12 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c362739a11535c9b0b3506b0322b3f150c96875554a1d26a5f160f1eb558dfd |
|
MD5 | d3439bd7d5ac9d1b85700937d5d694bd |
|
BLAKE2b-256 | ddb1e7cc4c0274844ac4eb4f63646b22f31fb6ec82721d00745753dd1f1ce62f |