Course Hero Logo

Out for delivery 02132020 710 am berkeley ca 94704

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 10 - 14 out of 24 pages.

Out for Delivery, 02/13/2020, 7:10 am, BERKELEY, CA 94704Arrived at Post Office, February 12, 2020, 6:29 pm,BERKELEY, CA 94710USPS in possession of item, February 12, 2020, 2:22 pm,BERKELEY, CA 94710Arrived Shipping Partner Facility, USPS Awaiting Item,February 11, 2020, 11:02 pm, UNION CITY, CA 94587Departed Shipping Partner Facility, USPS Awaiting Item,February 10, 2020, 8:39 pm, AVENEL, NJ 07001Arrived Shipping Partner Facility, USPS Awaiting Item,February 10, 2020, 7:03 pm, AVENEL, NJ 07001(a) [4 Pts] Assume that there are only new lines after each status update. That is, there areonly 7 lines in the above text. Write a regular expression to extract the state abbrevi-ation from each update. Assume the abbreviation is any two-letter string immediatelypreceding the ZIP code. Your regex should be able to extract the abbreviation for anystate.Given your regex, the following code should run appropriately:import repattern = ...for line in lines:print(re.findall(pattern, line))[’CA’][’CA’][’CA’][’CA’][’CA’][’NJ’][’NJ’]Write your regex below:r’_______________________________________’
Data 100Page 11 of 24Initials:Solution:
(b) [2 Pts] Suppose we want to extract the date and time from the status updates above, thenconvert to Pacific Standard Time (PST). What qualities of the data make this a difficulttask? Select all that apply.
Data 100Page 12 of 24Initials:The SQL to the Problem [10 Pts]9. Here, we have two tables. ThecourseStafftable contains a row for every individual onSummer 2021 TikTok Studies 101 course staff.Specifically,nameis the name of the student, as a str.sidis a student’s ID number, as an int.roleis the student’s position they hold on staff, as a str.reportsTois the sid of the courseStaff member that the student reports to, as an int.gradeReceivedis the grade the student received when they took TikTok Studies 101,as an int.semesterTookis the semester the student took the course, as a str.Theproftable consists of all previous offerings of TikTok Studies 101 along with thatsemester’ssingular lead professor.Specifically,nameis the name of the professor, as a str.semesterTaughtis the semester that professor taught TikTok Studies 101, as a str.avgGradeGivenis the average grade given to students, as a str.rateMyProfessorRatingis the average professor rating, as an int.Provided are the first few rows of each table. Note that each table shows a random subset ofthe data it holds. Assume there are no missing values in either table.
Data 100Page 13 of 24Initials:(a) [1 Pt] Which column(s) can be considered a primary key for thecourseStafftableabove? Assume there are no two individuals on course staff with the same name. Selectall that apply.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 24 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
brill
Tags
Isaac

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture