While registering a dataframe in AzureML pipeline, getting error: 'DataFrame' object has no attribute 'register. How do we actually store dataframe into Azure Blob Storage?

Jitender Kumar Chandel 1 Reputation point
2021-06-23T07:06:13.167+00:00

While registering a dataframe in AzureML pipeline, getting error: 'DataFrame' object has no attribute 'register. How do we actually store dataframe into Azure Blob Storage?

Code snippet-

<DataFrame>.register(workspace=ws, name='<abc>', description='<abc>', tags = {'format':'CSV'}, create_new_version=True)

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,571 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,436 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 42,206 Reputation points Microsoft Employee
    2021-06-23T10:48:47.457+00:00

    @Jitender Kumar Chandel I think this is a valid error since the dataset cannot be registered with the above command. You should try the steps mentioned in this notebook.

    These steps should help to register your CSV data as dataframe.

    datastore = ws.get_default_datastore()  
    datastore.upload_files(files = ['./train-dataset/iris.csv'],  
                           target_path = 'train-dataset/tabular/',  
                           overwrite = True,  
                           show_progress = True)  
      
    from azureml.core import Dataset  
    dataset = Dataset.Tabular.from_delimited_files(path = [(datastore, 'train-dataset/tabular/iris.csv')])  
      
    # preview the first 3 rows of the dataset  
    dataset.take(3).to_pandas_dataframe()  
    

    Please feel free to accept the above response as answer if it helped. Thanks.

    0 comments No comments