How to read center pixel color

Python
The input image link is : Input Image I want to read the center pixel value of the input image as shown above and detect color If output color is ...
2 years ago

Custom user model in django

Python
I want to create a custom user model using django.contrib.auth.models.AbstractUser as stated in the djangodocs: If you’re entirely happy with Djan...
2 years ago

Can a Python script use a Django database while not being in the same folder?

Python
I have a python application (which we'll call app) I'd like to have a web front for. The application has many files and it's important the folder tree...
2 years ago

error in python d not defined.

Python
I am learning python and have this error . I can figure out where\what the error is in the code. File "<string>", line 1, in <module>. Na...
2 years ago

Finding the most common pair, trio, etc. in a list of 20 random numbers, played 100 times

Python
So I have a CSV with 100 rows, 20 numbers on each row separated with a comma as such: 23, 52, 63, 76, 23, 45, ... 39, 52, 83, 33, 35, 23, ... etc. ...
2 years ago

Project Euler 5 in Python - How can I optimize my solution?

Python
I've recently been working on Project Euler problems in Python. I am fairly new to Python, and still somewhat new as a programmer. In any case, I've...
2 years ago

Django upload and process file with no data retention

Python
Python: 2.7.11 Django: 1.9 I want to upload a csv file to Django and analyze it with a Python class. No saving is allowed and the file is only neede...
2 years ago

python pandas: reverse df column order

Python
I want to simply reverse the column order of a given df. my df data = {'year': [2010, 2011, 2012, 2011, 2012, 2010, 2011, 2012], 'team': ['Bea...
2 years ago

Getting AttributeError on nltk Textual entailment classifier

Python
Im referring to the link in the section http://www.nltk.org/book/ch06.html#recognizing-textual-entailment def rte_features(rtepair): extractor = ...
2 years ago

How to skip a section in config file using configparser

Python
I have written a code where parameters are taken from a config file. My first parameter in the config is for setting the debug level. config = Co...
2 years ago

Location of contour lines

Python
Below is my code and plot: import matplotlib import matplotlib.mlab as mlab import matplotlib.cm as cm import matplotlib.pyplot as plt import numpy a...
2 years ago

Python - Write Header Once - Loop isn't working properly

Python
I am trying to write an "order file" with a Header and Detail Lines. I am successfully getting the order Header to write to file, but only one detail...
2 years ago

Mark ticks in latex in matplotlib

Python
In a plot in matplotlib I specially want to mark points on the x-axis as pi/2, pi, 3pi/2 and so on in latex. How can I do it?
2 years ago

Django Queryset for substr matching that starts from the beginning of a string

Python
I have model Word, where every instance of the model stores a word or phrase in a field called text. e.g., "matches" "match" "match sticks" "matching"...
2 years ago

save values in database using django

Python
i have an custom form , whenever i fetch the form values to save in the database than it display an error ( applicationform() got an unexpected keywor...
2 years ago

Refresh Browser tab in the background (Python script)

Python
This may not be the right platform to ask to ask this question. I was looking for an application that refreshes a particular tab in the browser so t...
2 years ago

Python - Find second smallest number

Python
I found this code on this site to find the second largest number: def second_largest(numbers): m1, m2 = None, None for x in numbers: ...
2 years ago

Remove newline from file in python

Python
I'm trying to remove all new line characters from a string. I've read up on how to do it, but it seems that I for some reason am unable to do so. Here...
2 years ago

How to send an email with Python?

Python
This code works and sends me an email just fine: import smtplib #SERVER = "localhost" FROM = '[email protected]' TO = ["[email protected]"] # must...
2 years ago

Round up numbers such as 1.23 to 2 in Python

Python
Please tell me how to round up numbers in Python. If I have 1.47, how to round it up to 2 ? Or if I have 10.13, how to round it up to 11? The answe...
2 years ago