A library for saving embeddings for pandas dataframes
Project description
tensorwich
Tensorwich is a python package for saving and loading embedding data for pandas dataframe columns as a compact binary format
Features
- Save and load embedding data for pandas dataframe columns as a compact binary format that accompanies the saved csv file
Installation
pip install tensorwich
Usage
import tensorwich as tw
import pandas as pd
# load a df from a csv file and wrap it in a tensorwich
df = pd.read_csv("examples/example_df.csv")
tdf = tw.tensorwich(df)
# add the embedding to the tensorwich/df by using a custom function that generates embeddings
# in this case, we are using the "get_embeddings" function to generate embeddings from the Description column
# of the df
tdf.add_embedding('short_desc_embedding', get_embeddings(tdf.df['Description'].tolist()))
# save the df and related tensors to disk
tdf.save("examples/example_df_with_embeddings.csv")
# load the related tensors from disk
result = tw.tensorwich.load("examples/example_df_with_embeddings.csv")
License
This project is licensed under the MIT License - see the LICENSE file for details
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
tensorwich-0.1.1.tar.gz
(4.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tensorwich-0.1.1.tar.gz.
File metadata
- Download URL: tensorwich-0.1.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
607526e2bff5289f826457c7494f61ab81796320379776b3c65b2508f93d22b2
|
|
| MD5 |
8d0fae80c8dd03734c8257d86a4a8fa9
|
|
| BLAKE2b-256 |
895a1f14a7686e0ab6aff1844b1367703d537b1f40535b622f8a1e2cc31f520d
|
File details
Details for the file tensorwich-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tensorwich-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6c5f76e1e53c14c79770f8c197d3e0082bcd2fe5a7df5215eb7652788be335f
|
|
| MD5 |
dc726de0491748041509e5ba7f46fed1
|
|
| BLAKE2b-256 |
f8db9db3e21880e1af56d6b9b3c2b9b79c022a5f115b9c8f9b496a691c5fb0ec
|