Found 34462 Articles for Programming

How to set a seaborn chart size?

Tapas Kumar Ghosh
Updated on 17-Jul-2023 17:16:30

259 Views

Seaborn is a Python data visualization library based on Matplotlib. It provides beautiful default styles and color palettes to make statistical plots more attractive. It is also closely integrated with the data structures from Pandas. Seaborn aims to make visualization the central part of exploring and understanding data. This type of charts allows users to switch between different visual representations for the same variables for a better understanding of the dataset. Seaborn is used in various applications for visualizing the relationship between variables, examining univariate and bivariate distributions, and more. A univariate distribution shows the distribution of a single variable, ... Read More

How to slice a 3D Tensor in Pytorch?

Tapas Kumar Ghosh
Updated on 17-Jul-2023 17:12:36

1K+ Views

The 3D Tensor in Python is known for its array of matrices whereas the 1D and 2D Tensor represents vector and matrix respectively. The Pytorch is defined by an open-source module of machine learning framework based on Python programming and it provides the module named torch. In Python, we have some built-in functions like randn(), rand(), and split() that can be used to represent the slice of a 3D tensor in Pytorch. Syntax The following syntax is used in the examples − import torch This is a Python module that holds the base class of all neural networks. It ... Read More

How to skip rows while reading csv file using Pandas

Tapas Kumar Ghosh
Updated on 17-Jul-2023 17:10:52

2K+ Views

Python has a built-in method read_csv that can be used to set the skip rows while reading csv file using Pandas. The CSV stands for Comma Separated Values and is known as an extension of a file that contains the database. This technique can be used in any application that involves reading and processing data from a CSV file. The various application used like data filtering, excel tool, etc. Syntax The following syntax is used in the examples − read_csv('file_name.csv', skiprows= set the condition according to user choice) This is a built-in function of the pandas module that can ... Read More

How to Show Values on Seaborn Barplot?

Tapas Kumar Ghosh
Updated on 17-Jul-2023 17:07:37

4K+ Views

In Seaborn's barplot, the average value of a numerical variable is displayed, while error bars indicate the range of possible values surrounding the average. When comparing values to 0, it is helpful. In Python, we have some built-in functions like barplot(), enumerate(), and, text() that can be used to Show Values on Seaborn Barplot. For example, we might compare the average sales of various products or the average test results of students in various classrooms using a barplot. Syntax The following syntax is used in the examples − barplot() This is an in-built function in Python that will use to ... Read More

Python Program to display date in different country format

Tapas Kumar Ghosh
Updated on 17-Jul-2023 17:05:54

566 Views

In Python, we have some time in-built functions like datetime.now(), utcnow(), astimezone(), and strftime() that can be used to display time in the different country formats. In this program, we will use the modules namely datetime(to access all content related to date and time) and pytz(allows for timezone calculation and conversion of datetime). To get the timezone of different countries the UTC will be set by an in-built function named utcnow(). The problem statement follows some built-in functions of Python such as datetime.now(), utcnow(), astimezone(), and strftime() that will be used to display time in different country formats. Syntax The ... Read More

Python program to get the individual components of the current date-time

Tapas Kumar Ghosh
Updated on 17-Jul-2023 17:01:57

198 Views

In Python, we have some time in-built functions i.e. datetime(), today(), now(), and strftime() that can be used to get the individual components of the current date-time. The individual component of the current date-time means the exact present timing and date. To solve this type of problem we will use some predefined method related to the module datetime. For example- The current date and time are important for any work culture. Syntax The following syntax is used in the examples are − datetime.now() This is a predefined method used in Python that includes years, months, days, hours, minutes, and, ... Read More

Multitasking Operating System

Diksha Patro
Updated on 14-Jul-2023 16:36:27

2K+ Views

Introduction An OS that can manage numerous duties or procedures at once is known as a multitasking operating system. In simple terms, it enables the simultaneous operation of numerous programs or procedures while allocating a specific amount of memory and central processing time to each process. Every task's distribution of resources is controlled by the operating system's kernel, which also ensures that no tasks conflict with one another. Additionally, it offers a way to move among duties rapidly, giving the impression that every process is active at once. Contemporary systems for computing, which include personal computers, laptops, computer systems, and ... Read More

Multistep Processing of a User Program

Diksha Patro
Updated on 14-Jul-2023 16:31:13

355 Views

The computer system must convert a user's high-level programming language program into machine code so that the computer's processor can run it. Multistep processing is the term used to describe the several processes involved in converting a user program into executable code. A user program will often go through a number of various phases during its multistep processing, including lexical analysis, syntactic analysis, semantic analysis, code creation, optimization, and linking. In order to convert the user program from its high-level form to machine code that can be run on a computer system, each of these stages is essential. User ... Read More

Breadth First Search without using Queue

Ayush Singh
Updated on 17-Jul-2023 10:06:09

341 Views

Breadth To begin with, Look (BFS) may be a chart traversal calculation utilised to investigate hubs in a chart in a breadthward movement. The normal usage of BFS utilises a line information structure to keep track of hubs to come. In any case, it is conceivable to execute BFS without utilising an unequivocal line by utilising other information structures. One elective approach to actualizing BFS without a line is to utilise two clusters or records: one for the current level of hubs being investigated and another for the next level of hubs to be investigated. At first, the current level ... Read More

Shortest path in a graph from a source S to destination D with exactly K edges for multiple Queries

Ayush Singh
Updated on 17-Jul-2023 11:54:14

321 Views

Finding the shortest route between a source vertex and a target vertex in a graph with precisely K edges is one of the most typical graph traversal issues. The objective is to find the shortest path with minimum weight and exactly K edges. This issue can manifest in a number of practical contexts, including transportation networks, routing protocols, and resource allocation. Dynamic Programming (DP), and Dijkstra's Algorithm are just some of the strategies that may be used to attack this issue. The shortest path under the given constraints can be found using one of many methods. Dijkstra's Algorithm takes into ... Read More

Advertisements