title: Why is pandas.apply() executing on null elements?
body: <p>Supposedly, the pandas.apply() function does not apply to null elements. However, this is not occuring in the following code. Why is this happening?</p>
  
  <pre><code>import pandas as pd
  df = pd.Series([[1,2],[2,3,4,5],None])
  df
  0          [1, 2]
  1    [2, 3, 4, 5]
  2            None
  dtype: object
  df.apply(lambda x: len(x))
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "C:\Users\Alexander\Anaconda3\lib\site-packages\pandas\core\series.py", l
  ine 2169, in apply
      mapped = lib.map_infer(values, f, convert=convert_dtype)
    File "pandas\src\inference.pyx", line 1059, in pandas.lib.map_infer (pandas\li
  b.c:62578)
    File "&lt;stdin&gt;", line 1, in &lt;lambda&gt;
  TypeError: object of type 'NoneType' has no len()
  </code></pre>