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
SOVA2 [1]
4 years ago
14

1i) Standardize 'weight' column Write a function named standardize_weight that takes in as input a string and returns an integer

. The function will do the following (in the order specified): 1) convert all characters of the string into lowercase 2) strip the string of all leading and trailing whitespace 3) replace any occurences of 'lbs' with '' (remove it from the string) 4) replace any occurences of 'lb' with '' (remove it from the string)
Computers and Technology
1 answer:
jeka57 [31]4 years ago
4 0

Answer:

import numpy as np

def standardize_weight(inp):

#1

inp=inp.lower()

print(inp)

#2

inp=inp.strip()

print(inp)

#3

inp=inp.replace("lbs"," ")

print(inp)

#4

inp=inp.replace("lb"," ")

print(inp)

#5

inp=inp.replace("pounds"," ")

print(inp)

 

print(inp.find("kg"))

#6

if(inp.find("kg")>=0):

inp=inp.replace("kg"," ")

print(inp)

inp_int=int(inp)

print(inp_int*2)

inp=str(inp_int)

print(inp)

#7

inp=inp.strip()

print(inp)

#8

if(inp.isdigit()):

inp=int(inp)

#9

else:

inp=np.nan

 

res=standardize_weight(" List albkg repLacleg sublkg " )

Explanation:

You might be interested in
You type a complex formula in cell A20. You would like to make the same calculation in cells B20 through H20. To be efficient, y
fomenos

Answer:

Use autofill

Explanation:

In excel "autofill" is used to fill data in cells, which follows the pattern or logic applied in other cells. To apply same calculation of A20 in B20 to H20, we use autofill technique. Instead of copy pasting, or manually entering the complex formula this method is more suitable.  

4 0
4 years ago
In this image, we are clicking a button on the Quick Access Toolbar. What will happen
Lostsunrise [7]

Answer: It’s B The presentation will start from the beginning

Explanation: I took the test

7 0
3 years ago
Given that Marcy worked 42 hours (Hours = 42) last week and earns $10.00 an hour (Rate = 10), how much did Marcy earn last week,
serg [7]

Answer: $420

Explanation: from the question above, mercy worked 42 hours at $10 an hour. Her total pay before tax is: 42 x 10 =

$420

5 0
4 years ago
Anybody plays mine craft
GuDViN [60]
Want to avoid giant mushrooms than stay away from dark oak and mooshroom biomes
5 0
3 years ago
Read 2 more answers
I really need To know how To get The special ending for final fight 2 for super nintendo it’s a video game
Bogdan [553]

Answer:

Check Yt

Explanation:

More often than not there are many video tutorials about every game imaginable.

5 0
3 years ago
Other questions:
  • What Is the output of the following: =OR (5 <7, 16*Rand ()>23,FALSE)
    5·1 answer
  • Evidence that Social media hasn’t improved human communication.
    12·1 answer
  • Which of these are examples of a Single Sign-On (SSO) service?
    5·1 answer
  • Sofia is reading a difficult text for class and worries that she won't complete it by the given deadline. How can a text-
    13·2 answers
  • Recall that through either photographic or computer technology, researchers can make a composite (or "averaged") face out of any
    11·1 answer
  • If you see ________________________ in a cell, it means the column is not wide enough to display the cell content. Select one: a
    15·1 answer
  • Gmod how to make someone admin on a lan server
    6·2 answers
  • How are satellite radio, Internet radio, and podcasting different?
    11·1 answer
  • Blending two or more colours is called​
    6·1 answer
  • Name any four areas where computers are used​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!