Question: PYTHON: # Create a new column named Q7 and assign value based on following rule: # Q7 = 100 if product code < 120 AND

PYTHON:

# Create a new column named Q7 and assign value based on following rule: # Q7 = 100 if product code < 120 AND dollar value >200,000 AND unit sold >800 else # Q7 = 20 if product code < 150 AND dollar value <150,000 AND 300 < unit sold else # Q7 = -20 if product code < 180 AND dollar value <150,000 else # Q7= -10

Firm time_hour unit sold product code dollar value
Prudential Financial 15 439 127 779546
Consolidated Edison 10 985 116 237185
State Street Corporation 18 905 119 199437
Ball Corp 20 875 124 652241
Linde 17 874 116 825544
Consolidated Edison 12 346 127 895683
CenterPoint Energy 17 227 106 363095
Kroger 8 254 105 145291
Consolidated Edison 20 845 137 484035
PVH 10 337 139 253507
Eli Lilly & Co 11 740 147 779108
M&T Bank 18 902 127 245723
PVH 12 945 124 145881
Zions Bancorp 15 777 143 595041
Principal Financial Group 16 510 148 428109
FMC Corporation 11 883 120 251743
American Express 7 862 134 37938
General Mills 14 922 149 127441
Comerica 10 718 114 54137

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!