Challenge: Analyze Test Failures with Pandas
In quality assurance, being able to quickly pinpoint failed tests and spot performance issues is critical. When you have a large suite of automated tests, efficiently extracting the IDs of failed tests and determining the average duration of passing tests helps you focus your debugging efforts and optimize your test runs. In this challenge, you will use pandas to analyze a DataFrame of test case results, practicing your ability to filter, aggregate, and extract key metrics that matter most in real-world QA scenarios.
Swipe to start coding
Given a pandas DataFrame with test case results, return the IDs of all failed tests and the average duration of all passing tests.
- Filter the DataFrame to find all rows with a status of
"failed"and extract their"id"values as a list. - Filter the DataFrame to find all rows with a status of
"passed"and calculate the mean of their"duration"values. - If there are no passing tests, return
Nonefor the average duration. - Return a tuple containing the list of failed test IDs and the average duration of passing tests.
Solution
Merci pour vos commentaires !
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Génial!
Completion taux amélioré à 4.76
Challenge: Analyze Test Failures with Pandas
Glissez pour afficher le menu
In quality assurance, being able to quickly pinpoint failed tests and spot performance issues is critical. When you have a large suite of automated tests, efficiently extracting the IDs of failed tests and determining the average duration of passing tests helps you focus your debugging efforts and optimize your test runs. In this challenge, you will use pandas to analyze a DataFrame of test case results, practicing your ability to filter, aggregate, and extract key metrics that matter most in real-world QA scenarios.
Swipe to start coding
Given a pandas DataFrame with test case results, return the IDs of all failed tests and the average duration of all passing tests.
- Filter the DataFrame to find all rows with a status of
"failed"and extract their"id"values as a list. - Filter the DataFrame to find all rows with a status of
"passed"and calculate the mean of their"duration"values. - If there are no passing tests, return
Nonefor the average duration. - Return a tuple containing the list of failed test IDs and the average duration of passing tests.
Solution
Merci pour vos commentaires !
single