Posts

Showing posts with the label Python Programming

Plotting and visualization with python using matplotlib

Image
  Course content: A brief matplotlib API primer: Colors, Markers, and Line styles. Figures and Subplots. Ticks, labels, legends, and saving plots to file. Different plots using matplotlib, pandas, and seaborn: Line & bar plots. Histograms & density plots. Scatter or point plots. Facet grids and categorical data. Overview: Making informative visualizations (sometimes called plots) is one of the most important tasks in data analysis. It may be a part of the exploratory process—for example, to help identify outliers or needed data transformations, or as a way of generating ideas for models. Python has many add-on libraries for making static or dynamic visualizations, we will mainly be focused on matplotlib and libraries that build on top of it. matplotlib is a desktop plotting package designed for creating (mostly two dimension...

Pandas with Python

Image
  Hello everyone!!!! So in this blog, we are going to learn about pandas..... So let's get started..... Course content: Introduction to pandas Data Structures Series  DataFrame Re-indexing Operation between series and dataframe Sorting and Ranking Descriptive statistics  Data loading, storage, and file formats Introduction to Pandas: Pandas is an open-source, BSD-licensed Python library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language. Python with Pandasis used in a wide range of fields including academic and commercial domains including finance, economics, statistics, analytics, etc. Fast and efficient DataFrame object with default and customized indexing. Tools for loading data into in-memory data objects from different file formats....

Numpy with python

Image
  Welcome back!!! Hello everyone in previous chapters we learn about python basic and some intermediate concepts, but from now we are going to deal with advanced concepts of Python like NumPy, pandas, deep learning, neural network, etc. In this chapter, we are going to learn NumPy So let's get started......... Course content: Numpy overview Creating ND-arrays Class and attributes of ND-arrays object Operation between array and scalar Basic, Boolean and fancy indexing Universal functions File input and output with arrays Broadcasting What is Numpy? NumPy is an acronym for "Numeric Python" or "Numerical Python". It is an open-source extension module for Python, which provides fast precompiled functions for mathematical and numerical routines ...

Assignment on File, Date Time And Exception Handling in python

Image
  Hello Everyone.......! It's time for an assignment. This assignment is based on chapters 5,6,7 and 8 File, Date-Time, And Exception Handling in Python. I am providing you a file just download it and perform the activity. TEXT file 469KB ## File, Date Time and Exception Handling ## 1. Write code that stores the contents of the months list in a file named months.txt. Store one month per line. months = ['January','February','March','April' , .. ,'December'] 2. The following sample file called score.txt contains one line for each student in an a class. The students name is the first thing on each line, followed by some exam scores. The number of scores might be different for each student. score.txt => Swaroop 10 15 20 30 40 Vikas 23 16 19 22 Durva 8 22 17 14 32 17 24 21 2 9 11 17 Vedika 12 28 21 45 26 10 Shubham 14 32 25 16 89 Using the text file score.txt write a program that prints out the names of stude...

Assignment on Object Oriented Programming in python

Image
Hello Everyone.......! Now it's time for the assignment. This assignment is based on chapter 4 Object Oriented Programming in python. ## Object Oriented Programming ## (1) Create the Rocket class as per the following details. ? Define the Rocket() class. ? Define the init () method, which sets an x and a y value for each Rocket object. ? Define the move_up() method. ? Create a Rocket object. ? Print the object. ? Print the object's y-value. ? Move the rocket up, and print its y-value again. (2) There are enough new concepts here that you might want to try re-creating the Rocket class as it has been developed so far. Re-create the Rocket class as it has been developed so far: ? Define the Rocket() class. ? Define the _init _() method. Let your _init _() method accept x and y values for the initial position of the rocket. Make sure the default behavior is to position the rocket at (0,0). ? Define the move_rocket() method. The method should accept an amount to move left or...

Assignment on data types in python

Image
  Hello Everyone.......! It's time for practice and tests your knowledge this assignment is based on chapter 3 data types in python. ## Data Types in Python ## 1. Write a Python program to sum all the items in a list (of integers) 2. Write a Python program to get the largest number from a list (of integers) 3. Write a Python program to get a list, sorted in increasing order by the last element in each tuple from a given list of non-empty tuples. Sample List: [(2, 5), (1, 2), (4, 4), (2, 3), (2, 1)] Expected Result: [(2, 1), (1, 2), (2, 3), (4, 4), (2, 5)] 4. Write a Python function that takes two lists and returns True, if they have at least one common member. 5. Write a Python program to convert a list of characters into a string. 6. Suppose you have the list: ['dog', 'pencil', 'fence', 'dog', 'apple', 'dog', 'dog', 'dog', 'pear', 'pencil', 'pear', 'pear'] Using a dictionary, co...

Assignment on functions in python

Image
  Hello Everyone........! It's time for an assignment that is based on the chapter 1 function and modules in python. ## Functions in Python ## 1. Try implementing the factorial function using either a “while” loop or a “for” loop. Which do you think is better? Which do you think is easier to understand? 2. Write a function which squares a number and then use it to write a function which takes three integers and returns the sum of their squares. 3. Write a function which prints the natural numbers less than “n” (input value) which are divisible by 3, divisible by 5 but not divisible by 10. 4. Write a Python program to print the even numbers from a given list. 5. Write Recursive function to return GCD of a two numbers. Best regards from, msbtenote:) THANK YOU!

Assignment on Operators & Control Structures In Python

Image
  Hello guys......! Now it's time for the assignment. This assignment is based on chapter 2 operators and control structures in python. ## Operators & Control Structures In Python ## 1. Write a continuous while loop where you take the integer input from command prompt one by one, And if the number n is odd print "Number is odd" else print "Number is even". End the loop when Zero is entered. 2. Write a continuous while loop where you take the integer input from command prompt. The loop will continue to print "you are great", on each input integers except 8. On receiving 8, it should break the loop and print "out of loop". 3. Write a big block structure file, which when runs gives the following output ################## ## 1. Name ## ## 2. Age ## ## 3. Exit ## ################## What is you option : _ _ This program should continuously run until option 3 is not given. When option 1 is given it will ask for “Enter your Name” and pr...

Python chapter 7 File handling in python

Image
  Welcome back......! So we are going to learn chapter 7 of python file handling it is an important topic so give full attention and look carefully. Course content Opening a file-Read, Write & Append mode. Read and write operations on the file. Other file operations. The pickle (Serialize and De-serialize python objects) Ths OS module. Opening a file In python open() is the function used to open the file. These are 3 modes of file opening Read-r, rb Write-w, wb Append-a, ab f=open('abc.txt','r') print(f.read()) f.close() Output=This is a 3rd line This is a 4th line f=open("abc.txt","w") f.write("This is newline") f.close() f=open('abc.txt','r') print(f.read()) f.close() Output=This is newline Reading operations In python, after opening the file in read mode one can perform the follo...

Python chapter 8 Exception handling in python

Image
  Welcome back.......! In this chapter 8, we are going to learn exception handling in python. This is the last chapter of the python basic course, from the next chapter we will learn the advanced concepts and powerful libraries like pandas, NumPy,matplotib, seaborn, etc. So let's get started...... Course content: What is an exception? Handling an exception. The except clause with no exceptions. The except clause with multiple exceptions. The try-finally clause. The argument of an exception. Raising an exception. What is an exception? Python provides a very important feature to handle any unexpected error in your Python programs and to add debugging capabilities in them called Exception.  An exception is an event, which occurs during the execution of a program that disrupts the normal flow of the program's instructions. In general, when a Python script encounters a situatio...