How to make all words to lower case?

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


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)


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

Natural language processing Chatbot application using NLTK for text classification
In this NLP AI application, we build the core conversational engine for a chatbot. We use the popular NLTK text classification library to achieve this.

Machine Learning or Predictive Models in IoT - Energy Prediction Use Case
In this machine learning and IoT project, we are going to test out the experimental data using various predictive models and train the models and break the energy usage.

Walmart Sales Forecasting Data Science Project
Data Science Project in R-Predict the sales for each department using historical markdown data from the Walmart dataset containing data of 45 Walmart stores.

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.

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.

Ecommerce product reviews - Pairwise ranking and sentiment analysis
This project analyzes a dataset containing ecommerce product reviews. The goal is to use machine learning models to perform sentiment analysis on product reviews and rank them based on relevance. Reviews play a key role in product recommendation systems.

Human Activity Recognition Using Multiclass Classification in Python
In this human activity recognition project, we use multiclass classification machine learning techniques to analyse fitness dataset from a smartphone tracker.

Zillow’s Home Value Prediction (Zestimate)
Data Science Project in R -Build a machine learning algorithm to predict the future sale prices of homes.

Data Science Project on Wine Quality Prediction in R
In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.