Closed
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
I wish I could use pandas to create TensorFlow datasets
Feature Description
Add a new method to_tf_dataset to DataFrame, specifying columns to use as features and labels.
def to_tf_dataset(feature_columns: list[str], label_column: str) -> tf.data.Dataset:
"""
Params:
feature_columns: list[str]: A list of columns to use as features for the dataset
label_column: The column to use as the label for the dataset. Numeric columns will be used as is. Non numeric columns will be converted to pd.Categorical
"""
Alternative Solutions
Manual conversion using tf.data.Dataset.from_tensor_slices
Additional Context
No response