Found 34469 Articles for Programming

Get the list of Files in a Directory with Size using Python

Asif Rahaman
Updated on 18-Jul-2023 13:54:39

897 Views

Directories are special kind of nodes in the computer system that contains other nested folders, files, etc. To list down the directories, we need special libraries or modules of Python like os module, glob module, etc. They also provide us the methods to access the size of the directory. The size of the directory is the space occupied by the directory in the computer ROM. In this article, we will explore how to get the list of files in a directory along with the size. Using OS Module The Python os module is a powerful tool that allows developers to ... Read More

Trapezoidal Numerical Integration without using trapz in MATLAB

Manish Kumar Saini
Updated on 18-Jul-2023 13:14:55

371 Views

Introduction to Trapezoidal Numerical Integration Trapezoidal numerical integration is a method used for finding the approximate value of a definite integral. It is also called as the trapezoidal rule. In the case of trapezoidal numerical integration method, we use trapezoids to calculate the area under a curve. In the trapezoidal rule, the total interval over which we want to integrate is divided into smaller subintervals. The area under the curve is then approximated in each subintervals by using trapezoids. After that the total area under the curve is estimated through the sum of the areas of sub-trapezoids. This ... Read More

Get the List of Files in a Directory Sorted by Size Using Python.

Asif Rahaman
Updated on 18-Jul-2023 13:52:54

302 Views

Directory contains special nodes in computer paths that hold information about other nested paths but do not contain any information. Since they contain files and other directories, they have some size. Sorting by size means ordering the directories in terms of the space occupied by the directories in the disks. In this article, we will explore several methods, like using the os module, glob module, etc. sorted, lambda functions, etc., to perform the same. Using the OS and Operator Modules The os module Python provides a way to interact with the operating System. It offers various functions for operating ... Read More

Load Text in Tensorflow

Siva Sai
Updated on 18-Jul-2023 18:34:47

166 Views

A well-known open-source framework called TensorFlow, created by Google, has established itself as a crucial resource in the field of deep learning and machine learning. It has strong and incredibly diverse data processing abilities, especially when working with text data. This article provides a thorough explanation of how to import text data into TensorFlow along with useful examples. Introduction to TensorFlow Data flow graphs are used to calculate numbers using the potent library TensorFlow. High-dimensional arrays (tensors) can be operated on using these graphs in order to conduct intricate mathematical operations. TensorFlow has been essential in improving artificial intelligence (AI) ... Read More

Load Testing Using LOCUST

Siva Sai
Updated on 18-Jul-2023 18:33:24

834 Views

Any application's performance must be evaluated and improved through load testing. We utilise it to assess whether our application can survive the demands of actual use. Locust is a potent tool in every developer's toolbox for efficient load testing. With this free, open-source Python programme, you can simulate millions of concurrent users and describe user behaviour using Python code. This article will serve as your comprehensive, example-filled guide to load testing using Locust. What is Locust? A distributed, scalable, and user-friendly load testing tool is called locust. Simulating traffic patterns aids engineers in understanding how many concurrent users a system ... Read More

Get Month from year and weekday using Python

Asif Rahaman
Updated on 18-Jul-2023 13:50:49

286 Views

Dealing with time is one of the most important aspects of any day−to−day activity. In this article, we will discuss how to get month from year and weekday using Python. We will utilize Python's two most popular libraries, namely calendar, and datetime, to deal with the months, year, s, etc. Both libraries provide several in−built methods to deal with time. We do not need to exclusively care for challenging tasks like leap year if we deal with such libraries. Using The Calendar Library The calendar library in Python provides useful functions and classes working with the calendar and the ... Read More

Load NumPy data in Tensorflow

Siva Sai
Updated on 18-Jul-2023 18:32:44

240 Views

Introduction TensorFlow, created by Google Brain, is one of the most prominent open-source machine learning and deep learning libraries. Many data scientists, AI developers, and machine learning aficionados use it because of its strong data manipulation skills and versatility. NumPy, on the other hand, is a popular Python library that supports big, multi-dimensional arrays and matrices, as well as a variety of mathematical functions that may be applied to these arrays. In many cases, importing your NumPy data into TensorFlow will allow you to take advantage of TensorFlow's robust computational capabilities. This post will go into great detail on the ... Read More

Read Words in a File in Reverse Order in MATLAB

Manish Kumar Saini
Updated on 18-Jul-2023 13:04:05

77 Views

Consider a text file containing a sentence “I Study MATLAB from Tutorials Point.” Now, we want to read these words of the text file in the reverse order, the result will be “Point Tutorials from MATLAB Study I.”. In this article, we will explore the implementation of MATLAB program to read words in a text file in reverse order. Algorithm: Read Words in a File in Reverse Order In MATLAB, we have to follow the following steps to read the words in a file in reverse order: Step 1 - Open the file for reading by calling the function ... Read More

Load JSON String into Pandas DataFrame

Siva Sai
Updated on 18-Jul-2023 18:31:24

426 Views

Introduction Understanding, purifying, and manipulating data to get insightful knowledge and make wise judgements is the art of data science and machine learning. This work is made simpler by Python's strong modules like Pandas and json. JSON, which stands for JavaScript Object Notation, is a well-liked web data exchange standard. On the other hand, Pandas DataFrames offer an effective structure for storing and modifying tabular data in Python. This article offers a thorough tutorial, replete with useful examples, on how to import JSON strings into a Pandas DataFrame. Prerequisites Make sure your Python environment has both the Pandas and json ... Read More

Load CSV data into List and Dictionary using Python

Siva Sai
Updated on 18-Jul-2023 18:28:39

3K+ Views

Introduction The CSV file format is a well-liked one for exchanging data between computers. A number of libraries are built into the versatile and adaptable programming language Python that can read and write CSV files. Lists and dictionaries are two of the most popular Python data structures, and they are excellent for storing CSV data for further processing and analysis. This article will walk you through the process of using Python to load CSV data into lists and dictionaries, using real-world examples to make the process easier to understand. Loading CSV Data into a Python List The csv module that ... Read More

Advertisements