[問題] Python reshape問題

作者: gecer (gecer)   2020-01-25 18:31:21
https://www.kaggle.com/halien/simple-image-classifer-with-svm
data_images = digits.images.reshape((n_samples, -1))
請問reshape 裡面 "-1" 是什麼意思?
作者: penut85420 (PenutGGorz)   2020-01-25 18:55:00
可以理解成自動判斷的意思例如原本a.shape=(2, 3, 4)則a.reshape(3, -1)=(3, 8)
作者: mike50378 (羊駝)   2020-01-26 13:57:00
那個項會自動填上整除的維度

Links booklink

Contact Us: admin [ a t ] ucptt.com