0

I have a dataframe column that has the following values:

EMPLOYEE_NAME      
---------------------
ROBERT             
HENRY              
THOMSON AND THOMSON

The dataframe would be added to a dictionary to create a new issue in JIRA.

new_issue = {new_issue[employee_name] = {'value':df_new_positives.EMPLOYEE_NAME.iloc[i].title()}

Calling the title() function is converting first letter in each word to start with a capital letter. In this case, I would like to convert the names to Robert, Henry, Thomson and Thomson while making update to JIRA.

Expected names in JIRA: Robert Henry Thomson and Thomson

Please advise how to approach this change.

vvazza
  • 421
  • 7
  • 21
  • 1
    You may be able to do this more obviously with a normal `dict` if you only have a few (under 1000) names to convert! This would also more easily permit special logic (like special-casing a few names which have two capital letters like a Foo McBar) – ti7 Apr 07 '21 at 17:11
  • Please post your exact expected output. – Mayank Porwal Apr 07 '21 at 17:16
  • 1
    You may want to look into a regex for the nth word, such as this topic https://stackoverflow.com/questions/54351071/match-the-nth-word-in-a-line . However, as soon as your data changes, you'll need to update your code. Therefore, I would also recommend @ti7's approach to instead process the data differently. Perhaps split the words into separate columns. – windyvation Apr 07 '21 at 17:16
  • Thank you @ti7. We have only 3 names - Robert, Henry and Thomson and Thomson for that column. – vvazza Apr 07 '21 at 17:21

0 Answers0