Q:

Changing column in DataFrame

I am looking to change part of the string in a column of a data frame. I, however, can not get it to update in the data frame. This is my code. 
import pandas as pd

#File path
csv = '/home/test.csv'

#Read csv to pandas
df = pd.read_csv(nuclei_annotations_csv, header=None, names=['A', 'B', 'C', 'D', 'E', 'F'])

#Select Data to update
paths = df['A']

#Loop over data
for x in paths:
    #Select data to updte
    old = x[:36]
    #Update value
    new = '/Datasets/RetinaNetData'
    #Replace
    new_path = x.replace(old, new)
    #Save values to DataFrame
    paths.update(new_path)

#Print updated DataFrame 
print(df)

The inputs and output I would like are:
Input:
/Annotations/test_folder/10_m03293_ORG.png
/Annotations/test_folder/10_m03293_ORG.png
/Annotations/test_folder/10_m03293_ORG.png
/Annotations/test_folder/10_m03293_ORG.png

OutPut:
/Datasets/RetinaNetData/10_m03293_ORG.png
/Datasets/RetinaNetData/10_m03293_ORG.png
/Datasets/RetinaNetData/10_m03293_ORG.png
/Datasets/RetinaNetData/10_m03293_ORG.png

A:

Assuming that all of the rows are strings and all of them have at least 36 characters, you can use .str to get the part of the cells after the 36th character.  Then you can just use the + operator to combine the new beginning with the remainder of each cell's contents:
df.A = '/Datasets/RetinaNetData' + df.A.str[36:]

As a general tip, methods like this that operate across the whole dataframe at once are going to be more efficient than looping over each row individually.

