subject

In Python!! 1. Correcting string errors
It's easy to make errors when you're trying to type strings quickly.
Don't forget to use quotes! Without quotes, you'll get a name error.
owner = DataCamp
Use the same type of quotation mark. If you start with a single quote, and end with a double quote, you'll get a syntax error.
fur_color = "blonde'
Someone at the police station made an error when filling out the final lines of Bayes' Missing Puppy Report. In this exercise, you will correct the errors.
# One or more of the following lines contains an error
# Correct it so that it runs without producing syntax errors
birthday = "2017-07-14'
case_id = 'DATACAMP!123-456?
2. Load a DataFrame
A ransom note was left at the scene of Bayes' kidnapping. Eventually, we'll want to analyze the frequency with which each letter occurs in the note, to help us identify the kidnapper. For now, we just need to load the data from ransom. csv into Python.
We'll load the data into a DataFrame, a special data type from the pandas module. It represents spreadsheet-like data (something with rows and columns).
We can create a DataFrame from a CSV (comma-separated value) file by using the function pd. read_csv.
# Import pandas
import pandas as pd
# Load the 'ransom. csv' into a DataFrame
r = ___.___('___')
# Display DataFrae
print(r)
3. Correcting a function error
The code in the script editor should plot information from the DataFrame that we loaded in the previous exercise.
However, there is an error in function syntax. Remember that common function errors include:
Forgetting closing parenthesis
Forgetting commas between each argument
Note that all arguments to the functions are correct. The problem is in the function syntax.
# One or more of the following lines contains an error
# Correct it so that it runs without producing syntax errors
# Plot a graph
plt. plot(x_values y_values)
# Display the graph
plt. show()
4. Snooping for suspects
We need to narrow down the list of suspects for the kidnapping of Bayes. Once we have a list of suspects, we'll ask them for writing samples and compare them to the ransom note.
A witness to the crime noticed a green truck leaving the scene of the crime whose license plate began with 'FRQ'. We'll use this information to search for some suspects.
As a detective, you have access to a special function called lookup_plate.
lookup_plate accepts one positional argument: A string representing a license plate.
# Define plate to represent a plate beginning with FRQ
# Use * to represent the missing four letters
=
Please help out~~~

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:20, brookemcelhaney
The north and south regions had very diferent economies in the 1800s.
Answers: 1
image
Computers and Technology, 23.06.2019 18:30, bsept1018
Report all segments of identity by descent longer than 20 polymorphisms between pairs of individuals in the following cohort of 15 individuals across 49 polymorphisms: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 numeric input 2 points possible (graded) you have 2 attempts to complete the assignment below. for example if the sequence is "bcd", which occurs in "abcdef" , the starting point would be 2 (b), and the finishing point would be 4(d). individuals 7,10 between positions
Answers: 1
image
Computers and Technology, 23.06.2019 18:30, janny48
How often does colleges update the cost of attendance on their website? . a)every two years b) every four years c) every year d) every semester
Answers: 1
image
Computers and Technology, 24.06.2019 03:30, live4dramaoy0yf9
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
You know the right answer?
In Python!! 1. Correcting string errors
It's easy to make errors when you're trying to type s...

Questions in other subjects:

Konu
Mathematics, 13.06.2020 05:57