Skip to content

Instantly share code, notes, and snippets.

@Svtter
Created September 5, 2018 03:00
Show Gist options
  • Save Svtter/b76de02b65a808d4345caffba904e87a to your computer and use it in GitHub Desktop.
Save Svtter/b76de02b65a808d4345caffba904e87a to your computer and use it in GitHub Desktop.
[shuffle data] shuffle the dataset when its ordered 打乱数据 #python #numpy
import numpy as np
# shuffle the data.
idx = np.random.permutation(len(x_all))
x_all, y_all = x_all[idx], y_all[idx]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment