provide a python script please For the following vectors and matrices, using the NumPy library, write...
Question 1 a. Define the following matrices in a script file (M-file), ? = ( 8 9 10 11; 23 9 16 15 ;11 12 3 6; 1 2 8 9 ) ? = ( 2 21 7 15; 12 4 8 22; 23 9 5 13; 23 4 21 22) ℎ = (4 9 12 15) b. Add suitable lines of codes to the M-file to do the following. Each of the following points should be coded in only...
IN PYTHON: Write a function that computes the outer product of
two vectors WITHOUT using numpy / inbuilt functions.
For example, the outer product of [1,2,3] x [1,2] is
outer product 2 1 2 3 2 4 6 2
outer product 2 1 2 3 2 4 6 2
Question 8 Data Structures - arrays, matrices and strings (a) Write a MATLAB script that will copy all of the negative values in a matrix,M, to a new vector, N.[7 marks] (b) Write a MATLAB script that reads in two strings from the user and comparesthem, printing’same’if they are the same or the indexes of the characterswhich differ if they are different. For example, if the user typed in ’car’and ’cat’, the script would print ’the words differ in characters:...
Task 4 Write a script that will print the following table using 2 loops (either for or while) 24 3 6 9 4 8 12 16 5 10 15 20 25
Write a script that uses four separate for loops to output the following: 1 2 3 4 5 6 7 8 2 4 6 8 10 12 14 16 3 6 9 12 15 18 21 24 10 9 8 7 6 5 4 3 2 1 complete in python3
do it in python 1. Import the proper libraries: Pandas and NumPy and create aliases pd, np respectively. 2. Load sample data (car_loan.csv) into data frame: df 3. Export Pandas DataFrames to csv. Save file name as out.csv. hint: help(df.to_csv) 4. Run the command: df.info (). What do you see, how many columns? also what about number of entries for each column 5. It is often the case where you change your column names or remove unnecessary columns. a. Change...
Part 1: Using Idle Write a Python Script that Does the Following 1. At the top of your program, import the math library as in from math import * to make the functions in the math module available. Create a variable and assign into it a constant positive integer number of your choice. The number should be at most 10. 1 Suppose we call this variable x for this writeup document Try something like x = 4 2. Create another...
Write a script file that will compare entries in vector V to entries in vector M and determine how many entries in V are greater than the same entry in M, equal to the same entry in M, and less than the same entry in M. For example, V(1) is 7 and M(1) is 6, thus for this entry, V is greater than M. V = [7 9 -8 9 3 -8 -5 1 10 10 0 -7] M =...
1. Create a Python script file called Assignment_Ch06-02_yourLastName.py. (Replace yourLastName with your last name.) 2. Write a Python program that prompts the user for a sentence, then replaces all the vowels in the sentence with an asterisk: '*' Your program should use/call your isVowel function from Assignment_Ch06-01. You can put the isVowel() function in a separate .py file, without the rest of the Ch06-01 code, and then import it. 6-01 CODE: def isVowel(x): if x in "aeiouyAEIOUY": return True else:...
(In Linux) 1. Create a file to write to from your script and save it as “.txt”. 2. Write the following information to the file that you created in Step 1: Today's date Your full name Your student ID The name of your course What directory you are in File permissions of the file that you created that allow everyone to read, write, and execute The long list of files in your current directory, providing all items and their process...