이 실패"assert 211 == 211"이 실패하는 이유는 무엇입니까?
train_data = pd.concat([train_cancelled, train_not_cancelled]).as_matrix()
mat_col_size = int((num_days * 3) + 1)
assert isinstance(mat_col_size, int), "mat_col_size is not an int"
assert isinstance(train_data.shape[1], int), "train_data.shape[1] is not an int"
assert train_data.shape[1] == mat_col_size, \
"Number of columns in train data must be 'num_fetaures + 1 = {0:d}' (label) but is '{0:1}'." \
.format(mat_col_size, train_data.shape[1])
그것은 인쇄됩니다 :
AssertionError: Number of columns in train data must be 'num_fetaures + 1 = 211' (label) but is '211'.
내 질문은 : 다른 일이 잘못하고 나는 단순히 문제 또는를 찾을 수 없기 때문에이 실패 할 수 있습니다 얼마나 많은 내 코드가 셋째가되지 않는 이유는 무엇입니까 assert
!
교육 데이터의 예를 게시 할 수 있습니까? 어쩌면 모든 열을 가지고 있지만 단지 몇 행만 – shadowtalker
일 것입니다. type (train_data.shape [1])의 출력을 보여줄 수 있습니까? 'int' 대신'numpy.int64' 타입을 가질 수도 있습니다. – shadowtalker
은 가치가 있습니다.'assert pd.DataFrame ([[1,2,3], [4,5,6]])으로 재현 할 수 없습니다. .as_matrix(). shape [1] == 3' – shadowtalker