python python python

Python
python python pythonpython python pythonpython python pythonpython python python
1 year ago

Python - Concatenate Python query

Python
I'm using the python-google-places script but I'm facing a problem when integrating the code into a function called with two parameters: "MyLocation" ...
2 years ago

How to calculate a rolling mean from a series of dates spanning years?

Python
I have a CSV file containing stock data spanning 10 years. How do I find the rolling mean of those dates using Pandas? I've tried: pd.rolling_mean(df...
2 years ago

How to print to stderr in Python?

Python
I've come across at least three ways to print to stderr: import sys print >> sys.stderr, 'spam' sys.stderr.write('spam\n') from __future...
2 years ago

Python unicode string literals in module declared as utf-8

Python
I have a dummie Python module with the utf-8 header that looks like this: # -*- coding: utf-8 -*- a = "รก" print type(a), a Which prints: <type ...
2 years ago

Can't get my function to do anything

Python
Working on a program that "encrypts" and "decrypts" an input string, no matter how I arrange my returns or function calls. I feel like something is st...
2 years ago

Is there a decent way of creating a copy constructor in python?

Python
I realize questions quite similar to this have been asked, though not exactly this way. I'd like to have an optional argument for the constructor of ...
2 years ago

Nested loop output confusion

Python
for i in range(2): for j in range(2): print(i, j, end='') Hey guys so im just having problems understanding this concept of nested loops...
2 years ago

Django formtools wizard produces blank page (No error returned)

Python
I'm trying to use the formwizard in formtools package with no success (I was able to do it when the package was inside Django in earlier versions). ...
2 years ago

Import caffe error

Python
i compiled caffe successfully in my ubuntu machine but cannot import in python. Caffe is installed /home/pbu/Desktop/caffe i tried adding the /home/...
2 years ago

"relation already exists" after adding a Many2many field in odoo

Python
I've defined the following two odoo ORM models: class Weekday(models.Model): _name = 'ludwik.offers.weekday' name = fields.Char() class Dura...
2 years ago

Python: Split a string at uppercase letters

Python
What is the pythonic way to split a string before the occurrences of a given set of characters? For example, I want to split 'TheLongAndWindingRoad'...
2 years ago

Erase ram space used by variable in python, prevent memory dump attack

Python
Looking for a verified solution for this problem in python. I have code like this verySensitveData = "secret, big secret" #useing verySensitveData in...
2 years ago

How would you make a comma-separated string from a list?

Python
What would be your preferred way to concatenate strings from a sequence such that between each two consecutive pair a comma is added. That is, how do ...
2 years ago

No schema supplied and other errors with using requests.get()

Python
I'm learning Python by following Automate the Boring Stuff. This program is supposed to go to http://xkcd.com/ and download all the images for offline...
2 years ago

What are the risks of running 'sudo pip'?

Python
Occasionally I run into comments or responses that state emphatically that running pip under sudo is "wrong" or "bad", but there are cases (including ...
2 years ago

python print syntax error

Python
I am experimenting with Hilbert curves written in Python in an Xcode IDE. The code listing is: # python code to run the hilbert curve pattern # fr...
2 years ago

Arabic characters in emails are getting decoded (Django)

Python
I used this code to help me send emails from the linux server, everything is working fine except that if there was an Arabic character all of the emai...
2 years ago

import excel file error python panda

Python
I have trouble loading excel files into a dataframe using ExcelFile(). I have imported pandas,xlrd and openpyxl. I am using spyder for interactive dat...
2 years ago

Dynamic programming doesn't give correct answer

Python
I recently found out about the technique called dynamic programming and I stumbled upon a problem which I can't figure out. You are given a list of ar...
2 years ago