question

NhucDang-0145 avatar image
0 Votes"
NhucDang-0145 asked NhucDang-0145 commented

Reading dataset after uploading to storage

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
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, can you clarify if this is related to Azure ML Notebooks or local Jupyter Notebook? What storage are you trying to read the dataset from?

0 Votes 0 ·

This is Azure ML Notebooks ( I imported my local jupyter in). The storage is uploaded via dataset, it is in the datastore now in the UI directory.

0 Votes 0 ·

1 Answer

GiftA-MSFT avatar image
0 Votes"
GiftA-MSFT answered NhucDang-0145 commented

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.--

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi ,

This is what I see.
194442-picture1.png


0 Votes 0 ·
picture1.png (178.8 KiB)