title: pandas.DataFrame.append is adding new columns to dataframe in python
body: <p>First, I created a csv file from data0 as shown:</p>
  <pre><code>data0 = [&quot;car&quot;, 0.82, 0.0026, 0.914, 0.59]
  test_df = pd.DataFrame([data0])
  test_df.to_csv(&quot;testfile1.csv&quot;)
  </code></pre>
  <p>Output of that &quot;testfile1.csv&quot; appears like this:</p>
  <pre><code>     0     1       2      3     4
  0   car  0.82  0.0026  0.914  0.59 
  </code></pre>
  <p>I want to append new data (data1 = [&quot;bus&quot;, 0.9, 0.123, 12.907, 42], data2 = [&quot;van&quot;, 0.23, 0.41, .031, 0.894, 6.16, 4.104]) to old csv file so that it appears in new row but exactly under previous rows as shown below:</p>
  <pre><code>     0     1       2       3       4     5      6
  0  car  0.82  0.0026   0.914   0.590   NaN    NaN
  1  bus  0.90  0.1230  12.907  42.000   NaN    NaN
  2  van  0.23  0.4100   0.031   0.894  6.16  4.104
  </code></pre>
  <p>I tried program and other similar methods using .append() or .to_csv() with mode=&quot;a&quot;:</p>
  <pre><code>test_df = pd.read_csv(&quot;testfile1.csv&quot;, index_col=0)
  test_df = test_df.append([data1], ignore_index=True)
  test_df = test_df.append([data2], ignore_index=True)
  test_df.to_csv(&quot;testfile1.csv&quot;)
  </code></pre>
  <p>However, every time new data is appended in new columns and not under previous columns:</p>
  <pre><code>     0     1      2       3       4  ...    0     1       2      3     4
  0  NaN   NaN    NaN     NaN     NaN  ...  car  0.82  0.0026  0.914  0.59
  1  bus  0.90  0.123  12.907  42.000  ...  NaN   NaN     NaN    NaN   NaN
  2  van  0.23  0.410   0.031   0.894  ...  NaN   NaN     NaN    NaN   NaN
  </code></pre>
  <p>My project is to read existing CSV file, appending and saving back to same file. I even tried type casting to pandas.Series</p>