Python 无法拆分数据帧

Python 无法拆分数据帧,python,pandas,string,dataframe,Python,Pandas,String,Dataframe,我无法通过u分割数据帧并从中创建新列 原股 AMAT_0000006951_10Q_20200726_Item1A_excerpt.txt as section 我当前的代码 df = pd.DataFrame(myList,columns=['section','text']) #df['text'] = df['text'].str.replace('•','') df['section'] = df['section'].str.replace('Item1A', 'Filing

我无法通过u分割数据帧并从中创建新列

原股

AMAT_0000006951_10Q_20200726_Item1A_excerpt.txt    as section
我当前的代码

df = pd.DataFrame(myList,columns=['section','text'])
#df['text'] = df['text'].str.replace('•','')
df['section'] = df['section'].str.replace('Item1A', 'Filing Section: Risk Factors')
df['section'] = df['section'].str.replace('Item2_', 'Filing Section: Management Discussion and Analysis')
df['section'] = df['section'].str.replace('excerpt.txt', '').str.replace(r'\d{10}_|\d{8}_', '')
df.to_csv("./SECParse.csv", encoding='utf-8-sig', sep=',',index=False)
输出:

section                                 text
AMAT_10Q_Filing Section: Risk Factors_  The COVID-19 pandemic and global measures taken in response 
                                        thereto have adversely impacted, and may continue to adversely 
                                        impact, Applied’s operations and financial results.
AMAT_10Q_Filing Section: Risk Factors_  The COVID-19 pandemic and measures taken in response by 
                                        governments and businesses worldwide to contain its spread, 
                                        
AMAT_10Q_Filing Section: Risk Factors_  The degree to which the pandemic ultimately impacts Applied’s 
                                        financial condition and results of operations and the global 
                                        economy will depend on future developments beyond our control
我真的很想将“section”拆分成一个基于“\ux”的新列 我尝试了很多不同的正则表达式来拆分“section”,它们要么给我没有填充的标题,要么在section和text之后添加了列,这是没有用的。我还要补充的是,将会有大约100000次观测

预期结果:

Ticker  Filing type  Section                       Text
AMAT    10Q          Filing Section: Risk Factors  The COVID-19 pandemic and global measures taken in response 

Any guidance would be appreciated. 

@冻糕谢谢,我以前应该在我的问题上加上这个,我现在加上了。