Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started