Question: The Boolean arrays and masks notebook discusses combining Boolean arrays with Boolean operators & ( conceptually 'and' ) and ( conceptually ' or ' )
The Boolean arrays and masks notebook discusses combining Boolean arrays with Boolean operators & conceptually 'and' and conceptually or and conceptually 'not' Study the examples there, especially the examples used on the Seattle rainfall data. Pay special attention to the use of parentheses, because using them correctly matters in solving the following problems.
Each of the following problems concerns finding a particular set of rows in the covertypes dataset. For each set do two things:
a Construct a single Python expression which counts the number of rows in the set. b Construct a single Python expression which returns all the rows of the covertype dataset that are in the set. Note: not just the Boolean array, but the rows you get when use the Boolean array as a mask
The rows in the covertype dataset which have a value greater than for attribute
The rows which have attribute Note: this is a qualitative soil attribute
The entire covertypes dataset excluding rows which belong either to covertype or covertype Note: you will have to use two arrays data.data and data.target
The rows which have attribute but do not have either covertype or covertype
The rows which are not in covertype or have a value greater than for attribute and have attribute
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
