Python Articles

Page 109 of 855

Skin Cancer Detection using TensorFlow in Python

Jaisshree
Jaisshree
Updated on 27-Mar-2026 1K+ Views

Early detection of any disease, especially cancer, is very crucial for the treatment phase. One such effort made in this direction is the use of machine learning algorithms to detect and diagnose skin cancer with the help of a machine learning framework like TensorFlow. The traditional method of cancer detection is quite time-consuming and requires professional dermatologists. However, with the help of TensorFlow, not only can this process be made fast, but more accurate and efficient. Moreover, people who do not get timely access to doctors and dermatologists, can use this meanwhile. Algorithm Overview The skin cancer ...

Read More

Rainfall Prediction using Machine Learning

Jaisshree
Jaisshree
Updated on 27-Mar-2026 777 Views

Machine learning enables us to predict rainfall using various algorithms like Random Forest and XGBoost. Each algorithm has its strengths − Random Forest works efficiently with smaller datasets while XGBoost excels with large datasets. This tutorial demonstrates building a rainfall prediction model using Random Forest algorithm. Algorithm Steps Import required libraries (Pandas, NumPy, Scikit-learn, Matplotlib) Load historical rainfall data into a pandas DataFrame Preprocess data by handling missing values and selecting features Split data into training and testing sets Train Random Forest model on the dataset Make predictions and evaluate model performance Example Implementation ...

Read More

Medical Insurance Price Prediction using Machine Learning in Python

Jaisshree
Jaisshree
Updated on 27-Mar-2026 844 Views

Medical insurance price prediction helps insurance companies assess risk and set appropriate premiums. Using machine learning, we can analyze historical data to predict insurance costs based on factors like age, BMI, smoking habits, and medical history. In this tutorial, we'll build a predictive model using a medical insurance dataset to estimate insurance charges for individuals based on their personal characteristics. Dataset Overview The medical insurance dataset contains the following features: age − Age of the individual sex − Gender (male/female) bmi − Body Mass Index children − Number of dependents smoker − Smoking status (yes/no) ...

Read More

How to Compute the Average of a Column of a MySQL Table Using Python?

Prince Yadav
Prince Yadav
Updated on 27-Mar-2026 565 Views

Computing the average of a MySQL table column is a common data analysis task. Python's mysql-connector-python library makes this straightforward by combining SQL's AVG() function with Python's database connectivity. Installing Required Libraries First, install the MySQL connector library using pip ? pip install mysql-connector-python Complete Example Here's a complete program that connects to MySQL and computes a column average ? import mysql.connector # Step 1: Connect to the database mydb = mysql.connector.connect( host="localhost", user="yourusername", password="yourpassword", ...

Read More

How to Compute Derivative Using Numpy?

Prince Yadav
Prince Yadav
Updated on 27-Mar-2026 10K+ Views

Calculus, the study of continuous change, is a fundamental subject in mathematics that has numerous applications in fields ranging from physics to economics. One of the key concepts in calculus is derivative, which measures the instantaneous rate of change of a function at a given point. The derivative of function f(x) at point x is mathematically defined as ? f'(a) = lim(h -> 0) [(f(a+h) - f(a))/h] However, computing derivatives by hand can be time−consuming and error−prone. NumPy provides the gradient() function to calculate derivatives quickly and accurately for both one−dimensional and multi−dimensional functions. ...

Read More

How to Compute Cross-Correlation of two given Numpy Arrays?

Prince Yadav
Prince Yadav
Updated on 27-Mar-2026 2K+ Views

Cross-correlation is a concept widely used in signal processing and image processing to determine the similarity between two signals or images. Python offers an efficient way to compute cross-correlation between numpy arrays using the numpy.correlate() function. The NumPy library provides numpy.correlate() for calculating cross-correlation of one-dimensional arrays. For two-dimensional arrays, we need to flatten them first and then use the same function. Syntax The syntax of the numpy.correlate() function is ? numpy.correlate(a, v, mode='valid') Parameters a, v ? Input arrays to calculate cross-correlation mode ? Size of output array ('valid', 'same', ...

Read More

How to Compress Images Using Python and PIL?

Prince Yadav
Prince Yadav
Updated on 27-Mar-2026 15K+ Views

In today's digital era, images have become a necessary part of our lives. They play an important and significant role in communication and expression across a wide range of platforms, from social media to websites. However, high−quality images can consume a considerable amount of storage space and it'll result in slower website loading times and longer upload times. Image compression becomes applicable in this situation. By reducing the size of an image, you can ensure faster loading times, lower bandwidth usage, and more storage space. In this article, we will look into the process of compressing images using Python ...

Read More

How to Compare two Dataframe with Pandas Compare?

Prince Yadav
Prince Yadav
Updated on 27-Mar-2026 1K+ Views

If you work with data analysis or data science, then you already know the importance of comparing DataFrames. Fortunately, the Python library, pandas, offers a handy compare() method that allows you to compare two DataFrames and highlight their differences. This method is incredibly useful for identifying discrepancies between datasets and making informed decisions based on those differences. In this article, we will explore how to use pandas compare() to compare two DataFrames and dive into some of the customization options available. Whether you're an experienced data analyst or a beginner, this article will provide you with the knowledge you ...

Read More

How to Compare JSON Objects Regardless of Order in Python?

Prince Yadav
Prince Yadav
Updated on 27-Mar-2026 13K+ Views

JSON (JavaScript Object Notation) is a widely used data format for exchanging data on the web. In Python, comparing JSON objects can be challenging when they contain the same elements but in different orders. This article explores three effective methods for comparing JSON objects regardless of their order. Method 1: Converting JSON to Dictionaries The simplest approach is converting JSON strings to Python dictionaries and comparing them directly. Since dictionaries are unordered in Python, this method naturally handles order differences ? import json # JSON objects to compare json_obj1 = '{"name": "John", "age": 30, "city": ...

Read More

How to Change Column Type in PySpark Dataframe

Prince Yadav
Prince Yadav
Updated on 27-Mar-2026 9K+ Views

PySpark DataFrames are powerful data structures for big data processing. One common task when working with DataFrames is changing column data types to ensure data consistency, perform accurate calculations, and optimize memory usage. In this tutorial, we will explore three methods to change column types in PySpark DataFrames: using cast(), withColumn(), and SQL expressions. Method 1: Using cast() Function The cast() function is the most straightforward way to convert a column from one data type to another. It takes the desired data type as an argument and returns a new column with the modified type. Syntax ...

Read More
Showing 1081–1090 of 8,546 articles
« Prev 1 107 108 109 110 111 855 Next »
Advertisements