
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

286 Views
Python has extensive availability of various libraries and functions which make it so popular for data analysis. We may get a need to sum the values in a single column for a group of tuples for our analysis. So in this program we are adding all the values present at the same position or same column in a series of tuples.It can be achieved in the following ways.Using for loop and zipUsing the for loop we loop through each item and apply zip function to gather the values from each column. Then we apply the sum function and finally get ... Read More

2K+ Views
Pandas is a python library offering many features for data analysis which is not available in python standard library. One such feature is the use of Data Frames. They are rectangular grids representing columns and rows. While creating a Data frame, we decide on the names of the columns and refer them in subsequent data manipulation. But there may be a situation when we need to change the name of the columns after the data frame has been created. In this article, we will see how to achieve that.Using rename()This is the most preferred method as we can change both ... Read More

2K+ Views
Finding maximum and minimum values from a given list of values is a very common need in data processing programs. Python has these two functions which handle both numbers and strings. We will see both the scenarios in the below examples.Numeric ValuesWe take a list of numeric values which has integers and floats. The functions work appropriately to give both the max and the min values.Example Live Demox=[10, 15, 25.5, 3, 2, 9/5, 40, 70] print("Maximum number is :", max(x)) print("Minimum number is :", min(x))OutputRunning the above code gives us the following result:Maximum number is : 70 Minimum number is : ... Read More

20K+ Views
For the purpose of data encapsulation, most object oriented languages use getters and setters method. This is because we want to hide the attributes of a object class from other classes so that no accidental modification of the data happens by methods in other classes.As the name suggests, getters are the methods which help access the private attributes or get the value of the private attributes and setters are the methods which help change or set the value of private attributes.Accessing Private AttributeBelow we write code to create a class, initialize it and access it variables without creating any additional ... Read More

979 Views
Fractal patterns are all around us in nature. Like a small branch taken out of the leaf of a fern leaf resembles the leaf itself. Or a pebble often resembles the shape of a mountain! So this idea of a repetition of small pattern to generate a large pattern is known as a fractal tree. In python programming we can also generate fractal trees by using various modules available.Using pygame ModuleThis module provides us with the required functions to generate the fractal trees. Here we first defines the screen layout size and then define the deepness up to which the ... Read More

2K+ Views
Decision tree is an algorithm which is mainly applied to data classification scenarios. It is a tree structure where each node represents the features and each edge represents the decision taken. Starting from the root node we go on evaluating the features for classification and take a decision to follow a specific edge. Whenever a new data point comes in , this same method is applied again and again and then the final conclusion is taken when all the required features are studied or applied to the classification scenario. So Decision tree algorithm is a supervised learning model used in ... Read More

371 Views
Every programming language has feature to handle the exception that is raised during program execution. In python the keyword assert is used to catch an error and prompt a user defined error message rather than a system generated error message. This makes it easy for the programmer to locate and fix the error when it occurs.With AssertIn the below example we use the assert key word to catch the division by zero error. The message is written as per the wish of the programmer.Example Live Demox = 4 y = 0 assert y != 0, "if you divide by 0 it ... Read More

224 Views
In this article we will see how to take a list which contains some odd numbers as its elements and then add those odd elements repeatedly into the same list. Which means if odd number is present twice in a list then after processing the odd number will be present four times in that same list.For this requirement we will have many approaches where we use the for loop and the in condition or we take help of of itertools module. We also check for the odd condition by dividing each element with two.Example Live Demofrom itertools import chain import numpy ... Read More

237 Views
When using Python for data manipulation we frequently and remove elements from list. There are methods which can do this effectively and python provides those function as part of standard library as well as part of external library. We import the external library and use it for this addition and removal of elements. Below we will see two such approaches.Using + operatorExample Live Demovalues = ['Tue', 'wed', 'Thu', 'Fri', 'Sat', 'Sun'] print("The given list : " ,values) #here the appending value will be added in the front and popping the element from the end. result = ['Mon'] + values[:-1] print("The values ... Read More

860 Views
Slicing is used to extract a portion of a sequence (such as a list, a tuple, string) or other iterable objects. Python provides a flexible way to perform slicing using the following syntax. list[start:stop:step] Alternate Range Slicing The alternate range slicing is used to retrieve the elements from a list by skipping the elements at a fixed interval, using the step parameter. For example, if we want every second element from a list, we set step=2. Let’s observe some examples to understand how alternate range slicing works. Example 1 Consider the following ... Read More