Python - Basic Articles
File handling in Python is a powerful and versatile tool that can be used to perform a wide range of operations. However, it is important… Read More
When it comes to Product Based Companies, they need good coders and one needs to clear the Competitive Coding round in order to reach the… Read More
The numpy.random.randn() function creates an array of specified shape and fills it with random values as per standard normal distribution. If positive arguments are provided, randn… Read More
Prerequisites : list and Deque in Python. Unlike C++ STL and Java Collections, Python does have specific classes/interfaces for Stack and Queue. Following are different… Read More
The NumPy.linspace() function returns an array of evenly spaced values within the specified interval [start, stop]. It is similar to NumPy.arange() function but instead of… Read More
The numpy.ndarray.flat() function is used as a 1_D iterator over N-dimensional arrays. It is not a subclass of, Python’s built-in iterator object, otherwise it a numpy.flatiter… Read More
The numpy.isinf() function tests element-wise whether it is +ve or -ve infinity or not return the result as a boolean array.  Syntax: numpy.isinf(array [, out])… Read More
In python matrix can be implemented as 2D list or 2D Array. Forming matrix from latter, gives the additional functionalities for performing various operations in… Read More
Since there is no main() function in Python, when the command to run a python program is given to the interpreter, the code that is… Read More
Python 3 is a popular high-level programming language used for a wide variety of applications. Here are some basics of Python 3 that you should… Read More
The numpy.compress() function returns selected slices of an array along mentioned axis, that satisfies an axis. Syntax: numpy.compress(condition, array, axis = None, out = None)… Read More
The numpy.one_like() function returns an array of given shape and type as a given array, with ones. Syntax: numpy.ones_like(array, dtype = None, order = 'K',… Read More
1) What is the output of the following program?  PYTHON L = list('123456') L[0] = L[5] = 0 L[3] = L[-2] print(L) a) [0, ‘2’,… Read More
The numpy.full_like() function return a new array with the same shape and type as a given array.Syntax :   numpy.full_like(a, fill_value, dtype = None, order =… Read More
This class returns a matrix from a string of data or array-like object. Matrix obtained is a specialised 2D array. Syntax : numpy.matrix(data, dtype =… Read More
numpy.full(shape, fill_value, dtype = None, order = ‘C’) : Return a new array with the same shape and type as a given array filled with… Read More
Ever thought about writing a script which prints its own name when you execute it. It’s pretty simple. You must have noticed programs in which… Read More
Python sorted() function returns a sorted list. It is not only defined for the list and it accepts any iterable (list, tuple, string, etc.). Example… Read More
numpy.eye(R, C = None, k = 0, dtype = type <‘float’>) : –The eye tool returns a 2-D array with  1’s as the diagonal and… Read More
Often, when dealing with iterators, we also need to keep a count of iterations. Python eases the programmers’ task by providing a built-in function enumerate()… Read More