One of the way to create Pandas DataFrame is by using zip() function.
You can use the lists to create lists of tuples and create a dictionary from it. Then, this dictionary can be used to construct a dataframe.
zip() function creates the objects and that can be used to produce single item at a time. This function can create pandans DataFrames by merging two lists.
Suppose there are two lists of student data, first list holds the name of student and second list holds the age of student. Then we can have,
Above two lists can be merged by using
list(zip()) function. Now, create the pandas DataFrame by calling
- Create a Pandas DataFrame from Lists
- Create pandas dataframe from lists using dictionary
- Python | Create a Pandas Dataframe from a dict of equal length lists
- Creating Pandas dataframe using list of lists
- Different ways to create Pandas Dataframe
- Create a list from rows in Pandas DataFrame | Set 2
- Create a list from rows in Pandas dataframe
- Create a Pandas DataFrame from List of Dicts
- Create a column using for loop in Pandas Dataframe
- How to create an empty DataFrame and append rows & columns to it in Pandas?
- Create a new column in Pandas DataFrame based on the existing columns
- Python | Pandas DataFrame.fillna() to replace Null values in dataframe
- Pandas Dataframe.to_numpy() - Convert dataframe to Numpy array
- Python | Creating DataFrame from dict of narray/lists
- Add a row at top in pandas DataFrame
- Python | Pandas dataframe.ne()
- Reindexing in Pandas DataFrame
- Python | Pandas dataframe.sub()
- Check for NaN in Pandas DataFrame
- Python | Pandas DataFrame.ix[ ]
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.