Question: T 1 . For the following strings that each define a regular expression, explain why each will not match a : ,

T1. For the following strings that each define a regular expression, explain why each will not match a \: \,\\,\\\
T2. What patterns will the regular expression \..\..\.. match? Give an example of a character string that would match.
T3. Write a statement to convert all the backslashes in a string into forward slashes.
T4. Create a regular expression that will match telephone numbers in the format (###) ###-#### .
T5. Describe the equivalents of ?,+, and * in {m, n} form.
T6. 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 (e.g.,church contains ch twice)
T7. Using the sentences vector from stringr, extract:
a. All the words ending in ing.
b. All the pronouns.
R Script-
R1. Here (top of next page) is a view of the top portion of alc_abuse.txt.
a. Import the data beginning in line 19 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?
R2. 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 hair_color into two columns, one for each hair color listed (the second column will be mostly missing).
Python Script-
P1. 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!