Skip to main content

Pandas DataFrames converted to TensorBoard Format

Project description

CI - Python Package codecov PyPI

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 for pandas

    pip install pandas2tensorboard[all]
    

Usage

Currently the following types of export from pandas to tensorboard are supported:

  • pd.DataFrame -> scalars
  • pd.DataFrame -> scalars with timestamp
  • pd.DataFrame -> scatter via hyperparameters

For initializing the pandas2tensorboard library, the current syntax of Torch's tensorboard.SummaryWriter is used.

Examples

  1. Exporting a regular pd.DataFrame to tensorboard by removing columns with str:

    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()
    
  2. Exporting a pd.DataFrame with time column to tensorboard:

    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 into float with timestamp.

  3. Exporting a pd.DataFrame with hyperparameters to tensorboard:

    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 to hparam_dict; the dataframe without column x_axis="subidr" corresponds to metric_dict.

Contributing

Please feel free to open an issue or create a pull request; see also contributing.

License

Check MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Pandas2TensorBoard-0.1.1a1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

Pandas2TensorBoard-0.1.1a1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

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

Hashes for Pandas2TensorBoard-0.1.1a1.tar.gz
Algorithm Hash digest
SHA256 98c048edca1f60af86bc09a892e6b1a10d8022406aa4619a8716f2fa1df78b2c
MD5 910892725c5143f2ea757874822cc68b
BLAKE2b-256 d1c9c4c2f626ca95fef5935ad920515f62cfa32dad6c6b9a9c6942d9fb90be01

See more details on using hashes here.

File details

Details for the file Pandas2TensorBoard-0.1.1a1-py3-none-any.whl.

File metadata

File hashes

Hashes for Pandas2TensorBoard-0.1.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c362739a11535c9b0b3506b0322b3f150c96875554a1d26a5f160f1eb558dfd
MD5 d3439bd7d5ac9d1b85700937d5d694bd
BLAKE2b-256 ddb1e7cc4c0274844ac4eb4f63646b22f31fb6ec82721d00745753dd1f1ce62f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page