Found 10784 Articles for Python

How to pass multiple arguments to a map function in Python?

Vishal Gupta
Updated on 29-Sep-2023 10:50:46

990 Views

The map function is an in−built function in Python, which applies a given function to each and every element in an iterable (list, tuple, etc.) and returns an iterator of the result in the list. We can also use multiple arguments in the map function. Syntax This syntax is used in all the following examples − map(function, argument1, argument2, .....) Method 1: Use multiple arguments with map function Example write a program to add two list elements with the help of map function. def add(a, b): return a + b # Create two lists list1 ... Read More

path_curve_to_quadratic_bezier() function in Python Wand

Vishal Gupta
Updated on 29-Sep-2023 14:01:10

162 Views

The bezier is an inbuilt drawing function in python. It is used to draw curves in python according to given points. The quadratic bezier is a Python function that draws a path through vertices( control points) for a quadratic bezier wind. A quadratic Bezier wind is a parametric wind that defines a path in 2- dimensional space. This wind is linked by a control point with two ending points. In a visualisation programme, you may construct and draw easily using this function. With the use of the time parameter, you may locate two control points and determine their locations. You ... Read More

How to Split a File into a List in Python?

Tushar Sharma
Updated on 09-Aug-2023 18:42:14

213 Views

Python, a sophisticated, all-purpose coding language, has emerged as the universal dialect in many spheres, particularly analytics, internet creation, automation, and beyond. Its inherent accessibility and adaptability have made it a top choice for beginners and coders alike. One of Python's unparalleled strengths is its ability to manipulate documents, allowing users to read, compose, edit, and organize documents with amazing ease. In this discourse, we'll explore one such facet: dissecting a document into an array. Comprehending Documents and Arrays in Python In the realm of Python, a document represents a specified location on storage media where relevant data ... Read More

How to Speedup Pandas with One-Line change using Modin?

Tushar Sharma
Updated on 09-Aug-2023 18:41:11

74 Views

Data is considered the new oil in this information era. Python, with its extensive libraries, is one of the leading programming languages for data analysis, and Pandas, a Python library, is its crown jewel. However, as datasets have ballooned, Pandas users have found their workflows hampered by its relatively slow execution on large datasets. Fortunately, there's a way to vastly improve Pandas performance using a single line of code with Modin. A Primer on Pandas and Modin Pandas, an open-source Python toolkit, excels in delivering high-octane, user-friendly data frameworks and tools for data scrutiny. In spite of its formidable arsenal, ... Read More

How to speed up Pandas with cuDF?

Tushar Sharma
Updated on 09-Aug-2023 18:40:29

223 Views

When it comes to the utilization of Python in the data analysis realm, Pandas stands as a renowned library extensively employed for its potent capabilities in data manipulation. Nevertheless, one might encounter speed bumps while handling substantial datasets via Pandas, chiefly in systems centered around CPU. A brilliant alternative to this predicament is cuDF, a GPU DataFrame library, meticulously crafted by NVIDIA under the umbrella of the RAPIDS ecosystem. cuDF ingeniously deploys the prowess of GPUs to facilitate parallelized data processing, thereby significantly surging ahead of the traditional operations of Pandas in terms of performance. This piece intends to guide ... Read More

How to Sort Date in Excel using Pandas?

Tushar Sharma
Updated on 09-Aug-2023 18:34:08

902 Views

Robust applications such as Excel have made their mark in handling data arrays, but certain intricate manipulations may require a more potent toolset. Specifically, the task of arranging date-based entries can pose unique challenges if the initial data is skewed or necessitates an advanced sorting mechanism. Pandas - a formidable Python library engineered specifically for data manipulation and scrutiny - steps into this gap. This treatise will shed light on how to finesse the sequence of dates in an Excel sheet, using Pandas, with lucid explications for each line of code. Installing Pandas and OpenPyXL Before we immerse into the ... Read More

10 Python File System Methods You Should Know

Tushar Sharma
Updated on 09-Aug-2023 17:44:29

200 Views

Collaborating with the file organization is a routine undertaking in coding, and Python equips a bountiful collection of instruments to connect with files and folders. In this discourse, we'll unfold ten Python file management functions that you ought to comprehend to streamline your coding endeavors. We'll escort you through each function, illustrating its operations in uncomplicated steps. Initiating and concluding a file Let’s assume example.txt contains the text "Hello, World!".Example doc = open('example.txt', 'r') contents = doc.read() doc.close() print(contents) Output Hello, World! The open() operation accepts two parameters: the file trajectory and the file mode. In ... Read More

10 Python Code Snippets For Everyday Programming Problems

Tushar Sharma
Updated on 09-Aug-2023 17:35:19

411 Views

Python has risen as one of the foremost favored programming languages all-inclusive, owing to its flexibility, user-friendliness, and extensive libraries. Whether you are a beginner or a prepared developer, having a collection of convenient code parts can spare you important time and energy. In this article, we'll delve into ten Python code fragments that can be employed to tackle routine programming challenges. We'll guide you through each fragment, elucidating how it operates in straightforward steps. Swapping two variables Switching the values of two variables is a frequent task in programming. In Python, this can be achieved without utilizing a ... Read More

1/4 Mile Calculator using PyQt5 in Python

Tushar Sharma
Updated on 09-Aug-2023 18:20:16

57 Views

The 1/4 mile drag sprint is a prevalent gauge for assessing the performance of automobiles and motorcycles. Aficionados and experts alike employ this distance to appraise acceleration and overall capabilities. In this piece, we will construct a basic 1/4 mile estimator using PyQt5, a renowned Python library for crafting graphical user interfaces (GUIs). By the conclusion of this piece, you'll possess a functional 1/4 mile estimator that can be employed to evaluate the performance of various vehicles. Why choose PyQt5 for a 1/4 Mile Estimator? PyQt5 is a strong and versatile library for building desktop applications in Python. It offers ... Read More

How to check for a substring in a PySpark dataframe?

Niharika Aitam
Updated on 09-Aug-2023 16:01:28

3K+ Views

Pyspark is the library which provides the interface to Apache spark. The Apache spark is the distributed computing system to process the large datasets. We have the feasibility in pyspark to write the spark applications using python apart of the traditional languages Java and Scala. Verifying for a substring in a PySpark Pyspark provides the dataframe API which helps us in manipulating the structured data such as the SQL queries. It can read various formats of data like parquet, csv, JSON and much more. It provides the features to support the machine learning library to use classification, regression, ... Read More

Advertisements