U18AI406_Python_Programming_Theory (2)
U18AI406_Python_Programming_Theory (2)
Class: B.Tech. IV-Semester Branch: Computer Science & Engineering (AI & ML)
Teaching Scheme : Examination Scheme :
L T P C Continuous Internal Evaluation 40 marks
3 - - 3 End Semester Examination 60 marks
LO1: basics of python programming, operators, control statements & functions in Python
LO2: namespaces, modules, collections, string handling methods & regular expressions
LO3: object oriented programming, inheritance, polymorphism, files& database connectivity using SQLite
LO4: Numpy, Pandas and Matplotlib libraries of Python
UNIT-I (9)
Introduction: Features of Python, The future of Python, Writing and executing Python programs
Python Preliminaries: Literal constants, Variables and identifiers, Data types, Input operation, Comments,
Reserved words, Indentation, Operators, Expressions in Python, Type conversion
Decision Control Statements: Selection/Conditional branching statements, Loop structures/ iterative
statements, Nested loop, the continue statement, the pass statement, the else statement used with loops
Functions: Function definition, Function call, Variable scope and lifetime, the return statement, Advances
in defining in functions, Lambda functions, Recursive functions
UNIT-II (9)
Modules and Name Spaces: dir() function, Packages in
Python, Standard library modules, globals(), locals(), and reload(), Function redefinition
Python Strings: String operations, String formatting operator, Built-in string methods and functions, slice
operation, ord() and Chr() Functions, in and not in operators, Comparing strings, Regular expressions and
meta characters
Data Structures: Sequences, Lists, Tuple, Sets, Dictionaries
UNIT-III (9)
Python Object Oriented Programming: Classes and objects, Class method and self-argument, The
__init__() method, Class variables and object variables, The __del__() method, Public and private data
members, Private methods, Calling a class method from another class method, Built-in class attributes, Class
methods, Static methods, Inheritance and polymorphism, Error and Exception handling
Files: Opening and closing files, Reading and writing files, File positions, Renaming and deleting files,
Directory methods
Database Connectivity: Database browser for SQLite, Creating a database table, Insert and retrieve data
from database
Case Study: Twitter spidering
UNIT-IV (9)
NumPy: The basics of NumPy arrays, Array indexing, Array slicing, Reshaping of array, Concatenation
and splitting arrays, Introducing UFuncs
Data Manipulation with Pandas: Installing and using Pandas, Introducing Pandas objects, data indexing
and selection, Handling missing data, Combining datasets, Merge and join, Aggregation and grouping
Visualization with Matplotlib: Importing Matplotlib, Saving figures to files, Simple line plots, Simple
scatter plots, Histograms, Binnings, and density, Example-Handwritten digits, Text and annotations
Example-Effects of holidays on US births, Geographic data with basemap, Plotting data on maps, Example-
California cities
Reference Books:
[1] Dr.Charles R. Severance, Python for Everybody-Exploring Data Using Python, open book, 2016.
[2] David Beazley, Python Cookbook, 3rd ed., California: O'Reilly Media, Inc., 2013.
[3] Caleb Hattingh, 20 Python Libraries You Aren't Using (But Should), 2nd ed., California: O'Reilly Media,
Inc., 2016.
[4] Magnus Lie Hetland, Beginning: from Novice to Professional, New York City: A press, 2005.
Course Research Papers: Research papers (Indexed Journals/conference papers) relevant to the course
content will be posted by the course faculty in Course Web page.
Course Patents: Patents relevant to the course content will be posted by the course faculty in Course Web
page.
Course Projects: Course project is an independent project carried out by the student during the course
period, under the supervision of course faculty. Course faculty will post few course projects titles in Course
Web page. Students are encouraged to come up and experiment with the ideas that interest them.
CO1: make use of syntax, control statements, operators and functions for writing basic python programs
CO2: design programs using collections, namespaces, packages, strings& regular expressions
CO3: develop python programs using object oriented programming principles, files & database handling
mechanisms
CO4: build visualization graphs with Matplotlib and adapt packages like Numpy or Pandas for statistical
analysis & data handling
CO2 U18AI406.2
1 1 2 1 2 1 - 1 1 1 - 2 2 1 1
CO3 U18AI406.3 2 2 2 2 3 1 - 1 1 1 - 2 2 2 1
CO4 U18AI406.4
2 2 2 2 3 1 - 1 1 1 - 2 2 2 2