从Python(Google Colabs)的列中提取指定的文本
我希望从Python(Google Colabs)的下表中提取指定的数据。
<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC;
}
.tableizer-table th {
background-color: #104E8B;
color: #FFF;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th>Source</th><th>Description</th><th>Services</th></tr></thead><tbody>
<tr><td>Receivable Invoice</td><td>Peter Jackson - 2/2/2022 - Access Community, Social And Rec Activities - Standard - Weekday Daytime - TTP 9:00AM 12:00PM 04_104_0125_6_1_T</td><td>Access Community, Social And Rec Activities - Standard - Weekday Daytime - TTP 9:00AM 12:00PM 04_104_0125_6_1_T</td></tr>
<tr><td>Receivable Invoice</td><td>Helen Johnson - 30/06/2021- - Transport 04_590_0125_6_1</td><td>Transport 04_590_0125_6_1</td></tr>
<tr><td>Receivable Invoice</td><td>Charlotte Jane - Reversal of difference charged Domestic shifts from 22/9/2021 - 31/12/2021</td><td> </td></tr>
<tr><td>Receivable Invoice</td><td>Mary Jane - Support Coordination - 10/3/2022 - Psychosocial Recovery Coaching - Weekday Daytime 07_101_0106_6_3</td><td>Psychosocial Recovery Coaching - Weekday Daytime 07_101_0106_6_3</td></tr>
</tbody></table>
上面显示了我在Python中想要的表。列“服务”是从“描述”列中提取的提取文本。
如您所见,很少有数据不应该拾取,例如第3行。
在过去的几天里,我一直在此代码中陷入困境,请感谢是否有人能提供潜在客户。
预期结果是“服务”列。
I'm looking to extract specified data from the below table in Python (Google Colabs).
<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC;
}
.tableizer-table th {
background-color: #104E8B;
color: #FFF;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th>Source</th><th>Description</th><th>Services</th></tr></thead><tbody>
<tr><td>Receivable Invoice</td><td>Peter Jackson - 2/2/2022 - Access Community, Social And Rec Activities - Standard - Weekday Daytime - TTP 9:00AM 12:00PM 04_104_0125_6_1_T</td><td>Access Community, Social And Rec Activities - Standard - Weekday Daytime - TTP 9:00AM 12:00PM 04_104_0125_6_1_T</td></tr>
<tr><td>Receivable Invoice</td><td>Helen Johnson - 30/06/2021- - Transport 04_590_0125_6_1</td><td>Transport 04_590_0125_6_1</td></tr>
<tr><td>Receivable Invoice</td><td>Charlotte Jane - Reversal of difference charged Domestic shifts from 22/9/2021 - 31/12/2021</td><td> </td></tr>
<tr><td>Receivable Invoice</td><td>Mary Jane - Support Coordination - 10/3/2022 - Psychosocial Recovery Coaching - Weekday Daytime 07_101_0106_6_3</td><td>Psychosocial Recovery Coaching - Weekday Daytime 07_101_0106_6_3</td></tr>
</tbody></table>
Above shows the Table that I want in Python. The Column "Services" is the extract specified text from Column "Description".
As you can see, there are few data which shouldn't pick up, for instance Row 3.
I have been stuck in this code for the past few days, appreciate if anyone could provide a lead.
Expected outcome is Column "Services".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论