Question: The file Question is a question about NLP Regular Expression. The code should follow the step as in the file Input and should have the
The file "Question" is a question about NLP Regular Expression. The code should follow the step as in the file "Input" and should have the outcome as in the file "Output". It requires to use the function "re.findall".



\f\fSuppose you have scraped the text shown below from an online source. Define function extract (text) which: . takes a piece of text (in the format of shown below) as an input . extracts data into a list of tuples using regular expression, e.g. [('Consumer Price Index', '+0.2%', 'Sep 2020'), ...] . returns the list of tuples In [129]: text=' ''Consumer Price Index: +0. 2: in Sep 2020 Unemployment Rate: +7.9% in Sep 2020 Producer Price Index: +0. 4% in Sep 2020 Employment Cost Index: +0.5% in 2nd Qtr of 2020 Productivity : +10.18 in 2nd Qtr of 2020 Import Price Index: +0.3% in Sep 2020 Export Price Index: +0. 6% in Sep 2020' ''
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
