0% found this document useful (0 votes)
58 views4 pages

L

This document contains summaries of various Python concepts including: 1. Classes and objects in Python define templates for objects with attributes and methods while objects are instances of classes that allocate and initialize attributes. 2. The __init__() function in Python is used to initialize object attributes and is called automatically whenever a new object is instantiated. 3. Mutable objects like lists can be changed in place while immutable objects like strings or tuples cannot be changed once created. 4. Polymorphism in Python allows defining common interfaces for different object types as well as methods with the same name but different implementations. 5. Pandas melt, pivot and merge methods are used for data reshaping and merging DataFrames.

Uploaded by

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

L

This document contains summaries of various Python concepts including: 1. Classes and objects in Python define templates for objects with attributes and methods while objects are instances of classes that allocate and initialize attributes. 2. The __init__() function in Python is used to initialize object attributes and is called automatically whenever a new object is instantiated. 3. Mutable objects like lists can be changed in place while immutable objects like strings or tuples cannot be changed once created. 4. Polymorphism in Python allows defining common interfaces for different object types as well as methods with the same name but different implementations. 5. Pandas melt, pivot and merge methods are used for data reshaping and merging DataFrames.

Uploaded by

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

What Are Classes and Objects in Python?

Differentiate class members with object members.

Explain _init_() Function in Python

Fill the underline with python statement in the following program to invoke except
block.

try:

num=10

print(num)

------------------

except:

print(‘Self Exception’)

Mutable and Immutable Objects in Python

Differentiate ‘Abstraction’ property of object oriented paradigm with


‘Encapsulation’

Run time ,Compile time Polymorphism

Explain Python pandas melt, pivot, merge methods

Differentiate Python Numpy ’dot’ method with ‘mul’ method.


try:

import math

print(math.exp(1000))

except OverflowError:

print ("OverFlow Exception Raised.")

else:

print ("Success, no error!")

o/p;

Develop a Python program to perform addition, subtraction, multiplication,


division and modules operations on two Pandas Data frame row wise and column
wise.

. Develop a python polymorphism program by overloading ‘+’ and ‘* ‘


operators. Where ‘+’ operator provides string concatenation and ‘* ‘ operator
provides concatenation of strings in their uppercase letters (e.g’abc’ * ’efc’ =
‘ABCEFC’)

Develop a python program to demonstrate Multi Path Inheritance with


respect to variables and methods using the example illustrated in following
diagram (PTO).
Develop a python program to transform the following table into Pandas data
frames and print aggregated sum of ‘Sales’ values group by ‘Salesman’ values.

Sales table:

Salesman Sales Quarter District

Akshit 1000 1 Kangra

Jaswant 300 1 Hamirpur

Karan 800 1 Kangra

Akshit 1000 2 Mandi

Jaswant 500 2 Hamirpur

Karan 60 2 Kangra

Differentiate Matplotlib Bar chats with Matplotlib Histogram chats with suitable
Python programs for both the graph types.

Analyze how python Ufunctions get computation time efficiency by


implementing Vectorization approach using Python program for addition of two
arrays with and without using Ufunction add().

Develop a python program to insert values into a table ‘BanCust’ of SQLite


database with attributes AccNo(Primary key), AccName, Balance.
Update above table with one credit and one debit operations.

Differentiate Panda Series with Numpy arrays with suitable Python programs for
both the data structures.

Develop a python program to demonstrate a catch block with multiple


exception, exception block without specific exception and else block.

Differentiate options in slicing operation of Python Numpy by interpreting


outputs to the following python commands.

Myarray = np.array([10 , 20 , 30, 40 , 50 ,60] )

print(Myarray[1:4:1])

print(Myarray[:3:1])

print(Myarray[0::1])

print(Myarray[::])

print(Myarray[-4:-1:1])

print(Myarray[4:1:-1])

Develop a python program to copy one file content into another file.

Demonstrate Python connectivity to Twitter API using Sqlite database with your
own example.

You might also like