Challenge: Batch Data Cleaning
Uppgift
Swipe to start coding
Write a function that takes a list of pandas DataFrames, each representing data from a different research site. For each DataFrame, fill missing values in the score column with the mean score for that site, and return a new list of these cleaned DataFrames.
- Iterate through each DataFrame in the input list.
- Calculate the mean of the
scorecolumn for each DataFrame. - Fill missing values in the
scorecolumn with the calculated mean for that DataFrame. - Store each cleaned DataFrame in a new list.
- Return the new list of cleaned DataFrames.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 3. Kapitel 5
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 5
Challenge: Batch Data Cleaning
Svep för att visa menyn
Uppgift
Swipe to start coding
Write a function that takes a list of pandas DataFrames, each representing data from a different research site. For each DataFrame, fill missing values in the score column with the mean score for that site, and return a new list of these cleaned DataFrames.
- Iterate through each DataFrame in the input list.
- Calculate the mean of the
scorecolumn for each DataFrame. - Fill missing values in the
scorecolumn with the calculated mean for that DataFrame. - Store each cleaned DataFrame in a new list.
- Return the new list of cleaned DataFrames.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 3. Kapitel 5
single