filmov
tv
Lecture 36: Python DataFrame() | How to Create DataFrame? || by Ashish Asthana

Показать описание
• DataFrame is a two dimensional data structure i.e., data is aligned in a tabular manner in rows and columns. Note that, Series are used to work with one dimensional array, whereas DataFrame can be used with two dimensional arrays.
• DataFrame can store hetrogenous (multiple data type) data and size can be changed (mutable) in DataFrame. DataFrame has two different index i.e. column-index and row-index.
• We can perform many operations on datasets like arithmetic operations, columns and rows selection, column and rows addition etc.
A pandas DataFrame can be created using the following constructor −
dataFrameObject= pandas.DataFrame( data, index, columns, dtype, copy)
The parameters of the constructor are as follows −
Parameter Description
data data can be represented as series, list, dict, constant or other dataframes..
index
For the row labels, the index to be used for the resulting frame is optional. By default, the index value is displayed from 0 to n -1
columns
dtype Data type of each column.
copy This command or whatever it is used for copying of data, if the default is False.
A pandas DataFrame can be created using various inputs like −
i. Two-dimensional dictionaries
ii. Two-dimensional ndarrays (NumPy array)
iii. Series
iv. Lists
v. Another DataFrame object
----------------------------------------------------------------------------
Like, Share and Subscribe to my channel to get video updates
• DataFrame can store hetrogenous (multiple data type) data and size can be changed (mutable) in DataFrame. DataFrame has two different index i.e. column-index and row-index.
• We can perform many operations on datasets like arithmetic operations, columns and rows selection, column and rows addition etc.
A pandas DataFrame can be created using the following constructor −
dataFrameObject= pandas.DataFrame( data, index, columns, dtype, copy)
The parameters of the constructor are as follows −
Parameter Description
data data can be represented as series, list, dict, constant or other dataframes..
index
For the row labels, the index to be used for the resulting frame is optional. By default, the index value is displayed from 0 to n -1
columns
dtype Data type of each column.
copy This command or whatever it is used for copying of data, if the default is False.
A pandas DataFrame can be created using various inputs like −
i. Two-dimensional dictionaries
ii. Two-dimensional ndarrays (NumPy array)
iii. Series
iv. Lists
v. Another DataFrame object
----------------------------------------------------------------------------
Like, Share and Subscribe to my channel to get video updates