Tagged Questions
0
votes
0answers
12 views
MemoryError when using Pandas.join
A DataFrame is created by pulling from a postgresql database. However doing listings.join is getting me MemoryError.
The system has 24GB RAM, running Python 64bit on Windows 8 64bit.
Problem: Before ...
0
votes
1answer
22 views
Python how to get only the last 2 bytes of the reply data
I will post a query to a device which will return me with something like this (after a readlines):
['\x03C?01FF00\r']
I want to extract just the FF00 and post the reply to the jquery (which sends ...
1
vote
1answer
27 views
Python Comparing lists averages sorting
I am currently working on a python problem that involves taking a list consisting of 2 sublists of numbers and an identifier, for a total of three things. The procedure name is compareTeams(lstTeams), ...
-1
votes
2answers
10 views
Python - PROBLEMS WITH .PLACE in GUI with TKINTER
Usually this format works for all of my programs but for some reason its not working right now
from Tkinter import *
class gui1(Frame):
def __init__(self, master):
Frame.__init__(self, ...
0
votes
2answers
28 views
how to add wildcards to the re.sub and remove all characters before the _
i have the following code
infile = botslib.opendata(ta_from.filename,'r')
tofile = botslib.opendata(str(ta_to.idta),'wb')
start = infile.readline()
import textwrap
import re
...
0
votes
2answers
27 views
Setting default values for arbitrary number of keyword arguments
Say I have:
class Example(object):
def __init__(self, table = None, rows = None, cats = None, **kwargs)
self.table = table
self.rows = rows
self.cats = cats
My question ...
0
votes
2answers
14 views
from xml.dom import DOMImplementation, DocumentType
I'm trying to get a Python script working, that is using xml.dom (not xml.dom.minidom).
I'm working on a new install of Python 2.7 for Windows, and xml.dom doesn't have a DOMImplementation or a ...
0
votes
0answers
12 views
Python 2.7 on Windows, “assert main_name not in sys.modules, main_name” for all multiprocessing examples
There is following simple code:
from multiprocessing import Process, freeze_support
def foo():
print 'hello'
if __name__ == '__main__':
freeze_support()
p = Process(target=foo)
...
0
votes
1answer
36 views
Remove characters before and including _ in python 2.7
good day all,
i use python 2.7
the following code returns into a nice readable output.
def add_line_remove_special(ta_from,endstatus,*args,**kwargs):
try:
ta_to = ...
0
votes
1answer
16 views
Nested text encodings in suds requests
Environment: Python 2.7.4 (partly on Windows, partly on Linux, see below), suds (SVN HEAD with minor modifications)
I need to call into a web service that takes a single argument, which is an XML ...
0
votes
1answer
16 views
XML write to file UnicodeDecodeError Python 2.7.3
I've searched the site and haven't found an answer that works for me. My problem is that I'm trying to write xml to a file and when I run the script from the terminal I get:
Traceback (most recent ...
3
votes
1answer
106 views
What version of C does Python take?
From what I understand, the canonical version of Python is written in C89. I'm interested in maybe writing some C based extension to Python later on, but I'm a bit confused as to what version of C I ...
0
votes
0answers
10 views
Properly configuring signal.setitimer()
I'm having a bad time figuring why the program is pausing indefinitely, i.e. exhibiting infinite-loop-like behavior
def class foo():
'''
...
'''
def __catcher(self, signum, _):
...
1
vote
1answer
36 views
Error for my plot and calculation of FWHM
I found and copied this code to get the FWHM from Finding the full width half maximum of a peak (2nd to the last answer). My code below uses my own data. The plot generated looks wrong as my data ...
6
votes
3answers
142 views
How to eliminate the ☎ unicode?
During web scraping and after getting rid of all html tags, I got the black telephone character \u260e in unicode (☎). But unlike this response I do want to get rid of it too.
I used the following ...