Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question B 1 ( Python ) ( i ) Given the following code defining Sam's age, can you write code using an f - string
Question BPython
i Given the following code defining Sam's age, can you write code using an fstring to print "Sam is years old"?
age
marks
ii Given the following code defining Sam's age and number of pets in the object Saminfo, can you write code using either an fstring or string format method to print "Sam is years old and has pets"?
nfo 'age': 'pets':
marks
iii Given a DataFrame df can you write code to select the rows a and b and the columns and
marks
iv Write a line of code to read a csv file "mydata.csv into a DataFrame df assuming that the first row of the csv file contains the column names.
Write code to plot the first column of df against the second column using the plot function from pyplot only partial credit will be given for other approaches, even if the approach is superior
marks
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