如何从具有多个数组的变量中移动空数组?

时间:2017-02-23 07:07:19

标签: python python-3.x

Variable with several arrays in it

使用此代码后我得到了这个:

  

array1 = numpy.empty((0,4),int)

     

表示a,b,c,d:

     
    

array1 = numpy.vstack([array1,[a,b,c,d]])

  

我不知道为什么我会得到空阵列。有没有办法删除它们?

1 个答案:

答案 0 :(得分:0)

.root{
   -fx-background: rgb(44,44,44);
}

.button {
   -fx-border-radius: 5;
   -fx-background-radius: 5;
   -fx-min-height: 32;
   -fx-min-width: 40;
   -fx-background-color: radial-gradient(radius 100%, rgb(22, 33, 188), rgb(3,22,122));
   -fx-text-fill: rgb(196,188,222);
}

TextField {
   -fx-border-radius: 5;
   -fx-background-radius: 5;
   -fx-max-height: 32;
   -fx-min-width: 280;
   -fx-border-color: #555;
   -fx-border-width: 1 1 1 1;
   -fx-background-color: #333;
   -fx-text-fill: rgb(196,188,222);
}

.combo-box-base {
   -fx-border-radius: 5;
   -fx-background-radius: 5;
   -fx-min-height: 35;
   -fx-background-color: #333;
   -fx-border-color: transparent;
   -fx-border-width: 2 2 2 2;
}

.combo-box-base .arrow-button {
    -fx-background-color: radial-gradient(radius 100%, rgb(22, 33, 188), rgb(3,22,122));
}

.combo-box .combo-box-popup, .list-view, .list-cell {
    -fx-background-color:  #333;
    -fx-text-fill: rgb(155,188,166);
}

.combo-box .text-input {
    -fx-border-radius: 5;
    -fx-background-radius: 5;
    -fx-background-color: #333;
    -fx-border-color: #555;
    -fx-border-width: 1 1 1 1;
    -fx-text-fill: rgb(155,188,166);
}

.scroll-bar {
    -fx-background-color: #222;
}

.scroll-bar .thumb {
    -fx-background-color: radial-gradient(radius 100%, rgb(22, 33, 188), rgb(3,22,122));
}

.label {
    -fx-font: 14px "Arial";
    -fx-border-color: rgb(57, 58, 59);
    -fx-border-width: 2 2 2 2;
    -fx-text-fill: rgb(155,188,166);
}

.progress-bar > .track {
  -fx-text-box-border: rgb(44, 44, 44);
  -fx-control-inner-background: rgb(22, 22, 44);
}

<强> OUT:

L = [[], [1, 4]]
C = filter(lambda x: x!=[], L)
print(C)

<强> ALTERNATIVE:

[[4,2]]

<强> OUT:

C = filter(lambda x: len(x) > 0, L)
print(C)