Question: Task: Figure out whether or not the missing values in the traffic source column are random. Check if every row with the source None has
Task: Figure out whether or not the missing values in the traffic source column are random.
Check if every row with the source None has an email specified. We do so by applying two filters to the logs DataFrame:
- The traffic source, 'source', equals None.
- The email column value is an empty string, ''.
Print the results of the query. If it returns an empty DataFrame, then our hypothesis was correct.
Hint: Here, you'll need to use Boolean indexing with these two conditions: (logs['source'] == 'None') & (logs['email'] == ''). Code: import pandas as pd
logs = pd.read_csv('/datasets/logs.csv') logs['email'] = logs['email'].fillna(value='')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
