pandas str.title()
IntuitionThe problem requires transforming text such that the first letter of each word is capitalized while keeping the rest lowercase. This can be efficiently
# Intuition
The problem requires transforming text such that the first letter of each word is capitalized while keeping the rest lowercase. This can be efficiently achieved using Python's str.title() method, which is designed for such transformations.

# Approach
Rename the column content_text to original_text to preserve the original data.
Create a new column converted_text by applying the str.title() method to the original_text column.
Return the updated DataFrame with both the original and transformed text.

# Complexity
Time complexity:
$$O(n)$$, where n is the number of rows in the DataFrame and m is the average length of the strings. The str.title() method processes each character in the text.

Space complexity:
$$O(n)$$, as a new column is created to store the transformed text.

# Code
```pythondata []
import pandas as pd

def capitalize_content(user_content: pd.DataFrame) -> pd.DataFrame:
    user_content.rename(columns={'content_text': 'original_text'}, inplace=True)
    user_content['converted_text'] = user_content['original_text'].str.title()

    return user_content
```
['Pandas']