小编ASH*_*M.G的帖子

Github 操作:如果特定文件夹中发生更改,则运行工作流程中的步骤/作业

我们有什么方法可以根据特定文件夹中的更改来控制工作流程中运行哪些作业/步骤

例如:

我已经说过,我的 git 存储库中的以下文件夹:a、b、c 在每次 PR 合并到我的分支时,我都会触发一个工作流程。工作流将执行作业,例如 A -> B -> C。我只想在文件夹"a/**"、B"b/**"等存在更改时才运行作业 A。

因此,如果 PR 中的更改仅发生在 中,"a/**"并且"b/**"工作流将跳过 的作业执行C,使工作流运行为A->B

github-actions

38
推荐指数
2
解决办法
4万
查看次数

Openpyxl:需要Excel中包含数据的列中的最大行数

我需要包含 Excel 数据的特定列中的最后一行。在openpyxl中,sheet.max_row或max_column为我们获取整个工作表中的最大行或列。但我想要的是特定的专栏。

我的场景是,我必须从数据库获取一些值并将其附加到 Excel 工作表中特定列的末尾。

在此屏幕截图中,如果我希望 max_column 包含列“C”中的数据,则它应该返回 10:

图像

在上图中,如果我想要最后一个单元格包含列“C”的数据,它应该返回 10

------------- 解决方案 1 --------------------

import pandas as pd

# lt is the dataframe containing the data to be loaded to excel file

for index,i in enumerate(lt):
   panda_xl_rd = pd.read_excel('file.xlsx',"sheet_Name") # Panda Dataframe
   max = len(panda_xl_rd.iloc[:,(col-1)].dropna())+2     ''' getting the 
                                                             row_num of 
                                                             last record in 
                                                             column 
                                                             dropna removes 
                                                             the Nan 
                                                             values else we 
                                                             will get 
                                                             the entire 
                                                             sheets max 
                                                             column length . 
                                                             +2 gets 
                                                             the next column 
                                                             right after the …
Run Code Online (Sandbox Code Playgroud)

python excel openpyxl

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

标签 统计

excel ×1

github-actions ×1

openpyxl ×1

python ×1