0% found this document useful (0 votes)
83 views

Pandas Dataframe Notes

A DataFrame is a two-dimensional data structure used in Pandas to store and manipulate tabular data, such as data from a database. It contains both row and column indexes like a MySQL table. DataFrames can store different data types across columns. They can be created from dictionaries, lists of dictionaries, NumPy arrays, other DataFrames, and by selecting or deleting rows and columns.

Uploaded by

venkat krishnan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Pandas Dataframe Notes

A DataFrame is a two-dimensional data structure used in Pandas to store and manipulate tabular data, such as data from a database. It contains both row and column indexes like a MySQL table. DataFrames can store different data types across columns. They can be created from dictionaries, lists of dictionaries, NumPy arrays, other DataFrames, and by selecting or deleting rows and columns.

Uploaded by

venkat krishnan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Notes on Pandas (DataFrame (XII))

DataFrame
 Sometimes we need to work on multiple columns at a time, i.e., we need to process the tabular data. For
example, the result of a class, items in a restaurant’s menu, reservation chart of a train, etc.
 Pandas store such tabular data using a DataFrame.
 A DataFrame is a two-dimensional labelled data structure like a table of MySQL.
 It contains rows and columns, and therefore has both a row and column index. Each column can have a
different type of value such as numeric, string, boolean, etc., as in tables of a database.

DataFrame object can be created by passing data in many different ways


1. Using 2D dictionaries
a. Creating a dataframe from 2D dictionary having values as list/ndarrays.
b. Creating a dataframe from 2D dictionary having values as dictionary objects.
c. Creating a dataframe from 2D dictionary with values as series object.
2. Using List of Dictionaries/Lists
3. Using 2-D ndarrays(Numpy array)
4. Using series type object
5. Using another DataFrame object
Selecting individual values

Deleting a column from DataFrame


Deleting a row from DataFrame

iterrows()
iteritems()

Practice questions

You might also like