Skip to content

messed up pip for python 2.7.16 and upgraded it to pip v 21.1.2

specs: macOs BigSur Iterm2 with ohmyzsh preinstalled with python2.7.16 & python 3.9.5 Problem : i upgraded pip without pyenv , so now both pip and pip3 refer to python 3.9.5 i made an alias for python 3.9.5 to be default in .zshrc file i also used pip to install flask Questions : Do i donwgrade pip for py…

Wrong Implementation of LinkedList

I am having trouble with the following code segment. I can’t really figure out why it doesn’t work, any help is appreciated. It’s a very very simple mistake that I do not understand: Prints 5 and it keeps printing 5 if you write u.next.next.next.val, what I want is u.val = 5 , u.next.val = 1…

Scraping etoro with python

I’m trying to use Selenium to automatically connect to my etoro account and get some figures from my portfolio. I work on Google Colab and from now, here is what I have: However, I have this error message I have tried to change and use find_element_by_class, by_xpath, etc but I couldn’t find how t…

Supplying varying number of input arguments for np.meshgrid

I have a function that uses np.meshgrid to get the matrix form of supplied co-ordinates. I have a parameter dim that determines what dimension I am working with and needs to return an array with dim dimension along axis 1. I have attached an MWE below. However my expected output is , which is obtained by repl…

Getting a single array containing several sub-arrays iteratively

I have a little question about python Numpy. What I want to do is the following: having two numpy arrays arr1 = [1,2,3] and arr2 = [3,4,5] I would like to obtain a new array arr3 = [[1,2,3],[3,4,5]], but in an iterative way. For a single instance, this is just obtained by typing arr3 = np.array([arr1,arr2]). …