Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Contacts For the following questions, the file contacts.csv is provided, with the following fields: email, first, last, phone. Data in the email field are unique
Contacts
For the following questions, the file contacts.csv is provided, with the following fields: email, first, last, phone. Data in the email field are
unique for each row and can be used as the index in a DataFrame.
Loading and getting information
a
Use the pandas read
csv
function to load the data in contacts.csv into a DataFrame. Use the email column as the DataFrame
index. Display the data in the DataFrame.
b
Use the info
method to determine how many non
null values there are for each column and what each column's type is
c
Determine the number of rows and columns using the len
function as well as the shape property.
d
Display the first two and last two rows using head
and tail
Accessing rows, columns, and cells
e
Display the phone column.
f
Display the columns named first and last in a DataFrame.
g
Display the phone number for the row with
email
smsmith@yahoo.com.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started