GBSSS Khajoori Khas is a Sr. Sec. School Affiliated by CBSE Delhi. In the school class 6 to 12 are running with Art, Science and Computer Science Stream.
Monday, September 27, 2021
Theory Notes for Class 11
CLASS 11 IP Notes
1. Unit - 1 (Introduction to Computer)
1.6. Processing Devices
1.7. Output Devices
1.8. Storage Devices, Memory, Memory Unit and its Memory Types
1.12. System Software
1.13. Application Software
1.14. Generic and Specific Types Software
1.15. Data Deletion and Recovery
1.16. Security Concern
1.17. General Computer Assignment - 1
1.18. General Computer Assignment - 2
1.19. General Computer Assignment - 3
1.20. General Computer Assignment - 4
2. Unit - 2 (Introduction to Python)
2.1. Introduction to Python
2.2. Python IDE, Distributions and Frameworks
DataFrame in Python Class - 2
DataFrame Attributes / Properties:
7. ndim:
Return the dimension of the DataFrame.
import pandas as pd
I=['IP','Bio','Chemistry','Physics','English']
D={"2018":[50,60,70,80.5,90],"2019":[40,35,45,55,32], \
"2020":[65,75,85,45,52],}
df=pd.DataFrame(D,I)
df.index.name="Subject"
print(df)
print("Number of Dimension in Data Frame")
print(df.ndim)
Output:
2018 2019 2020
Subject
IP 50.0 40 65
Bio 60.0 35 75
Chemistry 70.0 45 85
Physics 80.5 55 45
English 90.0 32 52
Number of Dimension in Data Frame
2
8. empty:
Check whether a DataFrame is Empty or Not.
import pandas as pd
import numpy as np
I=['IP','Bio','Chemistry','Physics','English']
D={"2018":[50,60,70,80.5,90],"2019":[40,35,45,np.NaN,32], \
"2020":[65,75,85,45,52],}
df=pd.DataFrame(D,I)
df.index.name="Subject"
print(df)
print("Check whether a Data Frame is Empty or not")
print(df.empty)
print(df.isna()) # It is a function. Check NaN values in DataFrame
df1=pd.DataFrame()
print(df1)
print(df1.empty)
Output:
2018 2019 2020
Subject
IP 50.0 40.0 65
Bio 60.0 35.0 75
Chemistry 70.0 45.0 85
Physics 80.5 NaN 45
English 90.0 32.0 52
Check whether a Data Frame is Empty or not
False
2018 2019 2020
Subject
IP False False False
Bio False False False
Chemistry False False False
Physics False True False
English False False False
Empty DataFrame
Columns: []
Index: []
True
9. count()
It is used to count the values in Rows and Columns of DataFrame.
df.count() : count the no. of values rowwise
df.count(0):count the no. of values rowwise
df.count(axis="rows"): count the no. of values rowwise
df.count(1): count the no. of values columnwise
df.count(axis='columns'): count the no. of values columnwise
import pandas as pd
import numpy as np
I=['IP','Bio','Chemistry','Physics','English']
D={"2018":[50,60,70,80.5,90],"2019":[40,35,45,np.NaN,32], \
"2020":[65,75,85,45,52],}
df=pd.DataFrame(D,I)
df.index.name="Subject"
print(df)
print("Count the no. of values in rows")
print(df.count())
print("Count the no. of values in columns")
print(df.count(1))
print("Count the no. of values in rows")
print(df.count(0))
print("Count the no. of values in rows")
print(df.count(axis='rows'))
print("Count the no. of values in columns")
print(df.count(axis='columns'))
2018 2019 2020
Subject
IP 50.0 40.0 65
Bio 60.0 35.0 75
Chemistry 70.0 45.0 85
Physics 80.5 NaN 45
English 90.0 32.0 52
Count the no. of values in rows
2018 5
2019 4
2020 5
dtype: int64
Count the no. of values in columns
Subject
IP 3
Bio 3
Chemistry 3
Physics 2
English 3
dtype: int64
Count the no. of values in rows
2018 5
2019 4
2020 5
dtype: int64
Count the no. of values in rows
2018 5
2019 4
2020 5
dtype: int64
Count the no. of values in columns
Subject
IP 3
Bio 3
Chemistry 3
Physics 2
English 3
dtype: int64
10. Transpose of Data Frame
import pandas as pd
import numpy as np
I=['IP','Bio','Chemistry','Physics','English']
D={"2018":[50,60,70,80.5,90],"2019":[40,35,np.NaN,55,32], \
"2020":[65,75,85,45,52],}
df=pd.DataFrame(D,I)
df.index.name="Subject"
print(df)
print("Transpose of Data Frame")
print(df.T)
Output:
2018 2019 2020
Subject
IP 50.0 40.0 65
Bio 60.0 35.0 75
Chemistry 70.0 NaN 85
Physics 80.5 55.0 45
English 90.0 32.0 52
Transpose of Data Frame
Subject IP Bio Chemistry Physics English
2018 50.0 60.0 70.0 80.5 90.0
2019 40.0 35.0 NaN 55.0 32.0
2020 65.0 75.0 85.0 45.0 52.0
Saturday, September 25, 2021
Python Lect - 2
Python Version List
A list of Python versions with its released date is given below.
Python Version | Released Date |
---|---|
Python 1.0 | January 1994 |
Python 1.5 | December 31, 1997 |
Python 1.6 | September 5, 2000 |
Python 2.0 | October 16, 2000 |
Python 2.1 | April 17, 2001 |
Python 2.2 | December 21, 2001 |
Python 2.3 | July 29, 2003 |
Python 2.4 | November 30, 2004 |
Python 2.5 | September 19, 2006 |
Python 2.6 | October 1, 2008 |
Python 2.7 | July 3, 2010 |
Python 3.0 | December 3, 2008 |
Python 3.1 | June 27, 2009 |
Python 3.2 | February 20, 2011 |
Python 3.3 | September 29, 2012 |
Python 3.4 | March 16, 2014 |
Python 3.5 | September 13, 2015 |
Python 3.6 | December 23, 2016 |
Python 3.7 | June 27, 2018 |
Python 3.8 | October 14, 2019 |
Python 3.9 | October 05, 2020 |
Python 3.10 | October 04, 2021 |
What is an IDE?
An IDE (Integrated Development Environment) is a software application used by developers for creating programs.
List of Python IDE
1. PyCharm
2. Visual Studio Code
3. Sublime Text
4. Vim
5. Atom
6. Jupyter Notebook
7. Eclipse + PyDev + LiClipse
8. GNU Emacs
9. Spyder
10. Thonny
11. IDLE
Python Distributions
- Anaconda Python
- ActivePython
- CPython
- Enthought Canopy
- WinPython
Important Python Libraries
1. Matplotlib
2. Pandas
3. Requests
4. NumPy
5. SQLAlchemy
6. BeautifulSoup
7. Pyglet
8. SciPy
9. Scrapy
10. PyGame
11. Python Twisted
12. Pillow
13. pywin32
14. wxPython
15. iPython
16. Nose
17. Flask
18. SymPy
19. Fabric
20. PyGTK
Python Lect - 1
What is Python?
- Python is a high level programming language.
- Python is a Dynamically Type programming language.
- Python is a Strongly Type programming language.
- Python is a Scripting Language
- Python was created by Guido van Rossum, and released in 1991.
- Python is a simple, general purpose, high level, and object-oriented programming language.
- Python is an interpreted scripting language also.
Python is used for:
- Web development (server-side),
- Software development,
- Mathematics,
- System scripting.
- Data Science
- Date Mining
- Desktop Applications
- Console-based Applications
- Mobile Applications
- Software Development
- Artificial Intelligence
- Web Applications
- Enterprise Applications
- 3D CAD Applications
- Machine Learning
- Computer Vision or Image Processing Applications.
- Speech Recognitions
Python Popular Frameworks and Libraries
Python has wide range of libraries and frameworks widely used in various fields such as machine learning, artificial intelligence, web applications, etc. We define some popular frameworks and libraries of Python as follows.
- Web development (Server-side) - Django Flask, Pyramid, CherryPy
- GUIs based applications - Tk, PyGTK, PyQt, PyJs, etc.
- Machine Learning - TensorFlow, PyTorch, Scikit-learn, Matplotlib, Scipy, etc.
- Mathematics - Numpy, Pandas, etc.