Querying a Sample List
Obtain the sample list of a dataset. Table datasets are not supported.
dataset.list_samples(version_id=None, offset=None, limit=None)
Sample Code
- Example 1: Obtain a dataset sample list.
from modelarts.session import Session from modelarts.dataset import Dataset session = Session() dataset = Dataset(session, dataset_id) list_samples_resp = dataset.list_samples() print(list_samples_resp) # Print the sample list.
- Example 2: Obtain the sample list of a specified dataset version.
list_samples_resp = dataset.list_samples(version_id = "cSPuXPgnYp7ObRs6LaR") print(list_samples_resp)
Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
version_id |
No |
String |
Dataset version ID, which can be used for obtaining the sample list of this dataset version. |
offset |
No |
Integer |
Start page for pagination display. The default value is 0. |
limit |
No |
Integer |
Maximum number of records returned on each page. The value ranges from 1 to 100. The default value is 10. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot