Skip to content
Advertisement

Tag: python-3.x

How to decode and visualize DICOM curve data in Python 3?

I am trying to visualize a DICOM file with Python 3 and pyDicom which should contain a black 100×100 image with some curves drawn in it. The pixel data is extracted from header (7fe0,0010) and when printed shows b’x00x00x00…’. This I can easily convert to a 100×100 numpy array. However, the curve data in (5000,3000) shows me b’x00x00x00x00x00x00x00x00x00x00x00x00x00xc0H@x00x00x00x00x00xc0X@x00x00x00x00x00xc0H@’ which I

Python fails to recognize a digit

I have an input file such as this and the program removes everything but the hindi text. Here is my program and the expected output is below However, my program doesn’t recognize the first line digit, and instead it returns Why does this program doesn’t recognize the digit when I specifically wrote 1 or “1”? Answer Using regex we can

Rock Paper Scissors Always Lets Me Win

I’m a new programmer and am trying to familiarize myself with if else statements by creating a rock paper scissors game. My problem is that the code always lets me win. In addition, my while loop won’t actually loop so any help with this stuff would be greatly appreciated. Thanks! :) The code: Answer The game doesn’t repeat because your

middleware caught exception in streamed response flask app

This is an simple application that inserts data into a mysql db. The data gets inserted correctly but i am not getting the reponse of my post request but the status is 200.request.form works but i want to send json as payload This is my below route and i believe something is wrong when i am checking if the keys

HackerRank Plus Minus ~ no response on stdout ~

Can someone please explain why hackerrank does not accept this code for python? It gives me this error: ~ no response on stdout ~ Answer You will notice that on HackerRank your function is called without doing anything with the return value. The template code looks like this: Moreover, the description says: Print the decimal value of each fraction on

Advertisement