I would like to replace row values in pandas.
import pandas as pd
import numpy as np
data = {'type': ['place', 'home', 'place', 'walk', 'place', 'work', 'home', 'place'],'labels': ['NaN', 'NaN', 'shop', 'Nan', 'clinic', 'NaN', 'NaN', 'NaN']}
a = pd.DataFrame(data, columns = ['type', 'labels'])
Is there some possibilities to replace a['type'] with a['labels'] only the conditions if a['labels'] is not np.NaN and a['type'] == 'place' using pandas?
I would prefer to use df.loc[] if it is possible.