Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

will give thumbs up directly after recieving answer. solve all parts of Q1 using python language Lab Objectives Introduction to Numpy library Create and deal

will give thumbs up directly after recieving answer.
solve all parts of Q1 using python language image text in transcribed
image text in transcribed
Lab Objectives Introduction to Numpy library Create and deal with 1D & 2D arrays. Transposing and reshaping a matrix. Lab Exercises Q1, PART 1: Consider the following df (copy paste the below code to get the df): df=pd.DataFrame([[80,90,85],[70,50,60), [89,87,82],[90,90,75]],columns=['Math','Physics', 'Arabic'),ind ex=['Ali','Sara', 'Taha','Ala']) (import pandas as pd import numpy as np ) Ali Math Physics Arabic 80 90 70 50 60 85 Sara Taha 89 87 82 Ala 90 90 75 A. Convert the given df to Numpy array. B. Using NumPy functions find the following: 1. The max mark of all results 2. The average (mean ) mark for every subject 3. The worst mark for every student 4. Add 2 marks for Arabic subject for all students 5. Using array slicing print the results for Sara and Ala for Math and Arabic courses 6. Add(Append) a new student marks with values Math: 95, Physics:99, Arabic:99 7. Change the shape of the array so that every column represents a student instead of a subject. (ie. Transpose ) 8. After the change, convert the array to Dataframe. PART 2: A. Define a function that compares two Numpy arrays and return True if arri has a greater average values than arr2. B. If we pass a list or numpy array to a function will it behaves as call by value or by reference. Note: Write and explain your answer as a comment. PART 3: Write a function means(arr) that receives a 2D Numpy array and returns two arrays: one includes the mean of each raw and one includes the mean for each column. Example of calling: ric=means(ar)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

5. Why is the job done?

Answered: 1 week ago

Question

LO5 Illustrate the steps in developing a base pay system.

Answered: 1 week ago

Question

LO3 Outline strategic compensation decisions.

Answered: 1 week ago