1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
anzhelika [568]
2 years ago
8

Selecting missing puppies 1 # Select the dogs where Age is greater than 2 2 greater_than_2 = mpr [mpr. Age > 2] 3 print(great

er_than_2) Let's return to our DataFrame of missing puppies, which is loaded as mpr. Let's select a few different rows to learn more about the other missing dogs. 5 # Select the dogs whose Status is equal to Still Missing 6 still_missing = mpr[mpr. Status == 'Still Missing'] 7 print (still_missing) Instructions 100 XP • Select the dogs where Age is greater than 2. 9 # Select all dogs whose Dog Breed is not equal to Poodle 10 not-poodle = mpr [mpr.Dog Breed != 'Poodle'] 11 print(not_poodle) • Select the dogs whose Status is equal to Still Missing. • Select all dogs whose Dog Breed is not equal to Poodle. Run Code Submit Answer * Take Hint (-30 XP) IPython Shell Slides Incorrect Submission Did you correctly define the variable not_poodle ? Expected something different. # Select all dogs whose Dog Breed is not equal to Poodle not_poodle = mpr[mpr.Dog Breed != 'Poodle'] print(not_poodle) File "", line 10 not_poodle = mpr [mpr.Dog Breed != 'Poodle'] Did you find this feedback helpful? ✓ Yes x No SyntaxError: invalid syntax
Computers and Technology
1 answer:
anygoal [31]2 years ago
4 0

Answer:

# the dog dataframe has been loaded as mpr

# select the dogs where Age is greater than 2

greater_than_2 = mpr [mpr. age > 2]

print(greater_than_2)

# select the dogs whose status is equal to 'still missing'

still_missing = mpr[mpr. status == 'Still Missing']

print(still_missing)

# select all dogs whose dog breed is not equal to Poodle

not_poodle = mpr [mpr.breed != 'Poodle']

print(not_poodle)

Explanation:

The pandas dataframe is a tabular data structure that holds data in rows and columns like a spreadsheet. It is used for statistical data analysis and visualization.

The three program statements above use python conditional statements and operators to retrieve rows matching a given value or condition.

You might be interested in
Write a method that returns a version of the given array where all the 10's have been removed. The remaining elements should shi
Harlamova29_29 [7]

Answer:

The removeTens method is as follows

public static int[] removeTen(int[] nums) {

int [] arr = nums;

   int index = 0;

   while(index < arr.length && arr[index] != 10){

       index++;

   for(int j = index + 1; j < arr.length; j++) {

       if(arr[j] != 10) {

           arr[index] = arr[j];

           arr[j] = 10;

           index++;        }    }

   for( ; index < arr.length; index++){

       arr[index] = 0;}}

   return arr;

}

Explanation:

This defines the removeTens method; it receives array nums as its parameter

public static int[] removeTen(int[] nums) {

This creates and initializes a new array

int [] arr = nums;

This initializes index to 0

   int index = 0;

The following is repeated when array element is not 10 and if array index is still valid

   while(index < arr.length && arr[index] != 10){

This increments the index by 1

       index++;

This iterates through the array

   for(int j = index + 1; j < arr.length; j++) {

This checks if array element is not 10

       if(arr[j] != 10) {

If yes:

           arr[index] = arr[j];

The current array element is set to 10

           arr[j] = 10;

The index is incremented by 1        

  index++;        }    }

This iterates through the array again and move 0s to the back

   for( ; index < arr.length; index++){

       arr[index] = 0;}}

This returns the new array

  return arr;

}

8 0
2 years ago
Write a method that takes a RegularPolygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclus
monitta

Answer:

public static void randomize(RegularPolygon r){

   int side = (int)((20-10) * Math.random()) + 10;

   int length = (int)((12-5)  * Math.random()) + 5;

   // assuming the regularpolygon class has setSide and setLength methods.

   r.set.Side(side);

   r.setLength(length);

}

Explanation:

The randomize method is used to access and change the state of the RegularPolygon class attributes sides and length. The method accepts the class as an argument and assigns a random number of sides and length to the polygon object.

8 0
2 years ago
Which Command Prompt commands in Windows is used for listing a computer connections to shared resources
olganol [36]

Answer:

H=-17:927+79#8=8-_82”w

Explanation:

18:80:@=&’:(@0:*

4 0
3 years ago
A software process describes the interrelationship among the phases by expressing their order and frequency, but does not define
Angelina_Jolie [31]

Answer: False

Explanation:

 Yes, the given statement is false as, a software process basically describe the phases by express their frequency and order. But it is also define the products that are deliverable in the projects.

The phases in the software process basically describe the various steps and task which is necessary to make plans and schedules. Project deliverable also include project scheduling for determining the each phases.

5 0
3 years ago
What is the differnces between dark and middle ages of computer?​
noname [10]
The "middle ages" are anything between the collapse of Rome (400 AD) to its re-emergence in Rennaissance Italy (1400). Rennaissance means "rebirth". The "dark ages" are the period in the middle ages which were relatively undocumented. This would definitely include 400 AD to 700 AD, and some extend it to 900 AD.
3 0
3 years ago
Other questions:
  • A machine is classified as a compound machine if it?
    8·2 answers
  • Strong emotions can interfere with your ability to
    15·1 answer
  • True or False?
    8·1 answer
  • Ada lovelace designed the first computer
    7·1 answer
  • A port is the point at which a peripheral device attaches to or communicates with a computer or mobile device. True False
    15·1 answer
  • create a function that has an argument is the triple jump distance. It returns the estimate of vertical jump height. The world r
    8·1 answer
  • Which of the following statements is TRUE of a peer-to-peer network?
    10·1 answer
  • Who is the best nfl team in your mind
    14·2 answers
  • KELLY Connect
    8·1 answer
  • Data frames can be subset by a chosen value using ==.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!