text stringlengths 226 34.5k |
|---|
Ipython notebook caching issue
Question: Within ipython notebook I call a function imported from my own module and run
some code. I have noticed that if I change the code in the function (outside
of notebook) and execute the notebook the old version of the function runs.
Either ipython notebook or firefox seems to be... |
Run the same IPython notebook code on two different data files, and compare
Question: Is there a good way to modularize and re-use code in IPython Notebook
(Jupyter) when doing the same analysis on two different sets of data?
For example, I have a notebook with a lot of cells doing analysis on a data
file. I have anot... |
Get data structure of all tests found by Nose
Question: How would I get some sort of data structure containing a list of all tests
found by Nose? I came across this:
[List all Tests Found by
Nosetest](http://stackoverflow.com/questions/712020/list-all-tests-found-by-
nosetest)
I'm looking for a way to get a list of u... |
Running Python in a command prompt
Question: I have some python code that I want to run from the cmd prompt, but it's not
working, my partner told me if I had this statement in my code:
if __name__ == '__main__':
xs, a0, a1, y0, y1, ys = encode(sys.argv[1])
np.set_printoptions(precision=6... |
Print variable in large font in python figure
Question: I have borrowed some code from another source and I want to edit the figure
produced. Here is the relevant (i think) code from the script.
import gtk #the gui toolkit we'll use:
from matplotlib.figure import Figure
from Tkinter import *
... |
How to hide console window using python esky 0.9.8?
Question: I currently have an exe that I created using python bundled up with the esky
package(<https://pypi.python.org/pypi/esky>).
My setup file looks like this
setup(name='pythonApp',
version = "0.1",
scripts=[pythonAppEXE],
optio... |
IntegrityError at /accounts/signup/ in django
Question: I have just deployed my django site using apache on an ubuntu 14.04 server.
The site is being accessed. But when i signup as a user into it, it creates
the user but is unable to create the user profile which is in a one to one
relationship with myuser. Also, I am ... |
How to merge .csv files to do a matrix
Question: I have two different .csv files (a and b), containing several array organized
like this :
File a :
[a, b, c, d]
[e, f, g, h]
[i, j, k, l]
File b :
[o, p, q, r]
[s, t, u, v]
[w, x, y, z]
I want... |
How to detect end of picture download in AsyncImage in Kivy?
Question: i'm writting a simple appliaction like this one:
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.image import AsyncImage
... |
How to convert a command output from a string to an integer?
Question: I have a script that uses the `time` module in Python to get the current time
in hours, minutes and seconds and store them in three different variables:
import time
while True:
A = time.strftime("%H")
B = ti... |
python math domain error - sqrt
Question: What causes the problem?
from math import sqrt
print "a : "
a = float(raw_input())
print "b : "
b = float(raw_input())
print "c : "
c = float(raw_input())
d = (a + b + c)/2
s = sqrt(d*(d-a)*(d-b)*(d-c))
print "a+b+c =", a, b, c... |
Lists as values in a dictionary Python
Question:
ddic = {'a': 10,'b': 23,'c': [0, 1, 2]}
n2 = ddic['c']
n2[-2] = 1000.
ddic
{'a': 10, 'b': 23, 'c': [0, 1000.0, 2]}
Why changing the list at which n2 is pointing, changes also the list of dict
ddic, which is contained into the hash table th... |
Index error - Python, Numpy, MatLab
Question: I have converted a section of MatLab code to Python using the numpy and scipy
libraries. I am however stuck on the following index error;
IndexError: index 698 is out of bounds for axis 3 with size 2
698 is the size of the time list.
it occurs in the l... |
Executing a script in selenium python
Question: I am trying to execute this script in selenium.
<div class="vbseo_liked">
<a href="http://www.jamiiforums.com/member.php?u=8355" rel="nofollow">Nyaralego</a>
,
<a href="http://www.jamiiforums.com/member.php?u=8870" rel="nofollow">Sikonge</a>
... |
How to check for python script requirements on windows
Question: I have been developing a python script for a few days now, and wanted to send
the final result to a friend of mine. Is there a way to get all software
requirements to run my program?
The python part is relatively easy, as I can just look at my import lis... |
matplotlib show many images in single pdf page
Question: Given an image of unknown size as input, the following `python` script shows
it 8 times in a single `pdf` page:
pdf = PdfPages( './test.pdf' )
gs = gridspec.GridSpec(2, 4)
ax1 = plt.subplot(gs[0])
ax1.imshow( _img )
ax2 = ... |
how to replace the characters of the list in python
Question: I want to write a code in python that will replace every every small letter
character with "a" , every capital letter with "A" and every digit with 0. I
write code but it caused an error of **x not in list** , code is below
tokens = ["apple","... |
Python lambda with double loops
Question: Is it possible to rewrite the following code into a lambda expression?
for h in range(height):
for w in range(width):
if maskImg[h][w] > 0:
maskImg[h][w] = srcImg[h][w]
Answer: This is not really equivalent to you expres... |
How to compare two imagefile from two different files in python
Question: I would like to create a program that compares two images. I need to take
images from two different folders and compare that images if they are same or
not. Then I want to print out as same or different. For example file 1 will
have image1 and im... |
python compare tuples and dictionary
Question: I have to compare two sets and find the differences in python:
>>> mysql_orders = ((50434L, 5901L), (50733L, 5901L))
>>> opera_orders = [{'orderId': 'WEB050434', 'accountId': '00T001'}, {'orderId': 'WEB050733', 'accountId': '00T001'}, {'orderId': 'DOC075... |
Python package callable from the shell?
Question: I have a tool written in Python which I would like to turn into a Python
package, to make it easier to install dependencies and distribute it.
There are two usages:
1. you import the module `mytool.py`, call the wrapper function on it, a summary of some measurements... |
Bitnami Django Stack and module "requests": cannot import name 'certs'
Question: Very specific stuff. I'm running a Bitnami Django stack cloud VM on Amazon. On
two different "regular" machines, I could install `requests` by running `sudo
pip install requests`, but it seems that Bitname uses it's own specific
structure,... |
Printing the first value in an array instead of just the first letter? (Python)
Question: I have used Python to append data from an SQLite3 database to an array. Now
that I have an array, I am trying to print the appended data in a format along
the lines of:
print "Team: " + new_array[0][0] + " Score: " ... |
Concatenation of a variant number of keys of a dictionary Python (recursion?)
Question: Hello Stackoverlow members,
I'm trying to concatenate keys (string) on a hand, and values (list) on the
other hand, of a dictionnary.
For your better understanding, here is what I have at the beginning:
dict = {'bk1... |
Python: Using a multidimensional multiprocessing.manager.list()
Question: This might not be its intended use, but I would like to know how to use a
multidimensional manager.list(). I can create on just fine, something like
this:
from multiprocessing import manager
test = manager.list(manager.lis... |
Matplotlib: Grouped boxplots using data from numpy array and lists of group/subgroup labels
Question: I'm new to Matplotlib / Python, and am trying to make a grouped boxplot very
similar to Joe Kington's excellent example shown here:
[how to make a grouped boxplot graph in
matplotlib](http://stackoverflow.com/question... |
segmentation fault - core dump in python C-extension
Question: I am writing a c-extension for python. As you can see below, the aim of the
code is to calculate the euclidean-dist of two vectors. the first param n is
the dimension of the vectors, the second , the third param is the two list of
float.
I call the functio... |
How to install numpy and scipy for Ironpython27? Old method doens't work
Question: I think this is the most popular way to do it before:
<https://pytools.codeplex.com/wikipage?title=NumPy%20and%20SciPy%20for%20.Net>
But this link is no longer exist:
<https://store.enthought.com/repo/.iron/>
* * *
**_I recently fou... |
Changing data type with pandas on read_excel
Question: I'm looking for some help as I'm actually quite new to pandas (and python).
I'm facing a data type conversion problem with some datas.
As you can see (and try), I'm trying to tell pandas that I want it to read the
"DEP" data column as a string (because I want to k... |
ImportError No module named 'plotlytools' when importing Cufflinks
Question: My system environment: `Windows 8.1, WinPython 3.4.3.1, pandas 0.16, plotly
1.6.14, cufflinks 0.2`
I have no idea what's causing the issue. I'm attempting to use the tutorial
outlined here [cufflinks nbviewer
tutorial](http://nbviewer.ipython... |
ImportError: Could not import settings - No module named settings
Question: i have what seems to be a basic path problem, but i can't figure this out for
the life of me.
I have the following directory structure:
└── rockitt
├── activities
│ ├── migrations
│ ├─... |
Python sending email won't work, and is giving long error messages
Question: I'm testing a python script to send e-mail to myself:
import smtplib
fromaddr = '[email protected]'
toaddrs = '[email protected]'
msg = 'GRRRRR!!!!!!'
username = '[email protected]'
password = '----... |
From a python3 script, how to I pipe a string into a bash program?
Question: As an example, here's what I've tried:
#!/usr/bin/env python3
from subprocess import Popen
message = "Lo! I am up on an ox."
Popen('less', shell=True).communicate(input=message)
As the last line, I al... |
Override a "private" method in a python module
Question: I want to test a function in python, but it relies on a module-level "private"
function, that I don't want called, but I'm having trouble overriding/mocking
it. Scenario:
module.py
_cmd(command, args):
# do something nasty
function_... |
Global variable from a library not yet initialized when used
Question: ## **The context :**
I created a module (I call it Hello) for Python in C++. The interface between
C++ and Python is made by Swig. It generates a dynamic library `_Hello.so` and
a Python file `Hello.py`. Then, when created, I juste have to call it ... |
how to take multiple chracter in argv in python
Question: i am new in python3 and currently learning it i have written small code below.
i want to know that why argv is taking single character only? for every
variable. isn't it supposed to take whole string(multiple characters)? in
other words when i input in console i... |
Python: Difficulties with converting negative strings numbers into floats
Question: I have been trying to figure this out for hours now. I have this list that I
need converted to a float so I can use it in `numpy.corrceof()` along with
another identical list.
The list, `r` is as follows:
>>> print r
... |
Install mysql in dockerfile?
Question: I want to write simple python application and put in docker conteiner with
dockerfile. My dockerfile is:
FROM ubuntu:saucy
# Install required packages
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python
RUN DEBIAN_FRO... |
How to scrape a page with BeautifulSoup and Python?
Question: I am trying to extract information from the BBC Good Food website, but I am
having some trouble narrowing down the data I'm collecting.
Here's what I have so far:
from bs4 import BeautifulSoup
import requests
webpage = requests.g... |
Canonical name for every Unicode character
Question:
>>> from unicodedata import name, lookup
>>> name('a')
'LATIN SMALL LETTER A'
>>> name('☃')
'SNOWMAN'
>>> name('A')
'LATIN CAPITAL LETTER A'
>>> name('`')
'GRAVE ACCENT'
>>> name('☹')
'WHITE FROWNING FACE'
>>> name('☺'... |
"SyntaxError: invalid syntax" in Python
Question: I have installed odoo in my server that has Python 2.7.9. When I try to launch
the daemon, I get this error:
root@des [/opt/odoo/openerp]# /etc/init.d/odoo start
Starting Odoo Server Daemon (odoo-server): [ OK ]
root@des [/opt/od... |
Python 2.7 - Find the number of web server hits
Question: I am trying to compute the number of hits to a web server per calendar month
(Dec, Jan, Feb, ..) by Year.
I am very new to Python so I don't even know where to begin. I suppose you
have to use some string split or regexp.
I am given a log file with the followi... |
Python multiprocessing pool map with multiple arguments
Question: I have a function to be called from multiprocessing pool.map with multiple
arguments.
from multiprocessing import Pool
import time
def printed(num,num2):
print 'here now '
return num
class A(object):
... |
tempfile is not accessible when using subprocess.Popen
Question: When I run the following script, the error"Command line argument error:
Argument "query". File is not accessible" occurs. I'm using python 3.4.2.
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
... |
Questions about Heroku and Django settings
Question: I have tried many, many times to get my apps running on Heroku without
success. The fact that they run locally seems to be totally irrelevant.
Clearly I don’t understand how this works.
So … here are a couple of questions, which I've decided to group to gether in
a ... |
Some readble content, but impossible to JSON dump to file
Question: This [text file](http://gget.it/3hgi8uyu/temp.txt) (30 bytes only, the content
is `'(Ne pas r\xe9pondre a ce message)'`) can be opened and inserted in a
`dict` successfully :
import json
d = {}
with open('temp.txt', 'r'... |
How to fix my csv output to make it useable?
Question: This might be very easy to fix but I am new to Python, and new to programming.
Using BS4 I have managed to, with help, get this code together. It fetches all
the information I want it to fetch but the output is not very usable.
Here is the code:
imp... |
Having trouble killing linux processes
Question: I'm trying to restart celery after code changes by following [How to restart
Celery gracefully without delaying
tasks](http://stackoverflow.com/questions/9642669/how-to-restart-celery-
gracefully-without-delaying-tasks). Based on this I ran:
(env1)ubuntu@i... |
Recompose a table from an SQL with row and colum ID in Python
Question: I'm reading from an SQLite table created by a program I have no control on.
The idea behind the layout of this SQL table eludes me, but that's the way it
is.
This table looks like this in SQL:

Wh... |
Get realtime output from python subprocess
Question: I'm trying to invoke a command line utility from Python. The code is as
follows
import subprocess
import sys
class Executor :
def executeEXE(self,executable ) :
CREATE_NO_WINDOW = 0x08000000
proces... |
Issue with docker compose
Question: The issue I am having is that after I try and run docker-compose up, after
everything is downloaded(python dependencies) docker-compose will just hang on
Recreating sensorarray_web_1...
Attaching to sensorarray_web_1
My directory structure looks like like thi... |
Unable to import Python module in Python script
Question: I have a Python project having the following hierarchy:
- product_recommender_sys
- data
- dataset.csv
- public
- __init__.py
- startup.py
- src
- __init__.py
- recommender.py
I am tr... |
How to split comma delimited data and create a list from the data in python?
Question: I am trying to create a function that takes in two dates in YYYY/MM/DD format,
reads through the data, and returns a list of lists containing the latitude,
longitude, magnitude, and depth for the quakes between the two dates. The dat... |
Why is __slots__ behaving differently in Python 2 and 3 when inheriting from an abstract base class
Question: I created the following class to store changeable points on a plane in a
memory-efficient manner - I need a mutable equivalent of `namedtuple('Point',
'x y')`. Since instance dictionaries are big, I thought I'd... |
Getting first and last function parameter in Python
Question: I have to make a function with more than 2 arguments in python and in the end
I have to print the first and the last argument of the function (in a list).
I have tried like this, but it doesn't work. What am i doing wrong?
import inspect
... |
parse xml document (on url) in python
Question: I am trying to parse xml document (URL) using requests,
facing following error:
ValueError: Unicode strings with encoding declaration are not supported
here is my code:
import requests
from lxml import etree
from lxml.etree imp... |
Simulate a transparent background
Question: Since all window managers do not support this feature I have thought copying
the background before displaying it.
But this poses several problems.
\- The background is not always properly backed up. I have no idea why.
\- With this method it is impossible to move the wi... |
AttributeError: 'module' object has no attribute 'subscribe' Python
Question: I'm Using `Kubuntu 13.10 64 bit` and `Python 2.7.5+` and `wxPython 2.8.12.1`.
I'm trying to use the `wx.lib.pubsub` module to update `wx.Gauge` from
different class (thread class). I have in my code such imports:
try:
f... |
Problems with a chat program written in Python and PyGTK
Question: I am new to python and I am currently working on a chat room program in Python
(still in progress...). I have also made a GUI for my program. Initially, I
made two py files, one for the GUI and one for the chatting function. They
both worked perfectly w... |
Python - regex relation extraction
Question: As a part of schoolwork we have been given this code:
>>> IN = re.compile(r'.*\bin\b(?!\b.+ing)')
>>> for doc in nltk.corpus.ieer.parsed_docs('NYT_19980315'):
... for rel in nltk.sem.extract_rels('ORG', 'LOC', doc,
... corpus='ie... |
Parameterized queries using MySQLdb in Python 3
Question: I'm attempting to insert data into a MySQL database through a Python script
using parameterized queries rather than formatting the parameters into a
string and opening the application up to SQL injection.
Here is the Python code:
#!/usr/bin/pytho... |
Boost - Cannot wrap pass-in vriables
Question: I tried to wrap a list to a vector of string using `<boost/python>`, where
comes "undefined symbol" error:
/* *.cpp */
using namespace std;
using namespace boost::python;
// convert python list to vector
vector<string> list_to_vec_string... |
build a perfect maze recursively in python
Question: I have this project to build a perfect maze recursively by using python. I
have a MyStack class which creates a stack to track the path that I go
through. And a Cell class which represent each square within the maze and
store some information. I think I complete the ... |
Why doesn't np.genfromtxt() remove header while importing in Python?
Question: I have data of the form:
#---------------------
# Data
#---------------------
p q r y 1 y 2 y 3 y 4
2 8 14 748 748 748 790
2 9 22 262 245 252 328
1 5 19 512 514 511 569
2 7 ... |
How to get diff time from kernel input keyboard events(from key pressed to release)?
Question: I'm trying to write a Python code to capture events from /dev/input/event* on
linux. With the events I want to filter event type, event value, event code
and time(tv_sec and tv_usec).
PROBLEM: With EventType=EV_KEY and Event... |
python subprocess.call error when pipe to file
Question: I am getting an usual error in python 3.4, when I'm calling a command, say
`net view` in the form of: `subprocess.call("net view")` returns `error code
0` (i.e. successful)
But when I do `subprocess.call("net view > targets.txt")` it returns `error
code 1` (unsu... |
Scrapy on Ubuntu 14.04
Question: I"m getting these error when i create a scrapy project. I already went through
all the google links and it just wont work out for me on ubuntu 14.04
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 11, in <module>
sys.exit(execute())... |
python: Mac can read all files in a directory but Windows can't?
Question: This is probably a naive question since I am absolutely a newbie to python...
I was trying to read a bunch of .txt files from a directory using Mac, and it
worked perfectly, obtaining all the files without any exceptions.
But then I realized I... |
i = self._randbelow(len(seq)) TypeError: object of type 'NoneType' has no len()
Question: I have this error when I'm running my code for building a perfect maze. Here
is the code:
def walk(self, s, x, y):
neighboor = [(x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)]
if... |
In Python, how to enforce an abstract method to be static on the child class?
Question: This is the setup I want: A should be an abstract base class with a static &
abstract method f(). B should inherit from A. Requirements: 1\. You should not
be able to instantiate A 2\. You should not be able to instantiate B, unless... |
Python pyodbc Unicode issue
Question: I have a string variable res which I have derived from a pyodbc cursor as
shown in the bottom. The table `test` has a single row with data `ä` whose
unicode codepoint is `u'\xe4'`.
The Result I get is
>>> res,type(res)
('\xe4', <type 'str'>)
Whereas the re... |
How can I get the full link from beautifulsoup instead of only the internal link
Question: I am new to python. I am building a crawler for the company I work for.
Crawling its website, there is a internal link that is not in the link format
that it is used to. How can I get the entire link instead of the directory
only... |
VideoWriter outputs only a 5.7kB File in OpenCV Python
Question: I was trying the following piece of code for storing the captured video into a
file. The Live Stream is getting displayed correctly , but for whatever length
I record the video, the target file is a 5.7kB file that doesn't contain any
video.
... |
Scrapy giving error on start running:AttributeError: 'module' object has no attribute 'Any'
Question: Using a tutorial, started "scrapy crawl dmoz" showing an error. I have
installed Scrapy but don't know how to check whether it is correctly installed
or not. I am using tutorial to use it but got stuck. Trackback is be... |
wxpython set max textbox value length
Question: how i can set the max length of the textbox in wxpython? this is my code(part
of the code)
import wx
from wx.lib.masked import NumCtrl
class MyFrame(wx.Frame):
def __init__(self,parent,id,title):
wx.Frame.__init__(self,parent,id,... |
Error when trying to run django application
Question: Trying to install 'Django-inventory' from <https://github.com/rosarior/django-
inventory>
After resolving dependency errors im getting this:
(inventory)root@ip-172-31-47-17:/home/admin# django-inventory.py runserver
Traceback (most recent cal... |
Why do I get this IOerror13 ? Using python
Question:
import sys
import os
import re
import ftplib
os.system('dir /S "D:\LifeFrame\*.jpg" > "D:\Python\placestogo.txt"') #this is where to search.
dat = open('placestogo.txt','r').read()
drives = re.findall(r'.\:\\.+.+',dat)
for... |
Extract parts of log in Python to import to Excel
Question: I'm trying to get part of a log (txt file) using regex but I'm needing some
help. Basically the log comes like this:
Tue Feb 24 17:51:10.835 SRV02 NOTICE Event Loop - noop
Tue Feb 24 17:51:10.835 SRV02 NOTICE Exponential histogram... |
Sorting a text file with strings and digits on each line - Python 3
Question: I have a text file I made with some runners and their race times in which
looks like this:
Dylan , 3.6
Tom , 4.2
Jack , 1.4
Dave , 8.8
Mick , 5.2
John , 11.3
Matt , 7.6
Ben , 9.7
Joe , 3.9
Ch... |
JSON RPC Client Go
Question: I have a python server serving response through JSON-RPC. Here is a sample
response from the server.
'{"jsonrpc": "2.0", "result": "Peer 1: local 10.10.0.2 remote 10.10.0.1 state CONNECT\\nPeer 2: local 10.10.0.18 remote 10.10.0.17 state ESTABLISHED\\nPeer 3: local 10.10.... |
Delete extra characters apart from starting and ending in a string in python
Question: I have data of the form:
"C def geh.#- ijk "<> ""^^xsd:date.
Now for the last part of the above string i.e. "C def geh.#- ijk "<>
""^^xsd:date -- i.e the part which begins and ends with quotes. I want to keep
jus... |
Python screen is black for a small amount of time then closes
Question: The code in this gist
(<https://gist.github.com/tobias76/8dc2e1af90f1916a2106>) is completely broken
and nothing happens excl. a black screen and closure after seconds, I would be
more specific with the code but there is absolutely no error message... |
print out list of the relation between variables in python?
Question: I'm an absolute beginner with python and my professor is sort of doing a trial
of fire approach to teaching us the language. The goal is to list the triples
in the relation {(a,b,c) : a, b, and c are integers with 0 < a < b < c < 5}.
Use range(5) as ... |
i want to set cell using string "," in python excel. but excel is terrible
Question: I want to set cell using string "," but it doesn't work.
This is my code.
import win32com.client
xlsfile = "D:\\Temp\\test.xlsx"
xl = win32com.client.dynamic.Dispatch("Excel.Application")
xl.DisplayAler... |
Error "unhandled socket.io url" with python as client
Question: I am new to Nodejs and using socket.io. But when i connect through python
client i am geting error **unhandled socket.io url**
**Python code**
**client.py**
from socketIO_client import SocketIO
with SocketIO("192.168.1.191", 8001) as s... |
Internal Server error: using python script with sqlite + mod_wsgi in apache
Question: This is my code example.
import sqlite3
def application(environ, start_response):
output = "<p> LOG</p>"
db = sqlite3.connect('/root/example.db')
db.row_factory = sqlite3.Row
curso... |
Freeze list copy
Question: This might have been asked before, but it's difficult to search for. Basically
I am wondering how to make a copy of a list that will not be updated when the
list changes. I have been tooling around in Python for a while now--surprised
this is the first time I have come across this.
... |
Python csv row count using column name
Question: I have a csv file with 'n' columns. I need to get the rowcount of each column
using the column name and give out a dictionary of the following format:
csv_dict= {col_a:10,col_b:20,col_c:30}
where 10,20 and 30 are the row count of col a, b and c respe... |
how to make a reduced image file in python
Question: I'm in a beginning programming class, and our project is to reduce an image to
half it's size and then to double it's size.
How do I make a new picture that is the same picture as before, but with the
reduced height and width?
This is the code that I have:
... |
Pattern matching in Python regexp
Question: How can I use regexp in python to extract the date from an html `<div>` tags.
Html is something like this
`<div><strong>Date:<\/strong> Monday April 6, 2015 at 4:41PM <div>`
I need to get date in "yyyy-dd-mm hh:mm" format. Output for this should be
"2015-04-06 16:41"
Answ... |
Installing matplotlib on Codenvy
Question: Anyone have experience installing matplotlib on
Codenvy(<https://codenvy.com>)?
I keep getting following errors trying to run my application:
[DOCKER]le "/usr/lib/python3.4/distutils/version.py", line 343, in _cmp
[DOCKER]
[DOCKER]if self.vers... |
Python Downloading Data File from Web-Scraped URL
Question: I'm trying to develop an automated script to download the following data file
to a utility server and then ETL related processing. Looking for pythonic
suggestions. Not familiar with the current best options for this type of
process between urllib, urllib2, be... |
Why can shapely/geos parse this 'invalid' Well Known Binary?
Question: I am trying to parse [Well Known Binary](https://en.wikipedia.org/wiki/Well-
known_text#Well-known_binary) a binary encoding of geometry objects used in
Geographic Information Systems (GIS). I am using [this spec from
ESRI](http://edndoc.esri.com/ar... |
Python How to find average of columns using dataframes apply method
Question: This is a question on Udacity Data Science Nanodegree and I can't figure it
out. The instructions are:
Using the dataframe's apply method, create a new Series called
`avg_medal_count` that indicates the average number of gold, silver, and
br... |
Changing line in file based on previous lines - Python
Question: Relatively new to python, trying to figure out the most general and readable
way to attack this problem. Execution speed wouldn't be bad either, but its a
secondary concern.
I have an input file for another program that I need to edit automatically.
The ... |
Merge semicolon delimited txt file looping in directory
Question: Suppose I have many different text files from the same directory with the
content structure as shown below:
File a.txt:
HEADER_X;HEADER_Y;HEADER_Z
a_value;a_value;a_value
a_value;a_value;a_value
File b.txt:
HE... |
convert image to byte literal in python
Question: I'm trying to store an image as text, so that I can do something like this
example of a transparent icon for a Tk gui:
import tempfile
# byte literal code for a transparent icon, I think
ICON = (b'\x00\x00\x01\x00\x01\x00\x10\x10\x00\x00\x01\... |
Trying to figure out longest path algorithm python
Question: I'm trying to make a python script, that gets me the longest repeated
character in a given matrix (horizontally and vertically).
**Example:**
I have this matrix:
afaaf
rbaca
rlaff
Giving this matrix for input, it should result: ... |
Python 2.7 encoding
Question: I am trying to write a xml file from python (2.7) using xml.append function.
I have a string "Frédéric" that needs to be written to xml file as one of the
values. I am trying to use unicode function on this string and then encode
function to write to the file.
a ="Frédéric"... |
Authentication in pyramid
Question: I am trying to set up a basic navigation in pyramid (1.4a1). According to the
tutorial given at
[tutorial](http://sluggo.scrapping.cc/python/Akhet/auth.html) _groupfinder_ is
called once we remember after login is successful. This works on my local but
when I try the same on a server... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.