Question: T 1 . For the following strings that each define a regular expression, explain why each will not match a : ,
T For the following strings that each define a regular expression, explain why each will not match a :
T What patterns will the regular expression match? Give an example of a character string that would match.
T Write a statement to convert all the backslashes in a string into forward slashes.
T Create a regular expression that will match telephone numbers in the format ### #######
T Describe the equivalents of and in m n form.
T Using the words vector from stringr, write regular expressions to find all the words that:
a Contain only consonants no vowels
b Have three or more vowels in a row
c End with ed but not eed
d Contain a repeated pair of letters egchurch contains ch twice
T Using the sentences vector from stringr, extract:
a All the words ending in ing.
b All the pronouns.
R Script
R Here top of next page is a view of the top portion of alcabuse.txt
a Import the data beginning in line of this file as a data frame.
b How many variables are recorded in the data in this file?
c How many observations of data are there?
d What percent of the participants in this data frame are married?
R Using the starwars dataset:
a Write a statement using a str function that will count the number of characters with more than one hair color listed.
b Split haircolor into two columns, one for each hair color listed the second column will be mostly missing
Python Script
P Import all the table objects from scores.html as a list of data frames.
a How many tables are there?
b Pull out the first data frame from the imported list and call it scores.
c Look at the Series scores.columns. Notice that every column name begins with Sort by Replace Sort by with in every element of scores.columns to remove that part in each column name.
d Use a combination of a string method and the sum method on the scores.Player series to find the number of players with a last name that starts with the letter R
e Create a column containing each players first name.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
