我想要两个不同的网络摄像头视频输出,一个是普通的网络摄像头镜头,另一个是它的“镜像”版本。cv2可以吗?
import time, cv2
video=cv2.VideoCapture(0)
a=0
while True:
a=a+1
check, frame= video.read()
gray=cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow("Capturing",gray)
key=cv2.waitKey(1)
if key==ord('q'):
break
print(a)
video.release()
cv2.destroyAllWindows
Run Code Online (Sandbox Code Playgroud) I have a DataFrame that looks like this:
| Age | Married | OwnsHouse |
| 23 | True | False |
| 35 | True | True |
| 14 | False | False |
| 27 | True | True |
Run Code Online (Sandbox Code Playgroud)
I want to find the highest age of anyone who is married and owns a house. The answer here would be 35. My first thought was to do:
df_subset = df[df['Married'] == True and df['OwnsHouse'] == True] …Run Code Online (Sandbox Code Playgroud) 我想找到平均总收入最高的州,并能够看到1992-2016年所有州的平均总收入最高的州(第40-45位),第35-40位(最高)的州。
数据组织在下图中的数据框中。因此,理想情况下,我可以有另一列如下所示。我想这就是我要做的。
STATE // YEAR // TOTAL_REVENUE // AVG_TOTAL_REVENUE
ALABAMA // 1992 // 5000 // 6059
ALABAMA // 1993 // 4000 // 6059
ALASKA // 1992 // 3000 // 2059
ALABAMA // 1996 // 6019 // 6059
Run Code Online (Sandbox Code Playgroud)
这可能吗?我不确定我是否要说出我想正确做的事情,也不确定我在寻找谷歌明智的方法以找出前进的方向。