python: DataFrame.append does not append element
<p>I am working one week with python and I need some help.
I want that if certain condition is fulfilled, it adds a value to a database.
My program doesn't give an error but it doesn't append an element to my database </p>

<pre><code>import pandas as pd
noTEU = pd.DataFrame() # empty database
index_TEU = 0
for vessel in list:
    if condition is fullfilled:
        imo_vessel = pd.DataFrame({'imo': vessel}, index=[index_TEU])   
        noTEU.append(imo_vessel) # I want here to add an element to my database
        index_TEU = index_TEU + 1
</code></pre>

<p>If I run this, at the end I still get an empty dataframe. I have no idea why it doesn't do what I want it to do     </p>

<p>You should reassign the dataframe such as:</p>

<pre><code>import pandas as pd
noTEU = pd.DataFrame() # empty database
index_TEU = 0
for vessel in list:
    if condition is fullfilled:
        imo_vessel = pd.DataFrame({'imo': vessel}, index=[index_TEU])   
        noTEU = noTEU.append(imo_vessel) # I want here to add an element to my database
        index_TEU = index_TEU + 1
</code></pre>

<p>and don't use the keyword <code>list</code> for a List because it's included in the Python syntax.</p>

python pandas