Tagged Questions
Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python.
0
votes
3answers
12 views
Remove trailing white space in python 3
Having bit of trouble with a program i made. i am getting it to display a diamond but i have a problem, here is my code:
a = input("Enter width: ")
a = int(a)
b = a
for i in range(a):
i = i + 1
b ...
1
vote
0answers
6 views
SQLAlchemy show me that “AttributeError: type object 'User' has no attribute 'columns'”
I am building a small project use python+Flask+SQLAlchemy, I make a model file following:
################# start of models.py #####################
from sqlalchemy import Column, Integer, String, ...
0
votes
0answers
5 views
Does pytest parametrized test work with unittest class based tests?
I've been trying to add parametrized @pytest.mark.parametrize tests to a class based unittest.
But the parametrized stuff didn't kick in:
TypeError: test_default_values() takes exactly 3 arguments ...
0
votes
2answers
18 views
Permutation with redundant overlaps? Python
I used itertools to run a permutation on a list that I have.
mylist = [a, b, c, d, e, f]
mypermutations = itertools.permutations(mylist,2)
mypermutations_list = list(mypermutations)
print ...
0
votes
0answers
15 views
Executing many python scripts via “execfile()” fails
I am using the matplotlib library for rendering charts and python-mapnik for maps out of a postgresql/postgis database. For each plot or map I use a single *.py script which works perfectly. However, ...
2
votes
0answers
12 views
Interpolate only one value of a TimeSerie using Python / Pandas
I have a pandas.core.series.TimeSeries named ts like this:
timestamp
2013-08-11 14:23:50 0.3219
2013-08-11 14:23:49 0.3222
2013-08-11 14:19:14 0.3305
2013-08-11 00:47:15 0.3400
2013-08-11 ...
0
votes
0answers
14 views
scrapping with curl on web page [on hold]
I am using PHP too scrap a site. In firebug it shown me data but when I scrap or see source code then data does not shown. How can I get this data . I am using PHP/Python + Curl
I think there is any ...
0
votes
1answer
6 views
python pandas operations on columns
Hi I would like to know the best way to do operations on columns in python using pandas.
I have a classical database which I have loaded as a dataframe, and I often have to do operations such as for ...
0
votes
0answers
5 views
goagent upload error on windows os
I click the uploader.bat to upload my new app id but catch the error:
Host: appengine.google.com Rolling back the update. Traceback (most
recent call last): File "python27.py", line 82, in ...
-1
votes
0answers
15 views
setting the text of a label with info from a library in python [on hold]
How to correct this line of code ?
self.LblGetLogin.setText(employee_dict['employee_id'][0])
Its a simple code where I want to take the employee ID and put it in the label and its not working ...
0
votes
2answers
18 views
Python Priority Queue checking to see if item exists without looping
import heapq
class PriorityQueue:
def __init__(self):
self.heap = []
def push(self, item, priority):
pair = (priority,item)
heapq.heappush(self.heap,pair)
def ...
0
votes
0answers
14 views
BeautifulSoup Comment parsing
I have an html code in which I take the Comments and parse it. The comments are in a json format. There is an error while loading the json.
>>> from bs4 import BeautifulSoup, Comment
...
-1
votes
1answer
43 views
python list appending is not working
I have something similar to:
>>> S=list()
>>> T=[1,2,3]
>>> for t in T:
... print(S.append(t))
The output I am getting is:
...
None
None
None
I expect S contains ...
-1
votes
0answers
22 views
OpenSource maps where to start
I am new to mapping and geo information, using python I need to get static maps (as a png), and draw on them (polylines, markers etc.) and cache maps. I do not want to store all the data ahead of time ...
-1
votes
1answer
38 views
Permutation in python
I am running python 3.0 and need to make a permutation from a list of 7 numbers in that list, but I am not finding any decent sample code or guide to create all the permutations.
Could someone ...