top of page
Search
  • Writer's pictureMayuri Kale

Pandas DataFrame - Its Characteristics





Pandas DataFrame is a two-dimensional, size-mutable form of tables data structure with labelled axes (rows and columns). A data frame is a two-dimensional data structure in which data is aligned in rows and columns in a tabular fashion. Pandas DataFrame is made up of three major components: data, rows, and columns.




DataFrame Characteristics



Columns could be of various types.


Size – Variable


Axes with labels (rows and columns)


Arithmetic operations on rows and columns are supported.




Creating a Pandas DataFrame


In practice, a Pandas DataFrame is created by loading datasets from existing storage, which can be a SQL database, a CSV file, or an Excel file. Pandas DataFrames can be created from lists, dictionaries, and lists of dictionaries, among other things.



Creating a DataFrame from an ndarray/lists dict: To generate a DataFrame from a dict of narrays/lists, each narray must be the same length. If index is supplied, the length index must be equitable to the length of the arrays. If no index is specified, the index will be range(n), where n is the length of the array.




# Python code demonstrating the creation of


# DataFrame constructed from dict narray / lists


# These are the default addresses.


import pandas as pd

# intialise data of lists.

data = {'Name':['Tina', 'nia', 'kiya', 'piya'],

'Roll no':[10, 21, 14, 15]}

# Create DataFrame


df = pd.DataFrame(data)

# Print the output.

print(df)


Name Roll no

Tina', 10

'Nia', 21

'kiya', 14

'piya 15




Panel of Pandas


Panel is a crucial container for three-dimensional data in Pandas. The names of the three axes are intended to provide semantic meaning when describing operations involving panel data, specifically econometric analysis of panel data. Shape can be used in Pandas Panel to get a tuple of axis dimensions.


Conclusion

Here , we saw the pandas DataFrame ,its features , how to create it and Pandas Panel . Learn about more data operations in python in our blog.



3 views0 comments

Comments


Post: Blog2_Post
bottom of page