We can create a DataFrame from a list of simple tuples, and can even choose the specific elements of the tuples we want to use.
Code #1: Simply passing tuple to DataFrame constructor.
Code #2: Using
Code #3: Using
Code #4: For pivoting it possible.
- Creating Pandas dataframe using list of lists
- Creating a Pandas DataFrame
- Creating views on Pandas DataFrame
- Creating a dataframe from Pandas series
- Creating views on Pandas DataFrame | Set - 2
- Python | Creating a Pandas dataframe column based on a given condition
- Create a list from rows in Pandas dataframe
- Create a list from rows in Pandas DataFrame | Set 2
- Create a Pandas DataFrame from List of Dicts
- Python | Convert list of nested dictionary into Pandas dataframe
- Python | Find the tuples containing the given element from a list of tuples
- Python | Remove tuples having duplicate first value from given list of tuples
- Python | Convert string tuples to list tuples
- Python | Count tuples occurrence in list of tuples
- Python | Remove tuples from list of tuples if greater than n
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.