How to Union Pandas DataFrames using Concat? Last Updated : 10 Jul, 2020 Comments Improve Suggest changes Like Article Like Report concat() function does all of the heavy liftings of performing concatenation operations along an axis while performing optional set logic (union or intersection) of the indexes (if any) on the other axes. The concat() function combines data frames in one of two ways: Stacked: Axis = 0 (This is the default option).Axis=0Side by Side: Axis = 1Axis=1 Steps to Union Pandas DataFrames using Concat: Create the first DataFrame Python3 import pandas as pd students1 = {'Class': ['10','10','10'], 'Name': ['Hari','Ravi','Aditi'], 'Marks': [80,85,93] } df1 = pd.DataFrame(students1, columns= ['Class','Name','Marks']) df1 Output: Create the second DataFrame Python3 import pandas as pd students2 = {'Class': ['10','10','10'], 'Name': ['Tanmay','Akshita','Rashi'], 'Marks': [89,91,87] } df2 = pd.DataFrame(students2, columns= ['Class','Name','Marks']) df2 Output: Union Pandas DataFrames using Concat Python3 pd.concat([df1,df2]) Output: Note: You’ll need to keep the same column names across all the DataFrames to avoid any ‘NaN’ values. Comment More infoAdvertise with us Next Article How to Union Pandas DataFrames using Concat? J joshiamit438 Follow Improve Article Tags : Data Science Python-pandas Python pandas-dataFrame python Practice Tags : python Similar Reads How to compare values in two Pandas Dataframes? Let's discuss how to compare values in the Pandas dataframe. Here are the steps for comparing values in two pandas Dataframes: Step 1 Dataframe Creation: The dataframes for the two datasets can be created using the following code: Python3 import pandas as pd # elements of first dataset first_Set = 2 min read How to combine two DataFrames in Pandas? While working with data, there are multiple times when you would need to combine data from multiple sources. For example, you may have one DataFrame that contains information about a customer, while another DataFrame contains data about their transaction history. If you want to analyze this data tog 3 min read How To Concatenate Two or More Pandas DataFrames? In real-world data the information is often spread across multiple tables or files. To analyze it properly we need to bring all that data together. This is where the pd.concat() function in Pandas comes as it allows you to combine two or more DataFrames in: Vertically (stacking rows on top of each o 3 min read How To Compare Two Dataframes with Pandas compare? A DataFrame is a 2D structure composed of rows and columns, and where data is stored into a tubular form. It is mutable in terms of size, and heterogeneous tabular data. Arithmetic operations can also be performed on both row and column labels. To know more about the creation of Pandas DataFrame. He 5 min read How to Join Pandas DataFrames using Merge? Joining and merging DataFrames is that the core process to start  out with data analysis and machine learning tasks. It's one of the toolkits which each Data Analyst or Data Scientist should master because in most cases data comes from multiple sources and files. In this tutorial, you'll how to join 3 min read How to Concatenate Column Values in Pandas DataFrame? Many times we need to combine values in different columns into a single column. There can be many use cases of this, like combining first and last names of people in a list, combining day, month, and year into a single column of Date, etc. Now we'll see how we can achieve this with the help of some 2 min read Convert JSON to Pandas DataFrame When working with data, it's common to encounter JSON (JavaScript Object Notation) files, which are widely used for storing and exchanging data. Pandas, a powerful data manipulation library in Python, provides a convenient way to convert JSON data into a Pandas data frame. In this article, we'll exp 4 min read How to convert Dictionary to Pandas Dataframe? Converting a dictionary into a Pandas DataFrame is simple and effective. You can easily convert a dictionary with key-value pairs into a tabular format for easy data analysis. Lets see how we can do it using various methods in Pandas.1. Using the Pandas ConstructorWe can convert a dictionary into Da 2 min read Joining two Pandas DataFrames using merge() The merge() function is designed to merge two DataFrames based on one or more columns with matching values. The basic idea is to identify columns that contain common data between the DataFrames and use them to align rows. Let's understand the process of joining two pandas DataFrames using merge(), e 4 min read How to Convert Index to Column in Pandas Dataframe? Pandas is a powerful tool which is used for data analysis and is built on top of the python library. The Pandas library enables users to create and manipulate dataframes (Tables of data) and time series effectively and efficiently. These dataframes can be used for training and testing machine learni 2 min read Like