Categories
Mastering Development

Fast way to remove array of specific row values from 2D numpy array

I have a 2D array like this: a = np.array([[25, 83, 18, 71], [75, 7, 0, 85], [25, 83, 18, 71], [25, 83, 18, 71], [75, 48, 8, 43], [ 7, 47, 96, 94], [ 7, 47, 96, 94], [56, 75, 50, 0], [19, 49, 92, 57], [52, 93, 58, 9]]) and I want to […]

Categories
Development

Incompatible shapes: [84,6] vs. [128,6]. Error at end of first epoch

This is the model that I built. Please do help me understand if the problem with my model or any other problem I am facing this issue. The error occurs after this: Train on 63828 samples, validate on 95743 samples Epoch 1/1 63744/63828 [============================>.] – ETA: 2s – loss: 0.3427 – acc: 0.9943 The error […]

Categories
Development

get two elements from list simultaneously

I am new to python and I want to iterate two elements from the same list simultaneously in fashion s-> (s0,s1)(s1,s2)(s2,s3)(s3,s4)…. I have tried using itertools but it is printing in following fashion s-> (s0,s1)(s2,s3)(s4,s5)…… How can I do it? def pairwise(iterable): a = iter(iterable) return itertools.zip_longest(a,a) for x,y in pairwise(combined): … Code which i […]

Categories
Development

get two elements from list simultaneously

I am new to python and I want to iterate two elements from the same list simultaneously in fashion s-> (s0,s1)(s1,s2)(s2,s3)(s3,s4)…. I have tried using itertools but it is printing in following fashion s-> (s0,s1)(s2,s3)(s4,s5)…… How can I do it? def pairwise(iterable): a = iter(iterable) return itertools.zip_longest(a,a) for x,y in pairwise(combined): … Code which i […]