First Letter Capitalization II Solution (Python & Pandas)
Complexity\n\n\n\n# Code\npythondata []\nimport pandas as pd\n\ndef capitalize_content(user_content: pd.DataFrame) -> pd.DataFrame:\n    converted_text = []\n  
# Complexity\n![Screenshot 2024-12-03 101036.png](https://assets.leetcode.com/users/images/88257deb-7fc1-46f9-8f17-b649a860c0a2_1733206255.6053877.png)\n\n\n# Code\n```pythondata []\nimport pandas as pd\n\ndef capitalize_content(user_content: pd.DataFrame) -> pd.DataFrame:\n    converted_text = []\n    for j in user_content[\'content_text\']:\n        new_sentence = []\n        for i in j.split():\n            if \'-\' in i:\n                i = i.lower()\n                idx = i.find(\'-\')\n                i = i[0].upper() + i[1:idx+1] + i[idx+1].upper() + i[idx+2:] \n                new_sentence.append(i)   \n            else:\n                new_sentence.append(i.capitalize())\n        \n        converted_text.append(\' \'.join(new_sentence))\n    user_content[\'converted_text\'] = converted_text\n    user_content.columns = [\'content_id\', \'original_text\', \'converted_text\']\n    return user_content\n```
['Python3', 'Pandas']