There are a number of SO questions regarding agg and apply on pandas DataFrame.groupby() objects, but I don't understand the difference between DataFrame.agg() and DataFrame.apply(). From the docs and the snippet below, they look the same to me. If there are issues specifically related to row operations that don't apply to operations on columns, I'd like to know about them.
import pandas as pd
a = pd.Series([True, False, False])
b = pd.Series([False, False, False])
c = pd.Series([True, True, False])
d = pd.Series([1, 2, 3])
print(pd.DataFrame({'a': a, 'b': b, 'c': c, 'd': d}).agg(lambda x: print(len(x)), axis=1))
print()
print(pd.DataFrame({'a': a, 'b': b, 'c': c, 'd': d}).apply(lambda x: print(len(x)), axis=1))
4
4
4
0 None
1 None
2 None
dtype: object
4
4
4
0 None
1 None
2 None
dtype: object