我有一个数据框列,其中包含每行中的所有文字
Symbol(id=15351, ticker=VXX, market=US, currency=USD, type=EQUITY,tick_size=0.010000, lot_size=100, contract_size=0, rate=None)
我试图仅在ticker =之后提取,这给出了VXX
我试过
df['symbolcolumn'] = df['symbolcolumn'].str.split(',market', expand=True)
但它不会仅提取符号代码
寻找df['symbolcolumn'] = VXX
答案 0 :(得分:0)
好的,我设法通过
来做到了df['symbol'] = df['symbol'].astype(str)
df['symbol'] = df['symbol'].str.split(', market', expand=True)
df['symbol'] = df['symbol'].apply(lambda x: x.split("=")[-1])