Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with second part of lab. Not sure how to get column and create a vector. 1.1 Load data with pandas In [40]; import

image text in transcribed

image text in transcribedNeed help with second part of lab. Not sure how to get column and create a vector.

1.1 Load data with pandas In [40]; import numpy as np import pandas as pd # load data with pandas df = pd. read_csv('cars.csv') # print(df) # convert a pandas dataframe to a numpy array X = df.values[:, 1:-1] print(type (X)) print(X.shape) print(x) (406, 7) [[18.0 8 307.0 3504 12.0 70 ] [15.0 8 350.0 3693 11.5 70] [18.0 8 318.0 3436 11.0 70] [32.0 4 135.0 2295 11.6 82] [28.0 4 120.0 2625 18.6 82] [31.0 4 119.0 ... 2720 19.4 82]] 1.2 Operation for vector In [29]: #Get first row and the second to last row x1 = X[0, :] x2 = X(-2, :] print(x1) print(x2) # Addition y = x1 + x2 print(y) [18.0 8 307.0 130 3504 12.0 70] [28.0 4 120.0 79 2625 18.6 82] [ 46.0 12 427.0 209 6129 30.6 152] 2.1 Get the first column and the second to last column from X In [36]: # this is your code to get two vectors

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

More Books

Students also viewed these Databases questions

Question

How should the auditor evaluate the evidence?

Answered: 1 week ago

Question

Explain the concept of shear force and bending moment in beams.

Answered: 1 week ago