Append to Series in python/pandas not working
<p>I am trying to append values to a pandas Series obtained by finding the difference between the nth and nth + 1 element:</p>

<pre><code>q = pd.Series([])

while i &lt; len(other array):
    diff = some int value
    a = pd.Series([diff], ignore_index=True)
    q.append(a)
    i+=1
</code></pre>

<p>The output I get is:</p>

<pre><code>Series([], dtype: float64)
</code></pre>

<p>Why am I not getting an array with all the appended values?</p>

<p>--</p>

<p>P.S. This is a data science question where I have to find state with the most counties by searching through a dataframe. I am using the index values where one state ends and the next one begins (the values in the array that I am using to find the difference) to determine how many counties are in that state. If anyone knows how to solve this problem better than I am above, please let me know!</p>