在这里我需要根据其他列创建新列
样本数据:
colum1 column2
M online
L offline
C online
L online
H online
M online
L offline
C online
L offline
在这里我需要创建新列
column1 ='M'&colum2 ='online'-> 3天
Column1 ='M'&colum2 ='offline'-> 5天
像这样,我需要创建一个新列
尝试下面的代码,但我错过了逻辑
sales['Shipment Tat'] = np.where ((sales['Order Priority'] == 'M') & (sales['Sales Channel'] == 'Online') , 'with in 9 days' )
预期产量
column1 column2 column3
M online 3 days
M offline 5 days
L offline 5 days
C online 7 days
L online 7 days
H online 9 days
H offline 11 days
答案 0 :(得分:0)
您可以使用SELECT proj_num708
FROM asmnt708.assignment708
GROUP BY proj_num708
HAVING SUM(emp_num708 = 15) = 0 AND SUM(emp_num708 = 18) = 0;
方法-
<!Doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Dropdown</title>
<style>
body {
margin: 0;
}
.navbar {
background-color: #333;
display: block;
float: left;
width: 100%;
}
.navbar-list a {
float: left;
padding: 14px 15px;
text-decoration: none;
color: #fff;
}
/* courses section*/
.drop-course {
float: left;
margin: 14px 0 0 15px;
}
.course-btn {
border: none;
background-color: inherit;
color: #fff;
font-size: 17px;
}
.courses-list a {
float: none;
display: block;
padding: 12px 16px;
text-align: left;
}
.courses-list {
display: none;
margin-top: 20px;
background-color: #333;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
color: #fff;
}
.drop-course:hover .courses-list {
display: block;
}
/* extra section */
.drop-extra {
float: left;
margin: 14px 0 0 15px;
}
.extra-btn {
border: none;
background-color: inherit;
color: #fff;
font-size: 17px;
}
.extra-content a {
float: none;
display: block;
margn-top: 8px;
padding: 5px;
}
.extra-content {
display: none;
background-color: inherit;
color: #fff;
}
.drop-extra:hover .extra-content {
display: block;
}
.drop-container{
position: relative;
}
.drop-list{
position: absolute;
top: 0;
left: 0;
}
</style>
</head>
<body>
<!--Navigation Section-->
<div class="navbar">
<div class="navbar-list">
<a href="#">Home</a>
<a href="#">Notice</a>
<div class="drop-course drop-container">
<button class="course-btn">Courses</button>
<div class="courses-list drop-list">
<a href="#">Web Development</a>
<a href="#">Android Development</a>
<a href="#">ios Development</a>
</div>
</div>
<a href="#">Admissions</a>
<div class="drop-course drop-container">
<button class="course-btn">extra</button>
<div class="courses-list drop-list">
<a href="#">link1</a>
<a href="#">link2</a>
</div>
</div>
</div>
</div>
</body>
</html>