我正在使用apply函数来标记数据的方向,但是收到以下警告:
2_seq_preprocess.py:71: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
我需要帮助,将其转换为具有两列输入信息的格式,而不仅仅是我所描述的。
#make a function to determine orientation values in each row
def orient(row):
if row['sstart'] < row['send']:
val='+'
else:
val='-'
return val
#input orientation values
#useq.loc[useq['sstart']>useq['send'],'orientation'] = '+'
#useq.loc[useq['sstart']<useq['send'],'orientation'] = '-'
useq['orientation']=useq.apply(orient,axis=1)