tagged [python]

Convert DataFrame column type from string to datetime

Convert DataFrame column type from string to datetime How can I convert a DataFrame column of strings (in format) to datetime dtype?

How do I get the picture size with PIL?

How do I get the picture size with PIL? How do I get a size of a pictures sides with PIL or any other Python library?

Sending SOAP request using Python Requests

Sending SOAP request using Python Requests Is it possible to use Python's [requests](http://docs.python-requests.org/en/master/) library to send a SOAP request?

17 Oct at 16:26

How do I use raw_input in Python 3?

How do I use raw_input in Python 3? In Python 2: In Python 3, I get an error: > NameError: name 'raw_input' is not defined

17 Jul at 06:56

Import error: No module name urllib2

Import error: No module name urllib2 Here's my code: Any help?

17 Jan at 06:5

What are data classes and how are they different from common classes?

What are data classes and how are they different from common classes? With [PEP 557](https://www.python.org/dev/peps/pep-0557/) data classes are introduced into python standard library. They make use ...

How to use XPath in Python?

How to use XPath in Python? What are the libraries that support XPath? Is there a full implementation? How is the library used? Where is its website?

10 Jul at 14:39

Type hinting a collection of a specified type

Type hinting a collection of a specified type Using Python 3's function annotations, it is possible to specify the type of items contained within a homogeneous list (or other collection) for the purpo...

In Python, how do I read the exif data for an image?

In Python, how do I read the exif data for an image? I'm using PIL. How do I turn the EXIF data of a picture into a dictionary?

Pinging servers in Python

Pinging servers in Python In Python, is there a way to ping a server through ICMP and return TRUE if the server responds, or FALSE if there is no response?

1 Jun at 21:27

Subtract a value from every number in a list in Python?

Subtract a value from every number in a list in Python? I have a list How do I subtract 13 from each integer value in the list?

4 Oct at 00:39

How do I find out my PYTHONPATH using Python?

How do I find out my PYTHONPATH using Python? How do I find out which directories are listed in my system’s `PYTHONPATH` variable, from within a Python script (or the interactive shell)?

23 Apr at 00:35

How do I resize an image using PIL and maintain its aspect ratio?

How do I resize an image using PIL and maintain its aspect ratio? Is there an obvious way to do this that I'm missing? I'm just trying to make thumbnails.

Syntax error on print with Python 3

Syntax error on print with Python 3 Why do I receive a syntax error when printing a string in Python 3?

12 Sep at 07:20

How to put comments in Django templates?

How to put comments in Django templates? I would like to comment this with a line:

How to terminate a thread when main program ends?

How to terminate a thread when main program ends? If I have a thread in an infinite loop, is there a way to terminate it when the main program ends (for example, when I press +)?

cursor.fetchall() vs list(cursor) in Python

cursor.fetchall() vs list(cursor) in Python Both methods return a list of the returned items of the query, did I miss something here, or they have identical usages indeed? Any differences performance-...

22 Dec at 22:23

How can I represent an 'Enum' in Python?

How can I represent an 'Enum' in Python? I'm mainly a C# developer, but I'm currently working on a project in Python. How can I represent the equivalent of an Enum in Python?

22 Sep at 16:3

What is an alternative to execfile in Python 3?

What is an alternative to execfile in Python 3? It seems they canceled in Python 3 all the easy way to quickly load a script by removing `execfile()` Is there an obvious alternative I'm missing?

15 Jan at 06:15

How to run a python script from IDLE interactive shell?

How to run a python script from IDLE interactive shell? How do I run a python script from within the IDLE interactive shell? The following throws an error:

16 Feb at 16:46

How to obtain a Thread id in Python?

How to obtain a Thread id in Python? I have a multi-threading Python program, and a utility function, `writeLog(message)`, that writes out a timestamp followed by the message. Unfortunately, the resul...

No module named MySQLdb

No module named MySQLdb I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. I am using it in Windows Vista.

19 Feb at 11:15

How is Python's List Implemented?

How is Python's List Implemented? Is it a linked list, an array? I searched around and only found people guessing. My C knowledge isn't good enough to look at the source code.

Infinite integer in Python

Infinite integer in Python Python 3 has `float('inf')` and `Decimal('Infinity')` but no `int('inf')`. So, why a number representing the infinite set of integers is missing in the language? Is `int('in...

8 Feb at 07:42

Integrating Python Poetry with Docker

Integrating Python Poetry with Docker Can you give me an example of a `Dockerfile` in which I can install all the packages I need from `poetry.lock` and `pyproject.toml` into my image/container from D...