Skip to content

Instantly share code, notes, and snippets.

Last active Oct 1, 2020
What would you like to do?
Mount Dataset to Azure Machine Learning Compute Instance
import os
import pandas as pd
from azureml.core import Workspace, Dataset
# Connect to Workspace and reference Dataset
ws = Workspace.from_config()
dataset = ws.datasets["german-credit-train-tutorial"]
# Create mountcontext and mount the dataset
mount_ctx = dataset.mount()
# Get the mount point
dataset_mount_folder = mount_ctx.mount_point
# List the files in the mount point
files = os.listdir(dataset_mount_folder)
# Read some data
df = pd.read_csv(os.path.join(dataset_mount_folder, 'german_credit_data.csv'))
# Do some more stuff with the data....
# Unmount the dataset from the instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment