Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For my class I need to find the sepal length in the iris dataset that is between 4.5 and 6. exact specifications are Select the

For my class I need to find the sepal length in the iris dataset that is between 4.5 and 6. exact specifications are "Select the rows that that has sepal length greater than 4.5 but less than 6" the given code (which the answer should be in this form) is

subset=data[data['petal width (cm)']>2] what I have is:

subset=data[data[(['sepal length (cm)']>4.5 and ['sepal length (cm)']<6)]]

the main problem I am having is getting the syntax correct. in its current state, I get an error stating

TypeError: '>' not supported between instances of 'list' and 'float'

If it is changed to

subset=data[data[(data['petal width (cm)']>4.5 and data['petal width (cm)']<6)]]

I get the error

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

thank you

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

Step: 3

blur-text-image

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions