+ 1

Has anyone passed the COVID Test in Python for Data Science course?

Hi All! If yes, could you answer for a few questions which maybe allows me to go closer to the answer? And it is not about the solution... not an exact one at least ;-) 1. First of all, is it possible? As I have been trying for weeks... probably I am not good enough :-( 2. What is the exact format of the output? As this is somethimes the key to pass the test. 3. Is the answer date from the first quater of the year? 4. And the ratio between 0.08 and 0.16? Maybe someone who has not done this course and is PRO can look at that challenge and give me some advises. TIA :-)

10th Jul 2021, 9:35 AM
blackfish
blackfish - avatar
8 Answers
+ 1
Calvin Thomas here means where?
10th Jul 2021, 11:01 PM
blackfish
blackfish - avatar
+ 1
Calvin Thomas Projects have no discussion section. I asked this question, maybe in less descriptive way, in the last lesson, but was no answer. That's why I put it here 🙂
13th Jul 2021, 7:57 AM
blackfish
blackfish - avatar
0
blackfish Please post the question here.
10th Jul 2021, 6:49 PM
Calvin Thomas
Calvin Thomas - avatar
0
The output should be a row of the df with the highest ratio: i = df['ratio'].max() print(df[(df['ratio']==i)])
13th Jul 2021, 4:38 AM
Daniel
Daniel - avatar
0
import pandas as pd df = pd.read_csv("/usercode/files/ca-covid.csv") df.drop('state', axis=1, inplace=True) df.set_index('date', inplace=True) de = df['deaths']/df['cases'] df['ratio'] = de i = df['ratio'].max() print(df[(df['ratio']==i)])
13th Jul 2021, 4:39 AM
Daniel
Daniel - avatar
0
blackfish The comments section, I mean.
13th Jul 2021, 6:00 AM
Calvin Thomas
Calvin Thomas - avatar
0
blackfish I see.
13th Jul 2021, 8:04 AM
Calvin Thomas
Calvin Thomas - avatar
0
Daniel Thank you. However I did not want the code. I already solved it on my own, but could not pass the test. The reason was a wrong question/description of the task. It says: "Important: The output should be a DataFrame, containing all of the columns of the dataset for the corresponding row." "All of the columns" means for me "State" column too. Thanks to you I add these two lines of code: removing "state" column and sorting by date.
13th Jul 2021, 8:05 AM
blackfish
blackfish - avatar