Found 34472 Articles for Programming

Difference Between CORBA and RMI

Md. Sajid
Updated on 10-Jul-2023 19:37:31

1K+ Views

CORBA (Common Object Request Broker Architecture) and RMI (Remote Method Invocation) are middleware technologies used in Java to support distributed computing. CORBA (Common Object Request Broker Architecture) is a middleware technology that allows distributed objects in a networked environment to communicate with one another. RMI (Remote Method Invocation) is a middleware technology that allows Java objects to invoke methods on remote JVM (Java Virtual Machine) objects. Read this article to find out more about CORBA and RMI and how they are different from each other. What is CORBA? CORBA (Common Object Request Broker Architecture) is a middleware technology that allows ... Read More

How to save a NumPy array to a text file?

Rohan Singh
Updated on 11-Jul-2023 13:57:37

17K+ Views

The Numpy array can be saved to a text file using various methods like the savetxt() method, save() method, and dataframe.to_csv() function. Numpy is a Python library that is used to do the numerical computation, manipulate arrays, etc. In this article, we will discuss the methods that can be used to save a numpy array to a text file. Method 1: Using the numpy.savetxt() function The numpy.savetxt() function simply saves the numpy array to a text file. The function takes two arguments - the file name in which the numpy array is to be saved and the array itself. ... Read More

How to Run Python Flask App Online using Ngrok?

Rohan Singh
Updated on 11-Jul-2023 13:54:17

4K+ Views

Ngrok is a tool that is used to create a secure tunnel between your local machine and the internet. It is used to test the web application and allows developers to expose their local web server to the internet without having to deploy it to a remote server. Python Flask allows you to create web applications locally but we might want to showcase it to the world by running it online. In this article, we will use the Ngrok tool to run the web application online without hosting it on any server. The Steps to Run Python Flask App Online ... Read More

How to run multiple Python files in a folder one after another?

Rohan Singh
Updated on 11-Jul-2023 13:52:19

8K+ Views

The subprocess module can be used to run multiple Python files in a folder one after another. Running multiple files one after another is required in various situations like when processing large data sets or performing complex analysis. In this article, we will discuss the steps involved in running multiple Python files in a folder sequentially with examples. Method 1: Using the subprocess() method Steps for creating and running multiple Python files sequentially Step 1: Create multiple Python files to run We need to have three Python files in a folder to run them sequentially. So the first step ... Read More

How to round array elements to the given number of decimals using NumPy?

Rohan Singh
Updated on 11-Jul-2023 13:25:57

386 Views

The round() function of the Numpy library is used to round array elements to the given number of decimals. Numpy is a Python library that is used to perform mathematical operations, manipulation, and creation of arrays, etc. In this article, we will use the round() function to round array elements to the given number of decimals. Method 1: using round() function Syntax of round() function numpy.round(arr, decimals=0, out=None) Here, arr is the input array to be rounded, decimal is the number of decimal places the elements of the array are to be rounded. By default, the decimal value is ... Read More

How to rotate the X label using Pygal?

Rohan Singh
Updated on 11-Jul-2023 12:22:27

115 Views

Pygal is a Python library that is used to create interactive, customizable charts and graphs. We can rotate the x-axis label using the x_label_rotation attribute in the Pygal module. The rotation of the x-axis label makes the chart easier to read and comprehend. In this article, we will discuss how to rotate the x-label using Pygal with an example. Algorithm A general algorithm for rotating the x label using pygal is given below − Import the Pygal module. Create a chart object (e.g., Bar, Line, Pie, etc.). Add data to the chart using the add method. Set the x-axis ... Read More

How to Rotate and Scale images using PyGame?

Rohan Singh
Updated on 11-Jul-2023 12:20:02

2K+ Views

We can Rotate and scale an image in Pygame using pygame.transform.rotate and pygame.transform.scale function respectively of the Pygame module. The Function is used to rotate an image by a given angle in Degrees. The function takes two parameters - the image to rotate and the angle of rotation. In this article, we will use the pygame.transform.rotate and pygame.transform.scale function to rotate and scale the image respectively. Rotate an image in Pygame Algorithm Rotating an Image in Pygame − Import the pygame library. Initialize Pygame by calling pygame.init(). Set the screen size using pygame.display.set_mode(). Load the image to rotate ... Read More

How to Retrieve an Entire Row or Column of an Array in Python?

Rohan Singh
Updated on 11-Jul-2023 14:41:44

4K+ Views

Python provides various in-built methods to retrieve an entire row or column of an array. We can use the Slice notation method, Numpy Library, list comprehension, and for loop to retrieve the entire row or column of an array. In this article, we will explore all the methods with examples to retrieve the row or column of an array. Method 1: Using Slice Notation Using slice notation we extract a subset of elements from an array. We use the “:” notation to specify the start and end index of the subset. To retrieve an entire row or column we ... Read More

How to reshape Pandas Series?

Rohan Singh
Updated on 11-Jul-2023 14:45:12

2K+ Views

We can reshape the Pandas series using ways like Transpose, reshape method, and melt function. A Pandas Series is a one-dimensional labeled array that can hold data of any type (integer, float, string, etc.). It is similar to a NumPy array but has an index associated with each element that can be used to access individual values. Reshaping refers to changing the shape or structure of the Pandas series for using the data in various ways. Algorithm The general algorithm to Reshape Pandas Series using different methods is as follows − Create a Pandas Series with some data. ... Read More

How to resample a NumPy array representing an image?

Rohan Singh
Updated on 11-Jul-2023 14:48:51

1K+ Views

Resampling a Numpy array representing an image is the process of changing the size of the array while maintaining the quality of the image. We can resample an array using interpolation, decimation, and upsampling techniques in Python. We can use the ndimage.zoom() function for Scipy library in Python to resample a Numpy array representing an image. In this article, we will understand how to resample a Numpy array representing an image using the Scipy module in Python. Interpolation Interpolation is a technique used to estimate values between existing data points. In Numpy we have several interpolation methods like liner, ... Read More

Advertisements