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

School Management System

The document provides an overview of the Pandas library in Python, detailing its purpose for data analysis, cleaning, and manipulation. It describes the two main data structures in Pandas: Series and DataFrame, and includes examples of how to create and use these structures. Additionally, it mentions how to read CSV files using Pandas.

Uploaded by

jqt2gms76j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

School Management System

The document provides an overview of the Pandas library in Python, detailing its purpose for data analysis, cleaning, and manipulation. It describes the two main data structures in Pandas: Series and DataFrame, and includes examples of how to create and use these structures. Additionally, it mentions how to read CSV files using Pandas.

Uploaded by

jqt2gms76j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

6/19/24, 10:25 AM Grade 12-Python - Jupyter Notebook

Pandas is a Python library used for working with data sets.



It has functions for analyzing, cleaning, exploring, and manipulating data.

The name "Pandas" has a reference to both "Panel Data", and "Python Data
Analysis" and
was created by Wes McKinney in 2008.

Why Use Pandas?
Pandas allows us to analyze big data and make conclusions based on statistical
theories.

Pandas can clean messy data sets, and make them readable and relevant.

Relevant data is very important in data science.

In [1]: #pip install pandas #Pandas can be installed using:


Note: you may need to restart the kernel to use updated packages.

ERROR: Invalid requirement: '#Pandas'

In [ ]: '''Pandas generally provide two data structures for manipulating data, They are:
Data Frame.
Series
A Series is a one-dimensional array containing a sequence of values of any data
float, list, string, etc.) which by default have numeric data labels starting fr


A DataFrame is a two-dimensional labeled data structure like a table of MySQL.''

In [3]: import pandas #Using List of Dictionaries


books={'X':45,'YZZ':67}
print(pandas.Series(books))

X 45
YZZ 67
dtype: int64

In [4]: import pandas as pd



Authors= ["X", "V", "Z"]
#Authors= ["X", "V", "Z"],
myvar = pd.Series(Authors)

print(myvar)

0 X
1 V
2 Z
dtype: object

localhost:8888/notebooks/Sunita/Grade 12-Python.ipynb 1/3


6/19/24, 10:25 AM Grade 12-Python - Jupyter Notebook

In [5]: import pandas


dset = {
'Authors': ["X", "V", "Z"],
'Books': [13, 17, 24]
}
details = pandas.DataFrame(dset)

print(details)

Authors Books
0 X 13
1 V 17
2 Z 24

In [6]: import pandas as pd



Authors= ["X", "V", "Z"]
#Authors= ["X", "V", "Z"],
myvar = pd.Series(Authors, index = [13,17,45])
print(myvar)
print(myvar[17])

13 X
17 V
45 Z
dtype: object
V

In [7]: import pandas as pd


dset['Price']=[200,306,423]
print(dset)

{'Authors': ['X', 'V', 'Z'], 'Books': [13, 17, 24], 'Price': [200, 306, 423]}

In [8]: '''Read CSV Files. A Comma Seperated values(CSV) file can be created in excel, s
as CSV or in jupyter notebook. Save the file with .csv extension.'''

import pandas as pd #as /alias is used to give short name

df = pd.read_csv('data.csv')

print(df)

Duration Pulse Maxpulse Calories


0 0 60 110 130 409.1
1 1 60 117 145 479.0
2 2 60 103 135 340.0
3 3 45 109 175 282.4
4 4 45 117 148 406.0
.. ...
122 122 60 119 169 336.7
123 123 60 107 127 344.9
124 124 60 111 151 368.5
125 125 60 98 122 271.0
126 126 60 97 124 275.3

[127 rows x 1 columns]

localhost:8888/notebooks/Sunita/Grade 12-Python.ipynb 2/3


6/19/24, 10:25 AM Grade 12-Python - Jupyter Notebook

In [ ]: ​

localhost:8888/notebooks/Sunita/Grade 12-Python.ipynb 3/3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy