Question: In mathematics, sign function ( or signum function ) is a function that returns the sign of a real number. In mathematical notation the sign

In mathematics, sign function (or signum function) is a function that returns the sign of a real number. In
mathematical notation the sign function is often represented as sgn.
sgn(x)={-1,x00,x=01,x>0
Now suppose we have a matrix stored in a ""*.csv" file as in the following example. When we apply the signum
function to each cell of the matrix, we create another matrix that is called a signum matrix.
(15p) Write a Python program in a single script file that reads such a matrix from a "data.csv" file and creates
another file named "datasgn.csv" in the same folder which contains the associated signum matrix. In your
program, you should create a function called create_sgn_file() that takes a single argument; the name of the
data file. When you call:
create_sgn_file("mydata.csv")
"mydata.csv" file that is stored in the same folder as of your program should be read and "mydata_sgn.csv" file
should automatically be created in the same folder. In the function body, you should be using tools provided by
"Pandas" package. You can test your program using the "mydata.csv" file given with this homework assignment.
 In mathematics, sign function (or signum function) is a function that

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!