I have multiple dataframes that I'd like to join together vertically. Each one is ~90 rows and 3 columns so I'd like it to be ~500 rows and 3 columns. When I use pd.concat to do this though it puts the second dataframe in an additional 3 columns meaning I have 6.
import pandas as pd
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
pd.set_option('display.width',1000)
df1 = pd.read_csv("file1.txt",delim_whitespace=True, skiprows=1, on_bad_lines='skip')
df1 = df1.iloc[:,[10,11,12]]
df2 = pd.read_csv("file2.txt",delim_whitespace=True,skiprows=1,on_bad_lines='skip')
df2 = df2.iloc[:,[10,11,12]]
x = pd.concat([df1, df2])
print(x)
The first dataframe is on the left and the second on the right with spaces being NaN
I thought the pd.concat would combine both dataframes into 1 dataframe with all the rows of df1 and df2 but with 3 columns.