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
Luda [366]
2 years ago
8

Create a new data frame, first_south, by subsetting titanic to include instances where a passenger is in the first class cabin (

pclass column is 1) and boarded from Southampton (embarked column is S).
Computers and Technology
1 answer:
Virty [35]2 years ago
4 0

The data frame first_south is created using first_south = (titanic['Pclass']==1) & (titanic['Embarked']=='S')

<h3>How to create the data frame?</h3>

To do this, we make the following assumptions:

  • The pandas module has been loaded as pd
  • The dataset has also been loaded as titanic

When pclass column is 1.

This is represented as:

titanic['pclass']==1

When the passenger boards from Southampton.

This is represented as:

titanic['Embarked']=='S'

So, we have:

first_south = (titanic['Pclass']==1) & (titanic['Embarked']=='S')

Read more about data frames at:

brainly.com/question/16524297

#SPJ1

You might be interested in
It is possible to collaborate on a presentation with a group of people using the Internet.
DerKrebs [107]

Answer:

True

Explanation:

4 0
3 years ago
What is the binary number for 5?
Softa [21]

Answer:

the binary code for "5" is 00000101

8 0
2 years ago
Write a program that reads numbers from the user until a blank line is entered. Your
ddd [48]

Answer:

nums = []

while True:

   in = input()

   if in:

       nums.append(in)

   else:

       break

if nums:

   avg = sum(nums) / len(nums)

   for i in range(len(nums)):

       if nums[i] == avg:

           print(f"index: {i+1}")

           print(nums[i])

else:

   print(-1)  # if there aren't any values in nums

Explanation:

Assuming that you are coding in Python 3x. The last 'else' statement is an edge case that you might want to consider, I don't know what you want to put there, but I'm just going to leave it as -1.

5 0
2 years ago
Write a function called min that returns the minimum of the two numbers passed in as parameters.
Kitty [74]

def min(x,y):

   smallest = x

   if y < smallest:

       smallest = y

   return smallest

x = min(2,1)

print("The min is "+str(x))

Although I wouldn't recommend using the name min for a function because min is the name of an existing function. Best of luck.

4 0
3 years ago
EEEEEEEEEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIII
OLEGan [10]

Explanation:

hagshshshshshshshvcvgafffffrfggggggggggggcbbbbbbbbbbbbbbccccccccccccbhhhhhhhhh

6 0
3 years ago
Read 2 more answers
Other questions:
  • ? Create a home page that introduces the rental car company. the page should have a header and footer. in the document body, it
    7·1 answer
  • What should every Software Engineer know about Software Architecture?
    6·1 answer
  • Pamela finds that she is constantly spelling the word “color” as “colour” when she is typing. Even though this is how the word i
    11·1 answer
  • Which of the following statements is true?
    9·1 answer
  • Who knows a website that can connect videos in your phone
    8·1 answer
  • As a general rule, what is the size of a brochure?
    11·1 answer
  • Which of the following are valid calls to Math.max? 1. Math.max(1,4) 2. Math.max(2.3, 5) 3. Math.max(1, 3, 5, 7) 4. Math.max(-1.
    9·1 answer
  • Use the drop-down menu to complete the steps for using the Goal Seek feature.
    13·2 answers
  • What is one problem caused by spending too much time studying at your computer? A. It increases stress and negatively affects yo
    8·1 answer
  • TASK 1. JUMBLE ME! Direction: Arrange the jumbled letters to form a word. 1. PEREAM 2. RRENT CU 3. METREMO H 4. TORSISER 5. TANC
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!