Question: Please help me to solve this Python programming problem 2. For a given array like follows, use numpy or pandas to create a new array
Please help me to solve this Python programming problem

2. For a given array like follows, use numpy or pandas to create a new array as follows: a) If the number is less than 0, set it to -1. b) If the number is greater than or equal to 0, set it to 1. [[-1, 1, 2], [3, -2, -3], [0, 3,-1]] The result likes followed: [[-1, 1, 1],[1,-1,-1],[1, 1, -1]] (TIPS: You may use either "numpy.where or pandas.mask to realize.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
