<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Create a sample DataFrame with some missing values.
Step1:  Task
Step2:  We can use this to extract the desired columns if we wish.
Step3:  Now we can do the assignment. Note that we use the .loc operator to avoid a warning about "trying to set values on a copy of a slice from a DataFrame" which would happen if we used for example the following expression
df[cond]['colA'] = df[cond]['colB']
(See http
Step4:  The resulting DataFrame does indeed have the values yyy and zzz filled in column colA.
<ASSISTANT_TASK:>
Python Code:
df = pd.DataFrame({
    'colA': ['aaa', NaN, NaN, NaN, 'bbb', 'ccc'],
    'colB': ['xxx', 'yyy', NaN, 'zzz', NaN, 'www'], 
    #'colC': [NaN, 3, NaN, 1, 0, 9]
    })
df
Explanation: Create a sample DataFrame with some missing values.
End of explanation
cond = df.colA.isnull() & ~df.colB.isnull()
cond
Explanation: Task: replace missing values in column colA with those in colB (if they exist).
First we define a filtering expression ("condition") cond which encodes the condition which we'd like to use for filling in the values. In this case we could actually use the simpler condition cond = df.colA.isnull() because it doesn't matter if the value in colB is also missing (since we would just replace NaN with NaN), but for the sake of illustration let's use this slightly more complicated expression.
End of explanation
df[cond]
Explanation: We can use this to extract the desired columns if we wish.
End of explanation
df.loc[cond, 'colA'] = df.loc[cond, 'colB']
Explanation: Now we can do the assignment. Note that we use the .loc operator to avoid a warning about "trying to set values on a copy of a slice from a DataFrame" which would happen if we used for example the following expression
df[cond]['colA'] = df[cond]['colB']
(See http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy for details.)
End of explanation
df
Explanation: The resulting DataFrame does indeed have the values yyy and zzz filled in column colA.
End of explanation
<END_TASK>