Found 10476 Articles for Python

What is the preferred method to check for an empty array in NumPy?

Vikram Chiluka
Updated on 20-Oct-2022 09:39:20

22K+ Views

In this article, we will show you the preferred methods to check for an empty array in Numpy. NumPy is a Python library designed to work efficiently with arrays in Python. It is fast, simple to learn, and efficient in storage. It also improves the way data is handled for the process. In NumPy, we may generate an n-dimensional array. To use NumPy, we simply import it into our program, and then we can easily use NumPy's functionality in our code. NumPy is a popular Python package for scientific and statistical analysis. NumPy arrays are grids of values from ... Read More

What is PEP for Python?

Vikram Chiluka
Updated on 20-Oct-2022 09:36:15

3K+ Views

In this article, we will explain to you the PEP i.e Python Enhancement Proposal in Python. PEP is an abbreviation for Python Enhancement Proposal. A PEP is a design document that informs the Python community or describes a new feature for Python, its processes, or its environment. The PEP should provide a brief technical description of the feature as well as its reasoning. PEPs are intended to be the primary mechanisms for proposing important new features, gathering community input on a problem, and documenting Python design decisions. The PEP author is responsible for building consensus within the ... Read More

What are universal functions for n-dimensional arrays in Python?

Vikram Chiluka
Updated on 20-Oct-2022 09:02:11

882 Views

In this article, we will explain universal functions in python and how they are applied to n-dimensional arrays. A universal function (or ufunc) is a function that operates on ndarrays element by element, providing array broadcasting, type casting, and a variety of other standard features. A ufunc, in other words, is a "vectorized" wrapper around a function that accepts a fixed number of scalar inputs and returns a fixed number of scalar outputs. They are simple mathematical functions in the NumPy library. Numpy includes a number of universal functions that support a wide range of operations. These functions contain ... Read More

What are some features of Pandas in Python that you like or dislike?

Vikram Chiluka
Updated on 20-Oct-2022 08:56:08

377 Views

In this article, we will look at some of the features of pandas that people like and dislike Pandas Pandas is a Python data analysis library. Wes McKinney founded pandas in 2008 out of a need for a robust and versatile quantitative analysis tool, and it has grown to become one of the most used Python libraries. It has a very active contributor community. Pandas is built on the foundations of two essential Python libraries: matplotlib for data visualization and NumPy for mathematical calculations. Pandas function as a wrapper around these libraries, allowing you to use fewer lines of code ... Read More

List a few statistical methods available for a NumPy array

Vikram Chiluka
Updated on 20-Oct-2022 08:54:52

260 Views

In this article, we will show you a list of a few statistical methods of NumPy library in python. Statistics is dealing with collecting and analyzing data. It describes methods for collecting samples, describing data, and concluding data. NumPy is the core package for scientific calculations, hence NumPy statistical Functions go hand in hand. Numpy has a number of statistical functions that can be used to do statistical data analysis. Let us discuss a few of them here. numpy.amin() and numpy.amax() These functions return the minimum and the maximum from the elements in the given array along the specified axis. ... Read More

How to create a sparse Matrix in Python?

Vikram Chiluka
Updated on 20-Oct-2022 08:50:33

8K+ Views

In this article, we will show you what is a sparse matrix and how to create a sparse matrix in python. What is a sparse matrix? A sparse matrix is one in which most of the elements are 0. That is, the matrix only contains data in a few positions. And most of the memory consumed by a sparse matrix is made up of zeroes. For example − M = [ [1, 0, 0, 0], [0, 0, 3, 0], [0, 0, 0, 0], [0, 0, 0, 2] ] ... Read More

Python Program to calculate the logarithm gamma of the given number

Alekhya Nagulavancha
Updated on 14-Oct-2022 08:30:21

755 Views

In mathematics, the gamma function is said to be an extension to the factorial of any given number. However, as the factorial is only defined for real numbers, the gamma function exceeds to define the factorial on all complex numbers except the negative integers. It is represented by − Γ(x) = (x-1)! The logarithm gamma function comes into picture as the gamma function grows rapidly only larger numbers, so applying logarithm to the gamma will slow it down a lot. It is also known as the natural logarithm gamma of a given number. log(Γ(x)) = log((x-1)!) In python ... Read More

Python Program to calculate the volume and area of the Cylinder

Alekhya Nagulavancha
Updated on 14-Oct-2022 08:05:51

3K+ Views

In this article, we will look into a python program to calculate the volume and area of a cylinder. A cylinder is defined as a 3D object that has two circles connected with a rectangular surface. The special thing about a cylinder is that even though it is measured using just two dimensions, i.e. the height and radius, the cylinder is considered a three-dimensional figure as it is measured in xyz coordinate axes. The area of the cylinder is calculated is two ways− area of the lateral surface and area of the total surface. Lateral surface area is only the ... Read More

Python Program to calculate the volume of Cube

Alekhya Nagulavancha
Updated on 14-Oct-2022 07:57:45

6K+ Views

A cube is a three-dimensional solid figure with six faces, twelve edges and eight vertices. This geometrical figure has equal sized edges, hence making all its dimensions − length, width and height − equal. The idea of calculating the volume of a cube can be understood in a simple way. Consider a real-time situation where a person a moving houses. Suppose they use a hollow cube shaped cardboard box to place their things in it, the amount of space present to fill it up is defined as the volume. The mathematical formula to calculate the volume of a cube ... Read More

Python Program to calculate the area of Cube

Alekhya Nagulavancha
Updated on 14-Oct-2022 07:52:57

3K+ Views

To calculate the area of a cube, let us first revise the concept of a cube. A cube is a geometrical figure containing three dimensions: length, width, and height with all the dimensions having equal measurements. It has six square faces, four of which are lateral surfaces and the other two are the cube's top and bottom surfaces. The requirement to find the surface area is just knowing the length a single edge. The area of a cube is found using the following steps − Find the area of one square face with the given edge Four times ... Read More

Advertisements