extensive Linux user with python and php programming

1d
comment How to stop collections.Counter from omitting a key if its value is 0?
In counter the value off missing element is 0. So, if you do c = Counter({'b': 78, 'a': 46, 'c': 3}). c['d'] will be 0 but so will be any key other than 'a', 'b', 'c'
2d
answered How else can I troubleshoot this cron job?
Jun
14
comment LXML : Populating Pandas DataFrame
I guess, I am misunderstanding your issue here. But what you have done with setdefault can be achieved with d=defaultdict(list). Which would give you dynamism over your keyname
Jun
14
comment LXML : Populating Pandas DataFrame
have you looked into defaultdict ? Why not d={'Total Revenue': []} when defining d ?
Jun
12
awarded Enthusiast
May
27
answered How to set format as hour in babel.dates.format_date?
May
20
awarded Yearling
May
20
revised Check for empty list
added 48 characters in body
May
20
comment Check for empty list
@gojomo Do you mean any([]) will be True? I think all([]) is True and not any.The problem I see with any is if the list allows other values as [0] etc where any is wrong.
May
20
answered Check for empty list
May
19
comment Python : Writing a dictionary to a csv (short way)
@EmmetB It should not repeat as it is not much different than what you are doing with loop AFAIK. Also testing in your code snippet it works as expected. You could make a list with the comprehension and use that as well. [dict(mydict[key], name=key) for key in mydict]
May
19
answered Python : Writing a dictionary to a csv (short way)
May
19
answered what makes a python webscrape output unicode?
May
2
comment Bad Gateway on Nginx Server
did you install php5-fpm ? You need to install that for php with nginx.
Apr
27
awarded Famous Question
Apr
24
revised How to check if two instances are of the same class Python
added 94 characters in body
Apr
24
revised How to check if two instances are of the same class Python
deleted 200 characters in body
Apr
24
answered How to check if two instances are of the same class Python
Apr
23
answered Better way to set default value in django model field
Apr
23
comment Better way to set default value in django model field
I am currently checking out select_for_update to see if that will work out. I guess this is also a valid alternative approach so accepting it. Wouldn't there be break after save inside the loop ?
1 2 3 4 5