Reading dataset after uploading to storage

Nhuc Dang - Feeney Brothers 1 Reputation point
2022-04-18T17:07:49.787+00:00

hi,

I created various datasets but within my python notebook, how do i read it?

So currently if this is what I have:

x_train_df = pd.read_csv('data_reviews/x_train.csv')

what should I replace it with?

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,334 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GiftA-MSFT 11,176 Reputation points
    2022-04-19T13:17:17.23+00:00

    Hi, thanks for reaching out. I assume you registered a datastore and uploaded datasets to storage. To access the data from storage depends on whether it's structured or unstructured. For unstructured data you can access using FileDataset and for structured data you can access using TabularDataset. The following code snippet shows how to create dataset from datastore. For FileDataset, review Mount vs Download and sample notebook.

    from azureml.core import Workspace, Datastore, Dataset  
      
    datastore_name = 'your datastore name'  
      
    # get existing workspace  
    workspace = Workspace.from_config()  
          
    # retrieve an existing datastore in the workspace by name  
    datastore = Datastore.get(workspace, datastore_name)  
      
    # create a TabularDataset from 3 file paths in datastore  
    datastore_paths = [(datastore, 'weather/2018/11.csv'),  
                       (datastore, 'weather/2018/12.csv'),  
                       (datastore, 'weather/2019/*.csv')]  
      
    weather_ds = Dataset.Tabular.from_delimited_files(path=datastore_paths)  
    

    --please don't forget to Accept Answer if the reply is helpful. Thanks.--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.