Instead of fetching each data row, compiling a list, and measuring the length, we can quickly find out the number of data rows in a dataset on Labelbox by utilizing the row_count
field.
Code
# Grab the dataset
dataset = client.get_dataset("<DATASET_ID>")
# Print the count of data rows
print(dataset.row_count)