<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
I have a dataFrame with rows and columns that sum to 0.
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
df = pd.DataFrame([[1,1,0,1],[0,0,0,0],[1,0,0,1],[0,1,0,0],[1,1,0,1]],columns=['A','B','C','D'])
def g(df):
    return df.loc[(df.sum(axis=1) != 0), (df.sum(axis=0) != 0)]
result = g(df.copy())
<END_TASK>