Babarrun

2

votes
3

answer
22

views

Python - Comparing 2 identical strings returns 'False'

When I compare these 2 strings, the value I get is False. a = 'comentar' b = '️comentar' print(a == b) # False How could I fix this? I have tried changing the encoding of both strings but it does not have any effect. You can try it here: https://onlinegdb.com/HJ8xYLPq4
Babarrun
1

votes
1

answer
0

views

Numpy modify multiple values 2D array using slicing

I want to change some values in a numpy 2D array, based on the values of another array. The rows of the submatrix are selected using boolean slicing and the columns are selected by using integer slicing. Here is some example code: import numpy as np a = np.array([ [0, 0, 1, 0, 0], [1, 1, 1, 0, 1], [...
Babarrun