Uploads a dataset from a pandas DataFrame.
Input Parameters | Type | Default | Description |
---|---|---|---|
project_id | str | None | The unique identifier for the project. |
dataset | dict | None | A dictionary mapping dataset slice names to pandas DataFrames. |
dataset_id | str | None | A unique identifier for the dataset. Must be a lowercase string between 2-30 characters containing only alphanumeric characters and underscores. Additionally, it must not start with a numeric character. |
info | Optional [fdl.DatasetInfo] | None | The Fiddler fdl.DatasetInfo() object used to describe the dataset. |
size_check_enabled | Optional [bool] | True | If True, will issue a warning when a dataset has a large number of rows. |
import pandas as pd
PROJECT_ID = 'example_project'
DATASET_ID = 'example_dataset'
df = pd.read_csv('example_dataset.csv')
dataset_info = fdl.DatasetInfo.from_dataframe(
df=df
)
client.upload_dataset(
project_id=PROJECT_ID,
dataset_id=DATASET_ID,
dataset={
'baseline': df
},
info=dataset_info
)
Return Type | Description |
---|---|
dict | A dictionary containing information about the uploaded dataset. |
{
'row_count': 10000,
'col_count': 20,
'log': [
'Importing dataset example_dataset',
'Creating table for example_dataset',
'Importing data file: baseline.csv'
]
}