小编Rom*_*meo的帖子

分支没有出现在新的远程“gitlab”中

我根据收集的一些在线信息添加了新的遥控器。我的命令是

git remote add gitlab  http://ankits@abc.xyz/janedoe/my.git
git push gitlab master -f
Run Code Online (Sandbox Code Playgroud)

但当我这样做时

git branch -a

*master
sprint_2
sprint_3
remote/gitlab/master
remote/origin/HEAD -> origin/master
remote/origin/sprint_2
remote/origin/sprint_3
remote/origin/sprint_1
Run Code Online (Sandbox Code Playgroud)

为什么我在 gitlab 远程中看不到分支 sprint_2/3/1 ?

git gitlab

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

python itertools groupby 与过滤器的使用

我有一个列表 = [1, 2, 3, 3, 6, 8, 8, 10, 2, 5, 7, 7] 我正在尝试使用 groupby 将其转换为

1
2
3
3
6
8,8
10
2,
5
7,7
Run Code Online (Sandbox Code Playgroud)

基本上,任何大于 6 的东西,我喜欢将它们分组,否则我想让它们不分组。有关如何使用 itertool groupby 执行此操作的任何提示

我目前的代码:

for key, group in it.groupby(numbers, lambda x: x):
   f = list(group)
   if len(f) == 1:
      split_list.append(group[0])
   else:
      if (f[0] > 6):  #filter condition x>6
         for num in f: 
            split_list.append(num + 100)
       else:
         for num in f:
            split_list.append(num)
Run Code Online (Sandbox Code Playgroud)

python group-by list python-itertools

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

标签 统计

git ×1

gitlab ×1

group-by ×1

list ×1

python ×1

python-itertools ×1