Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Python Write function to create a Pandas DataFrame, 'Employee', whose columns are 'Name', 'Year' and 'Department'. The function should extract the data from the

In Python Write function to create a Pandas DataFrame, 'Employee', whose columns are 'Name', 'Year' and 'Department'. The function should extract the data from the following text:

txt=" - Bob has been working for IT department for 1 year. - Sam has been working for Trade department for 3 years. ........ ........ - Jerilyn has been working for HR department for 8 years. - Elois has been working for IT department for 2 years. - Matha has been working for Trade department for 2 years."

Hint: Try to use str.split and list comprehension. import pandas as pd txt='''- Bob has been working for IT department for 1 year. - Sam has been working for Trade department for 3 years. - Peter has been working for HR department for 8 years. - Mike has been working for IT department for 2 years. - Sarah has been working for Trade department for 2 years. - Sali has been working for IT department for 7 years. - Tim has been working for IT department for 12 years. - Maya has been working for HR department for 10 years. - Susan has been working for IT department for 7 years. - Kati has been working for IT department for 11 years. - Robert has been working for Trade department for 9 years. - Shahd has been working for Trade department for 2 years. - Ema has been working for IT department for 7 years. - Hala has been working for HR department for 12 years. - Joe has been working for HR department for 18 years. - Ali has been working for HR department for 4 years. - Nader has been working for IT department for 15 years. - Kim has been working for Trade department for 5 years. - Bilal has been working for Trade department for 2 years. - Albert has been working for IT department for 7 years. - Hind has been working for Trade department for 12 years. - Alberto has been working for HR department for 10 years. - Yashar has been working for HR department for 4 years. - Kumar has been working for Trade department for 13 years. - Taha has been working for Trade department for 5 years. - Damon has been working for HR department for 12 years. - Brandon has been working for HR department for 18 years. - Ali has been working for HR department for 4 years. - Jaclyn has been working for IT department for 15 years. - Vita has been working for Trade department for 5 years. - Lisa has been working for Trade department for 2 years. - Alice has been working for IT department for 3 years. - Lyndsey has been working for HR department for 12 years. - Samanth has been working for HR department for 10 years. - Roula has been working for HR department for 14 years. - Georgene has been working for Trade department for 11 years. - Reem has been working for HR department for 15 years. - Jerilyn has been working for HR department for 8 years. - Elois has been working for IT department for 2 years. - Matha has been working for Trade department for 2 years.'''

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

How objective is the traditional HC balance sheet?

Answered: 1 week ago

Question

Prepare a short profile of Henry words worth Longfellow?

Answered: 1 week ago

Question

What is RAM as far as telecommunication is concerned?

Answered: 1 week ago

Question

Question 1: What is reproductive system? Question 2: What is Semen?

Answered: 1 week ago

Question

Describe the sources of long term financing.

Answered: 1 week ago