小编ten*_*tio的帖子

根据字母数检索带括号的缩写的定义

我需要根据括号中包含的字母数来检索首字母缩写词的定义。对于我正在处理的数据,括号中的字母数与要检索的单词数相对应。我知道这不是获取缩写的可靠方法,但就我而言,确实如此。例如:

String ='尽管家庭健康史(FHH)通常被认为是常见的慢性疾病的重要危险因素,但护士(NP)很少考虑到它。

期望的产出:家庭健康史(FHH),执业护士(NP)

我知道如何从字符串中提取括号,但是在那之后我被卡住了。任何帮助表示赞赏。

 import re

 a = 'Although family health history (FHH) is commonly accepted as an 
 important risk factor for common, chronic diseases, it is rarely considered 
 by a nurse practitioner (NP).'

 x2 = re.findall('(\(.*?\))', a)

 for x in x2:
    length = len(x)
    print(x, length) 
Run Code Online (Sandbox Code Playgroud)

python regex text text-parsing abbreviation

6
推荐指数
1
解决办法
212
查看次数

使用SQLite数据库作为后端,MS Access作为前端,超过2GB数据

我已经使用 Microsoft Access 多年,但不可避免地,我需要转向其他数据库系统。目前,SQLite 似乎非常适合我当前的工作环境。据我所知,拥有一个带有 Microsoft Access 前端的 SQLite 后端非常容易。但是,我也知道 Microsoft Access 数据库在超过 2 GB 时往往会出现问题。我意识到 SQLite 不限于 2 GB,但如果我在 SQLite 数据库中使用 10 GB 数据集并使用 MS Access 作为前端,我会遇到性能问题吗?它能处理它吗?还是因为后端在 SQLite 数据库上所以不重要?我为理解上的无知表示歉意,但是,如果我一直漫无目的地寻找答案并继续找不到解决方案,那就更无知了十倍。谢谢!

sql database sqlite ms-access frontend

5
推荐指数
1
解决办法
3490
查看次数

仪表板网格 - Chart.JS 和 CSS - 问题扩大两个小水平条形图 - 菜鸟问题

我正在学习 JavaScript、CSS 和 Chart.JS。我得到了一些代码来进行逆向工程和学习。我的最终任务是将两个水平图 div向左加宽,而不与大垂直条形图重叠。

基本上,我只是希望我的两个小图的宽度向左扩展。Codepen在这里: https ://codepen.io/tenebris_silentio/pen/VwaGdaP

<script src="https://code.jquery.com/jquery-3.4.1.slim.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
        <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css" rel="stylesheet"/>
        <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet"/>
    </head>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
            <link href="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.css" rel="stylesheet" type="text/css">

<script>
  
var doughnut = document.getElementById('doughnut');
var doughnutConfig = new Chart(doughnut, {
    type: 'horizontalBar',
    data: {
        labels: ['data-1', 'data-2', 'data-3', 'data-4', 'data-5'],
        datasets: [{
            label: '# of data',
            data: [11, 30, 20, 1, 12],
            backgroundColor: ['rgba(0, 230, 118, 1)', 'rgba(255, 206, 86, 1)', 'rgba(255,99,132,1)', 'rgba(233,69,132,1)', 'rgba(111,22,77,13)'],
            borderWidth: 1 …
Run Code Online (Sandbox Code Playgroud)

html javascript css charts chart.js

2
推荐指数
1
解决办法
982
查看次数

无法通过Pandas将Excel字段导入Python-索引超出范围错误

我不确定发生了什么,但是我的代码今天可以正常工作了,但事实并非如此。我有一个要单独导入并放入列表的项目的Excel电子表格。但是,我收到“ IndexError:索引8超出轴8的大小8”的错误,Google搜索尚未为我解决此问题。任何帮助表示赞赏。我的Excel工作表中包含以下字段:id,funding_end,关键字,pi,summaryurl,htmlabstract,abstract,project_num,title。不知道我在想什么...

import pandas as pd

dataset = pd.read_excel('new_ahrq_projects_current.xlsx',encoding="ISO-8859-1")
df = pd.DataFrame(dataset)
cols = [0,1,2,3,4,5,6,7,8]
df = df[df.columns[cols]]

tt = df['funding_end'] = df['funding_end'].astype(str)
tt = df.funding_end.tolist()
for t in tt:
   allenddates.append(t)

bb = df['keywords'] = df['keywords'].astype(str)
bb = df.keywords.tolist()
for b in bb:
   allkeywords.append(b)

uu = df['pi'] = df['pi'].astype(str)
uu = df.pi.tolist()
for u in uu:
   allpis.append(u)

vv = df['summaryurl'] = df['summaryurl'].astype(str)
vv = df.summaryurl.tolist()
for v in vv:
   allsummaryurls.append(v)

ww = df['htmlabstract'] = df['htmlabstract'].astype(str)
ww = df.htmlabstract.tolist()
for w …
Run Code Online (Sandbox Code Playgroud)

python excel text numpy pandas

1
推荐指数
1
解决办法
97
查看次数