title: pandas setting column prevents setting individual cell to iterable
body: <p>Not sure if I'm doing something wrong, or if this is an issue with Pandas.  I am seeing a problem where I can</p>
  
  <ul>
  <li>Set individual cells to a value that is an iterable (for example a tuple) using .loc[] </li>
  <li><strong><em>BUT</em></strong> if I first set an <strong><em>entire</em></strong> column, using [], then afterwords I can no longer set individual cells to an iterable using .loc[]</li>
  </ul>
  
  <p>For example, start with a 4x3 dataframe filled with None's:</p>
  
  <pre><code>In [1]: import pandas as pd
  In [2]: nones = [None]*4
  In [3]: df = pd.DataFrame(dict(A=nones,B=nones,C=nones))
  In [4]: df
  Out[4]:
        A     B     C
  0  None  None  None
  1  None  None  None
  2  None  None  None
  3  None  None  None
  </code></pre>
  
  <p>Now set an individual cell to a tuple:</p>
  
  <pre><code>In [5]: df.loc[0,'A'] = ('x','y')
  In [6]: df
  Out[6]:
          A     B     C
  0  (x, y)  None  None
  1    None  None  None
  2    None  None  None
  3    None  None  None
  </code></pre>
  
  <p>No problem.  But if we repeat the above process, but set a column first, it doesn't work:</p>
  
  <pre><code>In [1]: import pandas as pd
  In [2]: nones = [None]*4
  In [3]: df = pd.DataFrame(dict(A=nones,B=nones,C=nones))
  In [4]: df
  Out[4]:
        A     B     C
  0  None  None  None
  1  None  None  None
  2  None  None  None
  3  None  None  None
  
  In [5]: df['B'] = [4,3,2,1]
  In [6]: df
  Out[6]:
        A  B     C
  0  None  4  None
  1  None  3  None
  2  None  2  None
  3  None  1  None
  
  
  In [7]: df.loc[0,'A'] = ('x','y')
  ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-32-767de72f6ae1&gt; in &lt;module&gt;
  ----&gt; 1 df.loc[0,'A'] = ('x','y')
  
  ~/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py in __setitem__(self, key, value)
      669             key = com.apply_if_callable(key, self.obj)
      670         indexer = self._get_setitem_indexer(key)
  --&gt; 671         self._setitem_with_indexer(indexer, value)
      672
      673     def _validate_key(self, key, axis: int):
  
  ~/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py in _setitem_with_indexer(self,     indexer, value)
     1017                     if len(labels) != len(value):
     1018                         raise ValueError(
  -&gt; 1019                             "Must have equal len keys and value "
     1020                             "when setting with an iterable"
     1021                         )
  
  ValueError: Must have equal len keys and value when setting with an iterable
  </code></pre>
  
  <hr>
  
  <p>(It seems to me, based on the code raising the exception, that pandas now thinks that, since I have a tuple on the right side, I am trying to set <em>more than one cell</em> and I don't have the correct number of elements)</p>
  
  <p><strong>Notice also</strong> if when setting the entire column, I leave at least one of the elements as <strong>None</strong>, then the problem does not appear, and I <strong><em>can</em></strong> set a single cell to an iterable:</p>
  
  <pre><code>In [1]: import pandas as pd
  In [2]: nones = [None]*4
  In [3]: df = pd.DataFrame(dict(A=nones,B=nones,C=nones))
  In [4]: df
  Out[4]:
        A     B     C
  0  None  None  None
  1  None  None  None
  2  None  None  None
  3  None  None  None
  
  In [5]: df['B'] = (4,3,None,1)
  In [6]: df
  Out[6]:
        A     B     C
  0  None  4     None
  1  None  3     None
  2  None  None  None
  3  None  1     None
  
  In [7]: df.loc[0,'A'] = ('x','y')
  In [8]: df
  Out[8]:
          A     B     C
  0  (x, y)     4  None
  1    None     3  None
  2    None  None  None
  3    None     1  None
  </code></pre>
  
  <hr>
  
  <p>There also seems to be a difference if I set the entire column using a list instead of a tuple:</p>
  
  <pre><code>In [4]: df
  Out[4]:
        A     B     C
  0  None  None  None
  1  None  None  None
  2  None  None  None
  3  None  None  None
  
  In [5]: df['B'] = [4,3,None,1]
  In [6]: df
  Out[6]:
        A    B     C
  0  None  4    None
  1  None  3    None
  2  None  NaN  None
  3  None  1    None
  
  In [7]: df.loc[0,'A'] = ('x','y')
  ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  ... SAME ERROR STUFF AS BEFORE
  ValueError: Must have equal len keys and value when setting with an iterable
  </code></pre>
  
  <p>I notice also that setting the entire column with a tuple that includes <strong>None</strong>, results in a <strong>None</strong> in that cell, but setting the entire column with a list that includes None, results in <strong>NaN</strong> in that cell.</p>
  
  <p><strong><em>Does anyone know what's going on here?  Why does the behavior of setting an individual cell with .loc[] appear to be inconsistent, depending upon what I did to the dataframe BEFORE that??</em></strong></p>
  
  <p>Thanks in advance.  </p>
  
  <hr>
  
  <p><strong>P.S.</strong>  I also tried the above using <code>.loc[]</code> to set the entire column:</p>
  
  <pre><code>In [5] df.loc[:,'B'] = [4,3,2,1]
  </code></pre>
  
  <p>And I get the exact same result as when using simply <code>df['B'] = [4,3,2,1]</code></p>
  
  <hr>
  
  <p><strong>P.P.S.</strong>  I've noticed that <code>df.at</code> works:</p>
  
  <pre><code>In [7]: df.at[0,'A'] = ('x','y')
  In [8]: df
  Out[8]:
          A  B     C
  0  (x, y)  4  None
  1    None  3  None
  2    None  2  None
  3    None  1  None
  </code></pre>
  
  <p><strong><em>But the question still remains</em></strong> (even if <code>.at[]</code> is the preferred method) why does <code>.loc[]</code> work sometimes and not others??</p>