Skip to content

ValueError: DataFrame constructor not properly called

I am trying to create a dataframe with Python, which works fine with the following command: but, when I try to get the data from a variable instead of hard-coding it into the data argument; eg. : I expect this is the same and it should work? But I get: Answer Reason for the error: It seems a string representa…

Multithreaded pyodbc connection

I am trying to use a pyodbc connection in multiple threads. I am receieving the following error: Connection is busy with results for another command (0) (SQLExecDirectW)’). I also tried setting MultipleActiveResultSets=yes; and got the same results. I really don’t want to have to create a connecti…

MQTT Python-Client disconnect ungracefully

I wrote basic MQTT python-client. But it disconnect ungracefully without giving any error. When i look event log file i found it’s connected and same time is disconnected ungracefully. Here i attached a snap of event log also. Answer @MikeScotty’s answer is not right. What’s missing is start…

Pyinstaller error on scrapy?

I am using scrapy importing it. I built the python file using pyinstaller. After building it I ran the file ./new.py. But the error pops: Answer You did not use Pyinstaller properly when you had built your stand-alone program. Here is a short, layman’s description of how Pyinstaller works: Pyinstaller b…

Installing GDCM on Windows — ImportError

I am trying to install GDCM on Windows (10, x64) so I can use the GDCM package with Python 3.6.5, and am finding it completely impossible. I have tried every combination of: Installing GDCM-2.8.7-Windows-x86_64, GDCM-2.8.7-Windows-x86.exe, GDCM-2.8.4-Windows-x86.exe (separately, of course) Adding To PYTHONPAT…

terminal error: flask run zsh: command not found: flask

I’m using a Mac , the python version is 2.7.10. and I installed flask I try to follow the tutorial of flash on http://flask.pocoo.org/docs/1.0/ the commands: code in flaskblog.py: The error is command not found: flask I also tried an other tutorial. commands: code in one.py the condition __name__ == &#8…

Image Type Error: OpenCV Python

I get an image type error when I run my code. I know HoughLinesP requires a grayscale image but when I try to convert the source image to grayscale I get the following error(1): error: (-215) depth == 0 || depth == 2 || depth == 5 in function cv::cvtColor If I run HoughLinesP without converting to grayscale I…

How does Python’s reversed() function work?

According to Python’s docs, reversed() uses __getitem__ and __len__ if __reversed__ is not implemented. I’ve encountered a weird behavior and failed to explain it: Although calling reversed() on mapping types makes no sense, how does it know it’s a mapping? Does it internally check isinstanc…