Question

mport pandas as pd hardware = pd.Series([Hammer, Saw, Wrench]) Suppose, we wish to check if each element in hardware ha
0 0
Add a comment Improve this question Transcribed image text
Answer #1
import pandas as pd 
hardware = pd.Series(['Hammer', 'Saw', 'Wrench'])
res=hardware.str.contains (pat='e')#series.str.contains with parameter pat searches element with pattern given
print (res)# printing the result

Output with screenshot

Online Python Compiler. Code, Compile, Run and Debug python progra 5 Write your code in this editor and press Run button tooutput is at end

At 0 index and 2 index element of series 'e' is found so result is true

At element index 1 e is not found so false

Add a comment
Know the answer?
Add Answer to:
mport pandas as pd hardware = pd.Series(['Hammer', 'Saw', 'Wrench']) Suppose, we wish to check if each...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT