小编ShB*_*ShB的帖子

选择行并根据条件 SQL 生成新列

我在 Oracle 中有下表

Company   Rate   Period
1A        10     sep-16
1B        20     sep-15
1C        30     oct-16
1D        40     sep-16
1A        50     oct-16
2B        50     sep-15
1C        60     oct-14
Run Code Online (Sandbox Code Playgroud)

我想选择一些行并根据条件添加一个值。所以结果将类似于以下内容:

Company   Rate   Period    Currency
1A        50     oct-16    USD
1C        30     oct-16    AED
Run Code Online (Sandbox Code Playgroud)

在上表中,我仅选择了 Period ='oct-16' 的公司 1A、1C。我需要为每家公司添加一列“货币”,其中 1A=USD,1C=AED

我所做的是:

select company, PERIOD , Rate 
from TABLE_test 
where period='Oct-16' And Company='1A' 
    OR period='Oct-16' and Company='1C';
Run Code Online (Sandbox Code Playgroud)

我设法找到了这些公司,但在货币栏上失败了。这可以使用 SQL 命令吗?请帮忙。

sql oracle select

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

mat1 和 mat2 形状不能相乘

我是人工智能和Python的新手,我正在尝试构建一个架构来训练一组图像。然后以过度拟合为目标。但到目前为止,我无法理解如何正确获取输入和输出。每当我尝试训练网络时,我总是看到错误:

mat1 and mat2 shapes cannot be multiplied (48x13456 and 16x64)

我的网络:

net2 = nn.Sequential(

nn.Conv2d(3,8, kernel_size=5, padding=0),
nn.ReLU(),
nn.MaxPool2d(kernel_size=2, stride=2),


nn.Conv2d(8,16, kernel_size=5, padding=0),
nn.ReLU(),
nn.MaxPool2d(kernel_size=2, stride=2),

nn.Flatten(),
nn.Linear(16,64),
nn.ReLU(),
nn.Linear(64,10)
)
Run Code Online (Sandbox Code Playgroud)

这是我正在执行的任务的一部分,我真的不明白为什么它没有运行。任何提示!

python artificial-intelligence conv-neural-network pytorch

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

在python中按组打印列表项

我还是 Python 的新手。我有与以下列表类似的列表:

items = [[4, 'A'], [4, 'B'], [5, 'C'], [5, 'D'], [5, 'E'], [6, 'F'], [6, 'G']]

我试图通过将第一个项目组合在一起来打印它并得到如下内容:

4 : ['A', 'B']
5 : ['C', 'D', 'E']
6 : ['F', 'G']
Run Code Online (Sandbox Code Playgroud)

我该怎么做呢?

python

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