I am developing a web application with Flask Python. I have a Mysql table with a text column date: These data above are date in string format. I need to convert these string dates into format dates. I did this in python : But I get this error output: I don’t understand as ’18/02/2020 20:14:31′ corresponding perfectly to format ‘%d/%m/%y
Tag: python-3.x
How to plot 3D points in Matplotlib
I have a question I have a dataset which contain 1200060 rows and 3 column. column contain points and I have to draw a 3D plot for it. I’m using the code below but I don’t know where is the error. error is: I tried this one too but unsuccessful this one run but didn’t show any output and using
Why is my class object not working as intended?
I have two issues that need resolving. I have created a class object LoanInstance. The object should create a list of numbers (int or float) that show different aspects of a personal loan repayment balance. There are 2 main parts to the object. Part 1: Read in data from a data frame (I’ve created an example data frame below) df
Convert Custom String to Dict
HELLO, I need to convert this kind of string to down dict DICT and i tried this and stored each list with the dict like this but this is not the right way to do it! which brings me lot more errors. So, is there any custom functions or module for these things ? Answer I’d use a regex to
How to read file in line and back to specific line to read it again
I am trying to find a specific string in a file(let’s say this is condition 1.1) and if that string was found, I need to find another string right after condition 1.1 string (let’s say this is condition 1.2). if condition 1.2 exist, I need to get back to condition 1.1 plus one line. and readline again from there in
How to decode binary content to original string content in python?
I have a string which I need to encode into binary. It is very important that I get a value string like ‘11010011100…’, because later I need to insert it into the lowest bit of pixels of a gray scale image. (Basically I am hiding a message inside an image.) I am on windows 10, using python 3.6.8. Following this
How to zoom in and out of an image pygame and using the mousposition as the center of the zoom
I am having an issue with PyGame i can’t resolve. So: my idea is that I have a map I can zoom in/out on. zooming in works fine. But zooming out shows that the rest of the picture got deleted and only the part of the image that was previously visible on the window exists now. This is my code:
How can I print a single row element in Python DictReader
I’ve got a program to find DNA matches. We’ve been given a one line text file for finding the longest sequence of STR(Short Tandem Repeats) then match the result with a database which has been a .cvs file as below: After getting results for longest sequence amounts(as integer) I’m trying to find a match in this cvs file and print
How to merge two dataframes and eliminate dupes
I am trying to merge two dataframes together. One has 1.5M rows and one has 15M rows. I was expecting the merged dataframe to haev 15M rows, but it actually has 178M rows!! I think my merge is doing some kind of Cartesian product, and this isn not what I want. This is what I tried, and got 178M rows.
InvalidImageFormatError Exception The source file does not appear to be an image
So I am using fallback default image to avoid 500 error and it is not successful. I keep getting the same error “InvalidImageFormatError: The source file does not appear to be an image”. In my case I try to thumbnail an image that does not exist. But it is assumed that if the image does not exist it should use