How to make all words to lower case?
MACHINE LEARNING RECIPES DATA CLEANING PYTHON DATA MUNGING PANDAS CHEATSHEET     ALL TAGS

How to make all words to lower case?

How to make all words to lower case?

This recipe helps you make all words to lower case

0

Recipe Objective

In Content Analysis or text Analysis we want same format of our text or content for better analysis and to get a better output, for e.g No special charaters should be there, All the text should be in same case (Upper or lower). So now we are going to see how to make all words to lower case in a text.

Step 1 - Take a Simple word and store it in a variable

My_word = "LANGUAGE" print(My_word)

LANGUAGE

So here we have taken a word, and stored it in a variable called My_word. As we can see the word is in Upper case so lets try to make it in lower case.

Step 2 - Converting upper case word to lower case

print("The lower case word is :",My_word.lower())

The lower case word is : language

here we can see the word has totally been coverted into lower case, python has a inbuilt function called lower which converts the Upper case letters to lower case.

Step 3 - Lets try with a sentence

My_sentence = "Harry is 12 YEARS OLD, and he LOVES to Play 'FOOTBALL'." print("Lets see what changes has happened :", My_sentence.lower())

Lets see what changes has happened : harry is 12 years old, and he loves to play 'football'.

As we can see that, the letters which were in upper case has been converted into lower case though some words like football was in quotes still has been converted into lower case.

Relevant Projects

Predict Credit Default | Give Me Some Credit Kaggle
In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

Predict Churn for a Telecom company using Logistic Regression
Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

Data Science Project-TalkingData AdTracking Fraud Detection
Machine Learning Project in R-Detect fraudulent click traffic for mobile app ads using R data science programming language.

Resume parsing with Machine learning - NLP with Python OCR and Spacy
In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

Forecast Inventory demand using historical sales data in R
In this machine learning project, you will develop a machine learning model to accurately forecast inventory demand based on historical sales data.

Predict Census Income using Deep Learning Models
In this project, we are going to work on Deep Learning using H2O to predict Census income.

Credit Card Fraud Detection as a Classification Problem
In this data science project, we will predict the credit card fraud in the transactional dataset using some of the predictive models.

Identifying Product Bundles from Sales Data Using R Language
In this data science project in R, we are going to talk about subjective segmentation which is a clustering technique to find out product bundles in sales data.

Perform Time series modelling using Facebook Prophet
In this project, we are going to talk about Time Series Forecasting to predict the electricity requirement for a particular house using Prophet.

Data Science Project in Python on BigMart Sales Prediction
The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.