Top "Python-2.7" questions

Python 2.7 is the last major version in the 2.x series, and is no longer maintained since January 1st 2020.

Why are Python's 'private' methods not actually private?

Python gives us the ability to create 'private' methods and variables within a class by prepending double underscores to the …

python python-2.7 encapsulation information-hiding
How do I create test and train samples from one dataframe with pandas?

I have a fairly large dataset in the form of a dataframe and I was wondering how I would be …

python python-2.7 pandas dataframe
In Python, how do you convert a `datetime` object to seconds?

Apologies for the simple question... I'm new to Python... I have searched around and nothing seems to be working. I …

python python-2.7
detect key press in python?

I am making a stopwatch type program in python and I would like to know how to detect if a …

python python-2.7 keypress detect
Why isn't my Pandas 'apply' function referencing multiple columns working?

I have some problems with the Pandas apply function, when using multiple columns with the following dataframe df = DataFrame ({'a' : …

python python-2.7 pandas dataframe apply
How to get current time in python and break up into year, month, day, hour, minute?

I would like to get the current time in Python and assign them into variables like year, month, day, hour, …

python python-2.7 datetime time
How to write a Python module/package?

I've been making Python scripts for simple tasks at work and never really bothered packaging them for others to use. …

python python-2.7 python-module
IndexError: tuple index out of range ----- Python

Please Help me. I'm running a simple python program that will display the data from mySQL database in a tkinter …

python python-2.7 mysql-python
Python add item to the tuple

I have some object.ID-s which I try to store in the user session as tuple. When I add first …

python python-2.7 tuples
Could not find a version that satisfies the requirement tensorflow

I installed the latest version of Python (3.6.4 64-bit) and the latest version of PyCharm (2017.3.3 64-bit). Then I installed some modules …

python python-3.x python-2.7 tensorflow pip