Python Articles - Page 90 of 929

How To Convert Sklearn Dataset To Pandas Dataframe in Python?

Mukul Latiyan
Updated on 03-Aug-2023 16:39:12

6K+ Views

Scikit−learn (sklearn) is one of the most popular machine learning libraries for Python. It provides a range of efficient tools for machine learning and statistical modelling, including a variety of datasets. These datasets are provided in the form of numpy arrays, which can be difficult to work with for certain tasks, such as exploratory data analysis. Pandas is a popular data manipulation library that provides powerful tools for data analysis and manipulation. It provides data structures for efficiently storing and manipulating large datasets, and provides a wide range of tools for data cleaning, transformation, and analysis. Below are the two ... Read More

How to Convert Scrapy items to JSON?

Mukul Latiyan
Updated on 03-Aug-2023 16:37:30

484 Views

Web scraping is the process of extracting data from websites. It involves parsing HTML or XML code and extracting relevant information from it. Scrapy is a popular Python−based web scraping framework that allows you to easily build web scrapers to extract structured data from websites. Scrapy provides a robust and efficient framework for building web crawlers that can extract data from websites and store it in various formats. One of the key features of Scrapy is its ability to parse and store data using custom Item classes. These Item classes define the structure of the data that will be extracted ... Read More

Cleaning Data with Dropna in Pyspark

Mukul Latiyan
Updated on 03-Aug-2023 16:32:18

684 Views

In order to make sure that the data is accurate, trustworthy, and appropriate for the intended analysis, cleaning the data is a crucial step in any data analysis or data science endeavour. The data cleaning functions in Pyspark, like dropna, make it a potent tool for working with big datasets. The dropna function in Pyspark allows you to remove rows from a DataFrame that contain missing or null values. Missing or null values can occur in a DataFrame for various reasons, such as incomplete data, data entry errors, or inconsistent data formats. Removing these rows can help ensure the quality ... Read More

Modelling Steady Flow Energy Equation in Python

Dr Pankaj Dumka
Updated on 04-Oct-2023 12:44:00

344 Views

Steady Flow Energy Equation (SFEE) is the application of conservation of energy on to an open system. Figure shown below is a schematic of open system in which fluid enters at 𝑖 and exits at 𝑒. The red broken line represents the control surface (CS) of the control volume (CV). The inlet and exit parameters are mentioned in the table shown below − Parameter Inlet Exit Pressure pi pe Velocity Vi Ve Density Pi Pe Specific volume vi ve Enthalpy hi he Area Ai Ae ... Read More

Introduction to NSE Tools Module in Python

Mayukh Sen
Updated on 03-Aug-2023 15:33:22

1K+ Views

We know that NSE (National Stock Exchange of India Limited) is the leading stock exchange of India. It is situated in Mumbai, Maharashtra. It was established back in 1992 as the first ever dematerialized exchange of the country. As NSE contains data which can be used for further analysis, there is a library in Python which can help with just that. The library is known as 'nsetools' library. Uses of the NSE tools Module This library can be used in various projects which requires live updates of a certain index, stock or to create even ... Read More

Finding Words Lengths in String using Python

Aayush Shukla
Updated on 03-Aug-2023 14:41:26

4K+ Views

Finding the lengths of individual words in a given input string using Python is the issue that has to be resolved. We want to count the characters in each word of a text input and display the results in a structured style, like a list. The task entails breaking down the input string and separating each word. The length of each word is then calculated based on the number of characters in it. The basic objective is to create a function or process that can receive input, determine word lengths, and promptly output the results effectively. In several applications, including ... Read More

Change Value in Excel Using Python

Mukul Latiyan
Updated on 02-Aug-2023 17:42:45

5K+ Views

In this article we will learn different approaches with which we can change the value of data present in an excel sheet using python. Openxypl Openpyxl is a Python library used for working with Excel spreadsheets. It is a popular choice for working with Excel files in Python because it is easy to use, has an active developer community, and provides many features for working with spreadsheets. Openpyxl allows you to create, read, write, and modify Excel files using Python. It supports the following file formats: XLSX (Microsoft Excel Open XML Spreadsheet) XLSM (Microsoft Excel Open XML Macro−Enabled ... Read More

Cluster Sampling in Pandas

Mukul Latiyan
Updated on 02-Aug-2023 17:30:54

871 Views

In this article, we will learn how we can perform cluster sampling in Pandas. But before we deep dive into that, let's explore a little about what sampling is in Pandas, as well as how pandas help us to do that. Sampling In Pandas, sampling refers to the process of selecting a subset of rows or columns from a DataFrame or Series object. Sampling can be useful in many data analysis tasks, such as data exploration, testing, and validation. Pandas provides several methods for sampling data, including: DataFrame.sample(): This method returns a random sample of rows from a ... Read More

Clear LRU Cache in Python

Mukul Latiyan
Updated on 02-Aug-2023 17:28:22

13K+ Views

In this article, we will learn how to clear an LRU cache implemented in Python. Before we dive deep into the coding aspect, let's explore a little about what an LRU cache is and why it is popular. LRU Cache, also known as the Least Recently Used Cache, is a data structure that is widely used in computer science to improve the performance of applications by reducing the time it takes to access frequently−used data. The LRU Cache stores a limited number of items and removes the least recently used item when the cache becomes full. This allows ... Read More

Check if a Thread has Started in Python

Mukul Latiyan
Updated on 02-Aug-2023 17:24:04

7K+ Views

Multithreading is a powerful technique used in modern programming languages to execute multiple threads simultaneously. In Python, the threading module is used to implement multithreading. Multithreading allows programs to perform multiple tasks at once and can improve the performance of applications. When working with multithreading in Python, it's essential to know how to check if a thread is running or not. The is_alive() method provided by the Thread class is a simple and effective way to check the status of a thread. By using this method, you can determine whether a thread has started, is running, or has finished its ... Read More

Advertisements