converters

How to convert a video in numpy array

How to convert a video in numpy array Question: Program to convert a video file into a NumPy array and vice-versa. I had searched for many search engines but was unable to find the answer. Asked By: Aakarsh Kumar || Source Answers: There are multiple libraries people use for this (i.e. PyAV, decord, opencv); I …

Total answers: 1

B&W image to binary array

B&W image to binary array Question: I want to convert my b&w image(.png) to binary array(black is 1 white is 0). I have written some code, but it’s not working. Error says: argument 2 to map() must support iteration. Here is my code: from PIL import Image from resizeimage import resizeimage import sys def threshold(col): …

Total answers: 2

Simple unit converter in Python

Simple unit converter in Python Question: I am new to programming and I am trying to make a simple unit converter in python. I want to convert units within the metric system and metric to imperial and vice-versa. I have started with this code and I found this method is slow and in-efficient, How can …

Total answers: 5

How to convert a .pptx to .pdf using Python

How to convert a .pptx to .pdf using Python Question: I have been looking to convert a .pptx file to a .pdf file through a Python script for several hours but nothing seems to be working. What I have tried: I have tried 1) this script which calls windows32.client, and 2) unoconv, but none of …

Total answers: 8

How to convert datetime to integer in python

How to convert datetime to integer in python Question: How can I convert YYYY-MM-DD hh:mm:ss format to integer in python? for example 2014-02-12 20:51:14 -> to integer. I only know how to convert hh:mm:ss but not yyyy-mm-dd hh:mm:ss def time_to_num(time_str): hh, mm , ss = map(int, time_str.split(‘:’)) return ss + 60*(mm + 60*hh) Asked By: …

Total answers: 7