+ 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 :-)
8 odpowiedzi
+ 1
Calvin Thomas here means where?
+ 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 🙂
0
blackfish Please post the question here.
0
The output should be a row of the df with the highest ratio:
i = df['ratio'].max()
print(df[(df['ratio']==i)])
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)])
0
blackfish The comments section, I mean.
0
blackfish I see.
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.