复习的时候看到了多做了一步
import numpy as np
import pandas as pd
import random
df = np.arange(0, 100, 5)
print(random.shuffle(df))
df = df.reshape(4, 5)
print(df)
df = df.reshape(-1, )
print(df)
df.sort()
print(df)
df = df.reshape(4, 5)
print(df)
np.random.shuffle(df)
print(df)
None
[[25 10 60 50 75]
[35 90 0 80 85]
[40 70 65 55 15]
[ 5 20 45 30 95]]
[25 10 60 50 75 35 90 0 80 85 40 70 65 55 15 5 20 45 30 95]
[ 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95]
[[ 0 5 10 15 20]
[25 30 35 40 45]
[50 55 60 65 70]