SlideShare uma empresa Scribd logo
1 de 9
Pandas
•Open-source Python Library
•Data manipulation and analysis tool using its powerful data structures.
•Wes McKinney -2008
•Pandas will extract the data from that CSV into :
•DataFrame
•Table
•Perform following statistical operations on it like :
•What's the average, median, max, or min of each column?
•Does column A correlate with column B?
•What does the distribution of data in column C look like?
•Clean the data by doing things like removing missing values and
filtering rows or columns by some criteria
•Visualize the data with help from Matplotlib. Plot bars, lines,
histograms, bubbles, and more.
•Store the cleaned, transformed data back into a CSV, other file or
database
Pandas
• From command prompt
•pip install pandas
• From Jupyter notebook
• !pip install pandas’
•Then in notebook to use pandas..need to create instance of it
• import pandas as pd
Pandas
•Pandas deals with the following three data structures −
•Series
•DataFrame
•Panel
Data Structure Description
Series 1D labeled homogeneous array, size immutable.
Data Frames 2D - labeled, size-mutable tabular structure with potentially
heterogeneously typed columns.
Panel 3D labeled, size-mutable array.
Pandas
Series
Homogeneous data
Size Immutable
Values of Data Mutable
DataFrame is a two-dimensional array with heterogeneous data.
For example,
Name Age Gender Rating
Steve 32 Male 3.45
Lia 28 Female 2.40
The data is represented in rows and columns. Each column represents an attribute
and each row represents a person.
Data Type of Columns
The data types of the four columns are as follows −
Column Type
Name String
Age Integer
Gender String
Rating Float
Pandas
Data Frame :
•Key Points
•Heterogeneous data
•Size Mutable
•Data Mutable
•Panel
Panel is a three-dimensional data structure with heterogeneous data. It is hard to
represent the panel in graphical representation. But a panel can be illustrated as a
container of DataFrame.
Key Points
Heterogeneous data
Size Mutable
Data Mutable
Pandas
•Series is a one-dimensional labeled array capable of holding data of any type (integer,
string, float, python objects, etc.).
•The axis labels are collectively called index.
A pandas Series can be created using the following constructor −
pandas.Series( data, index, dtype, copy)
The parameters of the constructor are as follows −
Sr.No Parameter & Description
1 Data : data takes various forms like ndarray, list, constants
2 Index : Index values must be unique and hashable, same length as
data. Default np.arrange(n) if no index is passed.
3 Dtype : dtype is for data type. If None, data type will be inferred
4 Copy : Copy data. Default False
Pandas
A series can be created using various inputs like −
Array
Dict
Scalar value or constant
Create a Series from ndarray
If data is an ndarray, then index passed must be of the same length. If no index is
passed, then by default index will be range(n) where n is array length, i.e.,
[0,1,2,3…. range(len(array))-1].
Pandas
•A Data frame is a two-dimensional data structure, i.e., data is aligned in a tabular
fashion in rows and columns.
•Features of DataFrame
•Potentially columns are of different types
•Size – Mutable
•Labeled axes (rows and columns)
•Can Perform Arithmetic operations on rows and columns
Pandas
•pandas.DataFrame
•A pandas DataFrame can be created using the following constructor −
•pandas.DataFrame( data, index, columns, dtype, copy)
•Create DataFrame
•A pandas DataFrame can be created using various inputs like −
•Lists
•dict
•Series
•Numpy ndarrays
•Another DataFrame

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Python pandas Library
Python pandas LibraryPython pandas Library
Python pandas Library
 
Pandas
PandasPandas
Pandas
 
Data Analysis in Python
Data Analysis in PythonData Analysis in Python
Data Analysis in Python
 
Python Pandas
Python PandasPython Pandas
Python Pandas
 
Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)
 
Data Visualization in Python
Data Visualization in PythonData Visualization in Python
Data Visualization in Python
 
Data structures - unit 1
Data structures - unit 1Data structures - unit 1
Data structures - unit 1
 
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYAPYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
 
Data Preprocessing
Data PreprocessingData Preprocessing
Data Preprocessing
 
Pandas Series
Pandas SeriesPandas Series
Pandas Series
 
Introduction of data structures and algorithms
Introduction of data structures and algorithmsIntroduction of data structures and algorithms
Introduction of data structures and algorithms
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
Data engineering and analytics using python
Data engineering and analytics using pythonData engineering and analytics using python
Data engineering and analytics using python
 
Seaborn.pptx
Seaborn.pptxSeaborn.pptx
Seaborn.pptx
 
Classification in Data Mining
Classification in Data MiningClassification in Data Mining
Classification in Data Mining
 
4. R- files Reading and Writing
4. R- files Reading and Writing4. R- files Reading and Writing
4. R- files Reading and Writing
 
Advanced data structures & algorithms important questions
Advanced data structures & algorithms important questionsAdvanced data structures & algorithms important questions
Advanced data structures & algorithms important questions
 
pandas dataframe notes.pdf
pandas dataframe notes.pdfpandas dataframe notes.pdf
pandas dataframe notes.pdf
 
NumPy
NumPyNumPy
NumPy
 

Semelhante a Pandas

pandas-221217084954-937bb582.pdf
pandas-221217084954-937bb582.pdfpandas-221217084954-937bb582.pdf
pandas-221217084954-937bb582.pdf
scorsam1
 
pandas directories on the python language.pptx
pandas directories on the python language.pptxpandas directories on the python language.pptx
pandas directories on the python language.pptx
SumitMajukar
 
XII IP New PYTHN Python Pandas 2020-21.pptx
XII IP New PYTHN Python Pandas 2020-21.pptxXII IP New PYTHN Python Pandas 2020-21.pptx
XII IP New PYTHN Python Pandas 2020-21.pptx
lekha572836
 
Introducing Pandas Objects.pptx
Introducing Pandas Objects.pptxIntroducing Pandas Objects.pptx
Introducing Pandas Objects.pptx
ssuser52a19e
 
Data preprocessing ppt1
Data preprocessing ppt1Data preprocessing ppt1
Data preprocessing ppt1
meenas06
 
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptxQ-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
kalai75
 

Semelhante a Pandas (20)

2. Data Preprocessing with Numpy and Pandas.pptx
2. Data Preprocessing with Numpy and Pandas.pptx2. Data Preprocessing with Numpy and Pandas.pptx
2. Data Preprocessing with Numpy and Pandas.pptx
 
Pandas.pptx
Pandas.pptxPandas.pptx
Pandas.pptx
 
pandas-221217084954-937bb582.pdf
pandas-221217084954-937bb582.pdfpandas-221217084954-937bb582.pdf
pandas-221217084954-937bb582.pdf
 
pandas.pdf
pandas.pdfpandas.pdf
pandas.pdf
 
Unit 3_Numpy_VP.pptx
Unit 3_Numpy_VP.pptxUnit 3_Numpy_VP.pptx
Unit 3_Numpy_VP.pptx
 
pandas directories on the python language.pptx
pandas directories on the python language.pptxpandas directories on the python language.pptx
pandas directories on the python language.pptx
 
XII IP New PYTHN Python Pandas 2020-21.pptx
XII IP New PYTHN Python Pandas 2020-21.pptxXII IP New PYTHN Python Pandas 2020-21.pptx
XII IP New PYTHN Python Pandas 2020-21.pptx
 
All python data_analyst_r_course
All python data_analyst_r_courseAll python data_analyst_r_course
All python data_analyst_r_course
 
Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL Server
 
Introducing Pandas Objects.pptx
Introducing Pandas Objects.pptxIntroducing Pandas Objects.pptx
Introducing Pandas Objects.pptx
 
Introduction of data science
Introduction of data scienceIntroduction of data science
Introduction of data science
 
Unit 3_Numpy_Vsp.pptx
Unit 3_Numpy_Vsp.pptxUnit 3_Numpy_Vsp.pptx
Unit 3_Numpy_Vsp.pptx
 
Python for statistical analysis
Python for statistical analysisPython for statistical analysis
Python for statistical analysis
 
4)12th_L-1_PYTHON-PANDAS-I.pptx
4)12th_L-1_PYTHON-PANDAS-I.pptx4)12th_L-1_PYTHON-PANDAS-I.pptx
4)12th_L-1_PYTHON-PANDAS-I.pptx
 
Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...
Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...
Matplotlib adalah pustaka plotting 2D Python yang menghasilkan gambar berkual...
 
python-numpyandpandas-170922144956 (1).pptx
python-numpyandpandas-170922144956 (1).pptxpython-numpyandpandas-170922144956 (1).pptx
python-numpyandpandas-170922144956 (1).pptx
 
Data preprocessing ppt1
Data preprocessing ppt1Data preprocessing ppt1
Data preprocessing ppt1
 
Python Pandas.pptx
Python Pandas.pptxPython Pandas.pptx
Python Pandas.pptx
 
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptxQ-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
Q-Step_WS_06112019_Data_Analysis_and_visualisation_with_Python.pptx
 
Pandas csv
Pandas csvPandas csv
Pandas csv
 

Último

Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 

Último (20)

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 

Pandas

  • 1. Pandas •Open-source Python Library •Data manipulation and analysis tool using its powerful data structures. •Wes McKinney -2008 •Pandas will extract the data from that CSV into : •DataFrame •Table •Perform following statistical operations on it like : •What's the average, median, max, or min of each column? •Does column A correlate with column B? •What does the distribution of data in column C look like? •Clean the data by doing things like removing missing values and filtering rows or columns by some criteria •Visualize the data with help from Matplotlib. Plot bars, lines, histograms, bubbles, and more. •Store the cleaned, transformed data back into a CSV, other file or database
  • 2. Pandas • From command prompt •pip install pandas • From Jupyter notebook • !pip install pandas’ •Then in notebook to use pandas..need to create instance of it • import pandas as pd
  • 3. Pandas •Pandas deals with the following three data structures − •Series •DataFrame •Panel Data Structure Description Series 1D labeled homogeneous array, size immutable. Data Frames 2D - labeled, size-mutable tabular structure with potentially heterogeneously typed columns. Panel 3D labeled, size-mutable array.
  • 4. Pandas Series Homogeneous data Size Immutable Values of Data Mutable DataFrame is a two-dimensional array with heterogeneous data. For example, Name Age Gender Rating Steve 32 Male 3.45 Lia 28 Female 2.40 The data is represented in rows and columns. Each column represents an attribute and each row represents a person. Data Type of Columns The data types of the four columns are as follows − Column Type Name String Age Integer Gender String Rating Float
  • 5. Pandas Data Frame : •Key Points •Heterogeneous data •Size Mutable •Data Mutable •Panel Panel is a three-dimensional data structure with heterogeneous data. It is hard to represent the panel in graphical representation. But a panel can be illustrated as a container of DataFrame. Key Points Heterogeneous data Size Mutable Data Mutable
  • 6. Pandas •Series is a one-dimensional labeled array capable of holding data of any type (integer, string, float, python objects, etc.). •The axis labels are collectively called index. A pandas Series can be created using the following constructor − pandas.Series( data, index, dtype, copy) The parameters of the constructor are as follows − Sr.No Parameter & Description 1 Data : data takes various forms like ndarray, list, constants 2 Index : Index values must be unique and hashable, same length as data. Default np.arrange(n) if no index is passed. 3 Dtype : dtype is for data type. If None, data type will be inferred 4 Copy : Copy data. Default False
  • 7. Pandas A series can be created using various inputs like − Array Dict Scalar value or constant Create a Series from ndarray If data is an ndarray, then index passed must be of the same length. If no index is passed, then by default index will be range(n) where n is array length, i.e., [0,1,2,3…. range(len(array))-1].
  • 8. Pandas •A Data frame is a two-dimensional data structure, i.e., data is aligned in a tabular fashion in rows and columns. •Features of DataFrame •Potentially columns are of different types •Size – Mutable •Labeled axes (rows and columns) •Can Perform Arithmetic operations on rows and columns
  • 9. Pandas •pandas.DataFrame •A pandas DataFrame can be created using the following constructor − •pandas.DataFrame( data, index, columns, dtype, copy) •Create DataFrame •A pandas DataFrame can be created using various inputs like − •Lists •dict •Series •Numpy ndarrays •Another DataFrame