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

Please help me to solve this Python programming problem 2. For a

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!