标签: rows

"透视"Excel中的表格

我在Excel 2007中有大量数据,但行应该是列,反之亦然.是否有一种简单的方法来"旋转"这个电子表格,重新排列所有单元格,使行成为列?

excel datagrid pivot-table rows

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

我在R中有一个大表,现在我想选择奇数行并在该行的第一个元素之前粘贴一个标签

A=matrix(0,4,2)

A[1,1]=2
A[1,2]=3
A[2,1]=2
A[2,2]=3
A[3,1]=2
A[3,2]=3
A[4,1]=2
A[4,2]=3
Run Code Online (Sandbox Code Playgroud)

现在我想要获取第2,4行并在行this is odd的第一个元素之前返回.

但我不知道如何制作循环来获取第2,4行

select loops r rows

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

在EditorGridPanel中上下移动行

有没有人知道/在EditorGridPanel中有一个移动行的工作示例(或者知道它为什么不适合我)?我找到了一些例子,我发现的例子使用了这种方法:

// calculate the new index, then remove the record from the store, and re-insert it at the new index
grid.getStore().remove(record);
grid.getStore().insert(index, record);
Run Code Online (Sandbox Code Playgroud)

在我的情况下,这失败了.它在网格中看起来不错,但实际上有2个DELETE http请求被发送到服务器,而没有PUT.当我重新加载页面时,这变得很明显 - 移动的行实际上已被删除.

他是我店的基本配置:

var remoteJsonStore = new Ext.data.JsonStore({
            storeId: 'colStore',
            autoDestroy: false,
            autoSave: true,
            proxy: new Ext.data.HttpProxy({url:'/exercises/collect/data_rows'}),
            restful: true,
            format: 'json',
            disableCaching: false,
            autoLoad: true,
            writer: new Ext.data.JsonWriter({
              encode: false
            }),
            root: 'data',
            idProperty: 'data_row_id',
            fields: recordFields,
            baseParams:{section_id:GridUtils.properties[gridId]['section_id']},
            listeners:{
              exception:function(misc){
                 // stuff....
              },
              beforewrite:function(store, action, rs, options, arg){
                this.baseParams["position"]=rs.rowIndex;
              },
              beforesave:function(store, data){
                 // stuff....                } …
Run Code Online (Sandbox Code Playgroud)

grid extjs rows extjs3

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

Mysql JOIN多个表并选择多个值

首先,我想为我糟糕的英语道歉.我有多个表的问题.我不是mySQL世界中的新手,但我无法找到解决这个问题的方法.对于这个问题,我使用4个表.

  1. 分类
  2. 制品
  3. 产品规格
  4. Specificationvalues

每个类别都有规格和产品,每个规格值都有产品和规格ID.现在,用户可以使用不同的值进行选择.这就是我的问题所在.当用户选择值"绿色"和腿"4"时,我想要所有带有4条腿的绿色产品.所以我使用JOIN(我认为各种各样)来选择合适的产品(例如下面的例子)

SELECT DISTINCT products.id 
FROM products 
  LEFT JOIN specificationvalues ON specificationvalues.products_id = products.id 
  LEFT JOIN specifications ON specificationvalues.specifications_id = specifications.id 
WHERE specifications.name='materiaal' 
  AND specifications.name='kleur' 
  AND specificationvalues.id='77' 
  AND specificationvalues.id='78'
Run Code Online (Sandbox Code Playgroud)

问题是所有值都在不同的行中.这就是为什么WHERE不起作用的原因.我没有得到MySQL错误.只有它返回0行.

我希望有一个人可以帮助我!我从这个论坛得到了很多好东西,所以我希望它会再帮助我!


我不知道为什么我的改变昨天没有保存.但这是我的数据:

SPECIFICATIONS Table
ID   CATEGORIES_ID     NAME
38   297               Material
39   297               Measures
40   297               Color

SPECIFICATIONVALUES Table
ID   SPECIFICATIONS_ID  PRODUCTS_ID   VALUE
1    38                 988979        Masive wood 
2    39                 988979        24x57x98
3    40                 988979        Yellow
4    40                 988980        Black
5    39                 388980        24x57x98


PRODUCTS Table
ID …
Run Code Online (Sandbox Code Playgroud)

mysql join rows

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

SQL Query在另一个表上使用Condition WHERE时从一个表返回各种行

我有这两个表:

Factura

    FacturaID (PK) int
    Fecha date
    Total money
Run Code Online (Sandbox Code Playgroud)

FacturaDetalle

    FacturaDetalleID (PK) int
    FacturaID int FK on Factura.FacturaID
    ProductoID char(10) FK on Producto.ProductoID
    Precio money
Run Code Online (Sandbox Code Playgroud)

PRODUCTO

    ProductoID (PK) char(10)
    Descripcion char(50)
Run Code Online (Sandbox Code Playgroud)

现在添加一些数据:

INSERT INTO Producto (ProductoID, Descripcion) VALUES ('1', 'soda')
INSERT INTO Producto (ProductoID, Descripcion) VALUES ('2', 'papas')
INSERT INTO Producto (ProductoID, Descripcion) VALUES ('3', 'pan')

INSERT INTO Factura (Fecha, Total) VALUES ('Some Date', 100) SELECT SCOPE_IDENTITY() //Returns FacturaID = 1

INSERT INTO FacturaDetalle (FacturaID, ProductoID, Precio) VALUES (1, '1', …
Run Code Online (Sandbox Code Playgroud)

sql join rows

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

如何在MATLAB中计算Cell数组中的行数

我想在MATLAB中计算Cell数组中的行数.我使用下面的代码来计算单元格数组中的列数,但我不知道它计算行的方式.

filledCells = ~cellfun(@isempty,a);
columns = sum(filledCells,2)
Run Code Online (Sandbox Code Playgroud)

举个例子,我有x作为单元格数组:

x =     [5]    [1x8 double]    [5]
Run Code Online (Sandbox Code Playgroud)

该单元阵列有一行三列.我需要一个代码来计算等于"1"的行数,但我没有找到计算它的方法.

matlab rows cell-array

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

jQuery设置交替的颜色行

我正在寻找我的问题的具体答案.这就是,我有一行包含一定数量的div(动态设置).我想要的是交替地将div(3 div)的背景设​​置为另一种颜色,如下所示: 在此输入图像描述 这可以通过CSS奇数和偶数伪类完成,还是应该通过jQuery完成?

css jquery rows alternating

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

如何将DIV排成一行

参考下面的HTML,有四个DIV容器,每个容器包含一个图像,heading-element,paragraph-element和一个链接.当页面在全尺寸计算机显示器上打开时,我希望三个div在屏幕上并排排列.

到目前为止,它们只是垂直向下堆叠在屏幕上.

<div class="threeSpread">
    <div class="outer">
    <img src="imagesForNew/new1.jpg">
    <h2>CHININESE INVESTORS COME TO DETROIT</h2>
    <p>"the Shanghai-based developer Dongdu International (DDI) made its first move. In an online auction, it snapped up three iconic downtown properties, all built during the citys early 20th-century"</p>
     <a href="http://www.theguardian.com/cities/2014/jul/22/does-multimillion-dollar-chinese-investment-signal-detroits-rebirth">theguardian.com</a>
    </div>

    <div class="inner">
    <img src="imagesForNew/new1.jpg">
    <h2>CHININESE INVESTORS COME TO DETROIT</h2>
    <p>"the Shanghai-based developer Dongdu International (DDI) made its first move. In an online auction, it snapped up three iconic downtown properties, all built during the citys early …
Run Code Online (Sandbox Code Playgroud)

html css rows

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

dataGridView“删除空行”-按钮

总结:

  • Windows 10

  • Visual Studio 2015

  • C#,赢表格

  • dataGridView

->尝试删除按钮单击事件上的空行

(我不知道问题出在哪里,所以我慷慨地从其他按钮添加了代码)


我正在使用一些按钮来添加行:

private void someButton_Click(object sender, EventArgs e)
{
    dataGridView1.Rows.Add(1);
    dataGridView1.Select();
    dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];
}
Run Code Online (Sandbox Code Playgroud)

另一个按钮删除dataGridView的最后一行:

private void anotherButton_Click(object sender, EventArgs e)
{
    if (dataGridView1.Rows.Count > 0)
    {
        dataGridView1.Rows.Remove(dataGridView1.Rows[dataGridView1.Rows.Count - 1]);
    }
}
Run Code Online (Sandbox Code Playgroud)

由于(目前)用户将能够自由编辑dataGridView中的单元格,因此某些行可能最终为空。为了解决这个问题,我尝试添加第三个按钮以删除空行:

private void thirdButton_Click(object sender, EventArgs e)
{
    foreach (DataGridViewRow row in dataGridView1.Rows)
    {
        if (row.Cells[0].Value == null)
        {
            dataGridView1.Rows.RemoveAt(row.Index);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)


当我按下“ thirdButton”时,有些空行被有趣地移除了,但并不是全部。我玩了一会儿,发现我不得不多次按下按钮才能擦除所有空行。dataGridView的行为如下:

存在4个空行+按下按钮
->剩下2个空行

2个空行+按下按钮
->剩下1个空行

最后1个空行+按下按钮
-> 0个空行(是的)

(与例如11-> 5-> 2-> 1-> …

c# datagridview rows winforms visual-studio-2015

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

如何在numpy数组中查找并保存重复的行?

我有一个数组

Array = [[1,1,1],[2,2,2],[3,3,3],[4,4,4],[5,5,5],[1,1,1],[2,2,2]]
Run Code Online (Sandbox Code Playgroud)

而且我想输出以下内容:

Repeated = [[1,1,1],[2,2,2]]
Run Code Online (Sandbox Code Playgroud)

保留重复行的数量也可以,例如

Repeated = [[1,1,1],[1,1,1],[2,2,2],[2,2,2]]
Run Code Online (Sandbox Code Playgroud)

我以为解决方案可能包括numpy.unique,但我无法使其正常工作,是否有本机python / numpy函数?

python numpy rows

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