1. Help Center
  2. Python Programming

how do you define pandas dataframe?

A dataframe is a 2D mutable and tabular structure for representing data labelled with axes - rows and columns.
The syntax for creating dataframe:
 
import pandas as pd

dataframe = pd.DataFrame( data, index, columns, dtype)

 

where:
 
data - Represents various forms like series, map, ndarray, lists, dict etc.
index - Optional argument that represents an index to row labels.
columns - Optional argument for column labels.
dtype - the data type of each column. Again optional.