我试图通过目录中的列表图像将PNG图像转换为视频
clips[]
for filename in os.listdir('.'):
if filename.endswith(".png"):
clips.append(ImageClip(filename))
Run Code Online (Sandbox Code Playgroud)
然后转换
video = concatenate(clips, method='compose')
video.write_videofile('test.mp4')
Run Code Online (Sandbox Code Playgroud)
import os
from moviepy.editor import *
clips = []
base_dir = os.path.realpath(".")
print(base_dir)
for filename in os.listdir('.'):
if filename.endswith(".png"):
clips.append(ImageClip(filename))
video = concatenate(clips, method='compose')
video.write_videofile('test.mp4')
Run Code Online (Sandbox Code Playgroud) 如何在综合图表中表示以下数据?尝试使用 Pandas 中的 group by() 但结果不全面。我的目标是展示导致以下组合之间事故最多的原因
pieton bicyclette camion_lourd vehicule
0 0 1 1
0 1 0 1
1 1 0 0
0 1 1 0
0 1 0 1
1 0 0 1
0 0 0 1
0 0 0 1
1 1 0 0
0 1 0 1
y = df.groupby(['pieton', 'bicyclette', 'camion_lourd', 'vehicule']).size()
y.unstack()
Run Code Online (Sandbox Code Playgroud)
结果: