Q:

how to add new item in pandas series without erasing other items

I have a following pandas series. 
new_orders_list
Out[853]: 
Cluster 1    [525, 526, 533]
Cluster 2    [527, 528, 532]
Cluster 3    [519, 534, 535]
Cluster 4              [530]
Cluster 5         [529, 531]
Cluster 6    [520, 521, 524]

And,I have two more series which I get after some slicing on dataframe.
condition
Out[854]: 
5    525
Name: order_id, dtype: object

condition2
Out[855]: 
Clusters
Cluster 6    1
Name: quant_bought, dtype: int64

Now I want to add value of condition series 525 to new_orders_list at Cluster 6 (index from condition2 series) location. And erasing off 525 from Cluster 1 location. So, it should look like this
Cluster 1    [526, 533]
Cluster 2    [527, 528, 532]
Cluster 3    [519, 534, 535]
Cluster 4              [530]
Cluster 5         [529, 531]
Cluster 6    [520, 521, 524, 525]

I am doing following in Python. But it appends to the previously stored values.
new_orders_list.append(pd.Series(condition.values ,index = 
condition2.index))

Cluster 1    [525, 526, 533]
Cluster 2    [527, 528, 532]
Cluster 3    [519, 534, 535]
Cluster 4              [530]
Cluster 5         [529, 531]
Cluster 6    [520, 521, 524]
Cluster 6                525

A:

You can try this solution. 
New Series of remove data was created and was called remseries. 
Types of values in lists in Series new_orders_list are integers and types of other Series are strings, so all values are converted to strings.
Then was selected rows by subsets by isin and values was added and removed.
print new_orders_list

Clusters
Cluster 1    [525, 526, 533]
Cluster 2    [527, 528, 532]
Cluster 3    [519, 534, 535]
Cluster 4              [530]
Cluster 5         [529, 531]
Cluster 6    [520, 521, 524]
Name: no, dtype: object

print condition

5    525
Name: order_id, dtype: object

print condition2

Clusters
Cluster 6    1
Name: quant_bought, dtype: int64

#create new Series for remove
remseries = pd.Series(condition.values, index = ['Cluster 1'], name='rem')
print remseries

Cluster 1    525
Name: rem, dtype: object

#create dataframe from series
df = new_orders_list.reset_index()
print df

    Clusters               no
0  Cluster 1  [525, 526, 533]
1  Cluster 2  [527, 528, 532]
2  Cluster 3  [519, 534, 535]
3  Cluster 4            [530]
4  Cluster 5       [529, 531]
5  Cluster 6  [520, 521, 524]

#convert values in list from int to string
df['no'] = df['no'].apply(lambda x: [str(i) for i in x])

#add and remove items
df.loc[df['Clusters'].isin(condition2.index.tolist()), 'no'] = 
df['no'].apply(lambda x: x + condition.values.tolist())

df.loc[df['Clusters'].isin(remseries.index.tolist()), 'no']  = 
df['no'].apply(lambda x: [k for k in x if k != ''.join(remseries.values)])

#check types of values in list
print [ type(x) for x in df['no'][0]]

[<type 'str'>, <type 'str'>]

#convert values in list from string to int
df['no'] = df['no'].apply(lambda x: [int(i) for i in x])

print df

    Clusters                    no
0  Cluster 1            [526, 533]
1  Cluster 2       [527, 528, 532]
2  Cluster 3       [519, 534, 535]
3  Cluster 4                 [530]
4  Cluster 5            [529, 531]
5  Cluster 6  [520, 521, 524, 525]

#check types of values in list
print [ type(x) for x in df['no'][0]]

[<type 'int'>, <type 'int'>]

