Skip to content

Commit 02c6582

Browse files
authored
Update how-to-access-data-interactive.md
1 parent 8b42830 commit 02c6582

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

articles/machine-learning/how-to-access-data-interactive.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ from azureml.fsspec import AzureMachineLearningFileSystem
9696
# instantiate file system using following URI
9797
fs = AzureMachineLearningFileSystem('azureml://subscriptions/<subid>/resourcegroups/<rgname>/workspaces/<workspace_name>/datastore/datastorename')
9898

99-
fs.ls() # list folders/files in datastore datastorename
99+
fs.ls() # list folders/files in datastore 'datastorename'
100100

101101
# output example:
102102
# folder1
@@ -122,6 +122,8 @@ fs.upload(lpath='data/upload_files/crime-spring.csv', rpath='data/fsspec', recur
122122
# you need to specify recursive as True to upload a folder
123123
fs.upload(lpath='data/upload_folder/', rpath='data/fsspec_folder', recursive=True, **{'overwrite': MERGE_WITH_OVERWRITE})
124124
```
125+
`lpath` is the local path, and `rpath` is the remote path.
126+
If the folders you specify in `rpath` do not exist yet, we will create the folders for you.
125127

126128
We support 3 modes for 'overwrite':
127129
- APPEND: if there is already a file with the same name in the destination path, will keep the original file
@@ -131,7 +133,7 @@ We support 3 modes for 'overwrite':
131133
### Download files via AzureMachineLearningFileSystem
132134
```python
133135
# you can specify recursive as False to download a file
134-
# downloading overwrite option is set to be MERGE_WITH_OVERWRITE
136+
# downloading overwrite option is determined by local system, and it is MERGE_WITH_OVERWRITE
135137
fs.download(rpath='data/fsspec/crime-spring.csv', lpath='data/download_files/, recursive=False)
136138

137139
# you need to specify recursive as True to download a folder
@@ -207,7 +209,7 @@ fs = AzureMachineLearningFileSystem(uri)
207209

208210
# append csv files in folder to a list
209211
dflist = []
210-
for path in fs.ls('/<folder>/*.parquet'):
212+
for path in fs.glob('/<folder>/*.parquet'):
211213
with fs.open(path) as f:
212214
dflist.append(pd.read_parquet(f))
213215

0 commit comments

Comments
 (0)