Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Suppoce we're given numpy arrays of names and scores, where each row in the scores array lists the midterm and final scores for that respective student. For example, Carol has a 75 on the midterm and 99 on the final.
names = np. array([ "Alice" "Bob". "Carol","Derek ","Erin"])
Scores = np.array([ [95, 98], [82, 88],
[75, 99],
[80, 90],
85, 82 ]])
Write function avgMidtermNoC that takes ve parameters names and score arrays, and returns the average score on the midterm, exduding anyone who's name starta with C.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Prompt: In Python language, write a function that applies the logistic sigmoid function to all elements of a NumPy array. Code: import numpy as np import math import matplotlib.pyplot as plt import pandas as pd def sigmoid(inputArray): modifiedArray = np.zeros(len(inputArray)) #YOUR CODE HERE: return(modifiedArray) def test(): inputs = np.arange(-100, 100, 0.5) outputs = sigmoid(inputs) plt.figure(1) plt.plot(inputs) plt.title('Input') plt.xlabel('Index') plt.ylabel('Value') plt.show() plt.figure(2) plt.plot(outputs,'Black') plt.title('Output') plt.xlabel('Index') plt.ylabel('Value') plt.show() test()arrow_forwardthis is insturction Write a program which prompts the user to enter up to 15 floating point numbers (terminated with a non-numeric), reads them into an array, then prints the following. The program must use an array (not a vector) to get credit. The array values in the original order, separated by commas, with no trailing comma at the last value. The array values where the order of each adjacent pair of elements is swapped, separated by commas (NOT every element swapped with its next neighbor, which would just move the first element to the end, but every original pair swapped only in that pair. For an odd element count, the last element should not change. See examples below.) The smallest number in the array. Example program outputs with user input shown in bold font: Enter up to 15 numbers, and a non-numeric to quit: 1 0 -1.001 # Original array: 1, 0, -1.001 The swapped array: 0, 1, -1.001 Smallest number: -1.001 Enter up to 15 numbers, and a non-numeric to quit: 1 0 -1.001 5 ,…arrow_forwardDefine the array printed below using the np.array() function, and assign it to the variable 'my_array' (only one line of code needed). [[0, 2, 4],[9, -6, 5],[0, 0, -10]]arrow_forward
- In [ ]: We obtained an array with N = 10 values, scattered about mean of 25 (mm). Let's calculate the mean, standard deviation, standard deviation of the mean and 20-uncertainty SL of these numbers. In the following code, do these steps: • In the first cell, add a brief comment that explains what each statement does. Start each comment with a # sign. • In the second cell, delete the raise Not ImplementedError() code line and print the standard deviation and 20-uncertainty on the screen (follow the example for mean_L) mean_L = np.mean (L) print("Mean length: ", mean_L) stddev_L = np. std (L, ddof=1) stddev_mean_L = stddev_L/np.sqrt(N) uncertainty_L = 2*stddev_mean_L In [ ] V #YOUR CODE HERE raise NotImplementedError() #calculates the mean of L In the above code, the green expressions on the right hand side, such as np.mean, np. std and np.sqrt are functions built into the numpy package of Python. The names on the left hand side are variable names invented by me.arrow_forwardNote: Set a random seed of 100 for this assignment. All arrays should contain random numbers between 0 and 1 (zero is inclusive). Create a one-dimensional array of twenty float random numbers. Assign the sum of these values to Q1. Assign the max of these values to Q2. Create a four by five array of random numbers. Take the minimum values in each array and create an array of those values. Assign it to Q3. Assign the mean of all the array values to Q4. Create an array with the following values: 2, 3, np.nan (this should represent a missing value), and 5. Use a numpy function to find the sum of the values in this array. Assign the sum to Q5 (you should expect a numerical value here). Create two separate arrays each containing four random numbers. Concatenate the two arrays and assign it to Q6. Create a four by four array of random numbers and call it q7. Concatenate this array with itself and assign it to Q7. Create a two by four array of…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education