Skip to content

Commit 75c3e39

Browse files
committed
revision to access data section
1 parent dc09ca5 commit 75c3e39

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

articles/machine-learning/tutorial-explore-data.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ except:
153153
print(f"Data asset created. Name: {my_data.name}, version: {my_data.version}")
154154
```
155155
156-
To examine the uploaded data, select **Data** on the left. The data is uploaded and a data asset is created:
156+
To examine the uploaded data, select **Data** in the **Assets** section of the left-hand navigation menu. The data is uploaded and a data asset is created:
157157
158158
:::image type="content" source="media/tutorial-explore-data/access-and-explore-data.png" alt-text="Screenshot shows the data in studio.":::
159159
@@ -173,17 +173,24 @@ An Azure Machine Learning datastore is a *reference* to an *existing* storage ac
173173
174174
## Access your data in a notebook
175175
176-
Pandas directly supports URIs. This example shows how to read a CSV file from an Azure Machine Learning datastore:
176+
You want to create data assets for frequently accessed data. You can access the data using the URI as shown below. However, as mentioned previously, it can become difficult to remember these URIs. Additionally, you still need to substitute the datastore name, folder, and filename values for your specific resources.
177+
178+
This example shows how to read a CSV file from an Azure Machine Learning datastore using the same configuration values from your `ml_client`:
177179
178180
```python
179181
import pandas as pd
180182
181-
df = pd.read_csv("azureml://subscriptions/<subid>/resourcegroups/<rgname>/workspaces/<workspace_name>/datastores/<datastore_name>/paths/<folder>/<filename>.csv")
182-
```
183+
# Using the same values from ml_client configuration
184+
subscription_id = ml_client.subscription_id
185+
resource_group = ml_client.resource_group_name
186+
workspace_name = ml_client.workspace_name
183187
184-
However, as mentioned previously, it can become difficult to remember these URIs. Additionally, you must manually substitute all **<_substring_>** values in the **pd.read_csv** command with the real values for your resources.
188+
# Construct the datastore URI
189+
datastore_uri = f"azureml://subscriptions/{subscription_id}/resourcegroups/{resource_group}/workspaces/{workspace_name}/datastores/<datastore_name>/paths/<folder>/<filename>.csv"
190+
df = pd.read_csv(datastore_uri)
191+
```
185192
186-
You want to create data assets for frequently accessed data. Here's an easier way to access the CSV file in Pandas:
193+
An alternative is to use the `azureml-fsspec` library, which provides a file system interface for Azure Machine Learning datastores. Here's an easier way to access the CSV file in Pandas:
187194
188195
> [!IMPORTANT]
189196
> In a notebook cell, execute this code to install the `azureml-fsspec` Python library in your Jupyter kernel:

0 commit comments

Comments
 (0)