Interesting Tags
   11 tags on

1 answer

Python repeatedly randomly deleting list entries

I am trying to randomly delete a list from a list of lists in Python. It keeps giving me the error: IndexError: list assignment index out of range I don't understand how I am referencing somewhere …

1 answers | 3 secs ago by user3438293 on Stack Overflow stackoverflow.com
0 answers

Repeating a single line until a semicolon?

Below is my inputfile. ~||~1 TABLE~||~$NETVAULT_CATALOG~||~CATALOG~||~2013-10-19 19:59:23~||~2013-10-22 07:50:02~||~ CREATE SET ~||~2TABLE $NETVAULT_CATALOG.CATALOG ,FALLBACK , NO BEFORE ...

0 answers

pymssql executemany insert valueerror

I get an error: File "pymssql.pyx", line 443, in pymssql.Cursor.executemany (pymssql.c:6616) File "pymssql.pyx", line 417, in pymssql.Cursor.execute (pymssql.c:6057) File "_mssql.pyx", ...

0 answers

Getting the offset and data out of an (avr)elf file by useing python + pyElftools

I am creating my own bootloader for an ATXmega128A4U. To use the bootloader I want to transform the ELF-file of the firmware into a memory map used by the ATXmega. For that I want wo uses python and …

4 answers

Converting datetime to strptime

I'm pulling a timestamp that looks like this - 2014-02-03T19:24:07Z I'm trying to calculate the number of days since January 1. I was able to convert it to datetime using yourdate = ...

0 answers

Django - Is it possible in a intermediate table to use an inherited ForeignKey for the target model?

I'm using django 1.4 and I have the following models: class Newsletter(EmailTemplate): receivers = models.ManyToManyField(User, related_name='newsletters', …

0 answers

Python 802.11 parser from raw socket

Working on a 802.11 parser from raw socket. The purpose of the parser is determine how much of the packet to keep for further processing. Only layer 2 is being saved, all layer 3 and above are ...

0 answers

creating a dataframe from a dictionary of tuples in pandas

I have this data structure : word1 [('date', freq) , ('date',freq) , ...] word2 [('date',freq) , ('date',freq) , ...] and so on.for analyzing the time series , I want to create a dataframe. I can …

1 answer

Form-View Mapping Issue in Django

This is becoming very frustrating, like all of my Django form endeavors have been thus far... I have a search bar form that is supposed to send the user to a url '/project/search/<query>/' and …

1 answer

doctest expected True, got True

doctest is hard to control. I encontered a problem like that function from collections import namedtuple Match = namedtuple('Match', ['token_string', 'normalised_token', …

1 answers | 6 mins ago by Tianchen Wu on Stack Overflow stackoverflow.com
0 answers

data structure of single quotes to one of double quotes - python

Contrary to what I've read it appears that for JSON serialization I cannot use single quotes - all items must be surrounded by double quotes. How do I go about converting a structure of single quoted …

1 answer

PySide close window function receiving custom arguments

I have main function from within I'm creating one instance of the Control class and one instance of the GuiWindow class. This GuiWindow object have methods that accepts the previous mentioned instance …

1 answers | 9 mins ago by Krcevina on Stack Overflow stackoverflow.com
2 answers

What size to specify to `PIL.Image.frombytes`

I'd like to create a PIL image from raw data. I believe I'm supposed to use PIL.Image.frombytes. But it has a size argument. I don't know the size of the image, isn't that supposed to come as part of …

3 answers

django updating foreignKey field before saving

I have the following models.py class Notebook(models.Model): category = models.ForeignKey(Category) title = models.CharField(max_length=200, help_text='Maximum 250 characters') slug = ...

3 answers | 10 mins ago by Napster on Stack Overflow stackoverflow.com
0 answers

Slicing and finding the volume

I have four columns, namely x,y,z,zcosmo. The range of zcosmo is 0.0<zcosmo<0.5. For each x,y,z, there is a zcosmo. When x,y,z are plotted, this is how they look. I would like to find the …

2 answers

Bash alias to automatically detect arbitrarily named file sequences?

I'm looking to make a bash alias that will change the results of ls. I am constantly dealing with large sequences of files, that do not follow the same naming conventions. The only common ...

1 answer

What's a good way to find the difference between two nose tests runs?

I am trying to prepare a pull request for my changes to matplotlib here: https://github.com/shmuller/matplotlib.git. After merging with upstream/master (https://github.com/matplotlib/matplotlib.git), …

0 answers

elasticsearch scrolling using python client

When scrolling in elasticsearch it is important to provide at each scroll the latest scroll_id: The initial search request and each subsequent scroll request returns a new scroll_id — only the …

1 answer

buildout cant instal django cms 2.2

I try to run sudo bin/buildout and I get the following error Traceback: Getting distribution for 'django-cms==2.2'. Traceback (most recent call last): File "<string>", line 1, in ...

1 answer

How do you conditionally check for an escape character?

I have a string which contains the escape character \x . However if i try to check for it with: if char == "\x": I receive the error ValueError: invalid \x escape

0 answers

Python3 multiprocessing shared object

I stumbled across a synchronization issue for a shared object when using the multiprocessing module in Python 3.2.3 (on Debian 7.5). I put together this simple example to illustrate the problem, its …

4 answers

Python Arpabet phonetic transcription

Is there a library in python that can convert words (mainly names) to Arpabet phonetic transcription? BARBELS -> B AA1 R B AH0 L Z BARBEQUE -> B AA1 R B IH0 K Y UW2 BARBEQUED -> B AA1 R B IH0 K Y …

4 answers | 21 mins ago by hmghaly on Stack Overflow stackoverflow.com
1 answer

Why does collections.MutableSet not bestow an update method?

When implementing a class that works like a set, one can inherit from collections.MutableSet, which will bestow the new class with several mixin methods, if you implement the methods they require. ...

0 answers

how to convert GAE datastore data to csv format, python

I need to write a function, wherein the datastores data should be (downloaded or web link) readable or converted to csv format in python. Anyone can help me out. Update: This is the code i had ...

0 answers

How to include data from another model in the List View of Django Admin?

I have the following two models in a Django app: Event and EventDate. I like to show some calculated data from EventDate in the admin list view of Event and I want to be able to sort by it. I ...

1 answer

Reading a large table with millions of rows from Oracle and writing to HDF5

I am working with an Oracle database with millions of rows and 100+ columns. I am attempting to store this data in an HDF5 file using pytables with certain columns indexed. I will be reading subsets …

0 answers

opencv python- noise in saved image via io.imsave

i am trying to save an image in opencv python. the image that the program is showing via cv2.imshow() is perfectly fine. but when i am saving it using cv2.imwrite() it is saving black image .then i …

0 answers

Python 2.7; called command is getting cut off

gitLog = 'git log {0}..{1} --pretty=format:"%an %h %ad %d %s" --date=short --topo-order --no-merges {2}'.format(tag1, tag2, FILE_NAME) When I run the script it appears to be cutting off and is only …

2 answers

Check list of numbers is a subset

I have a python pandas dataframe like this: data = ['13,12', '8, 7', '12,1', '7', '2,6'] index = 'a', 'b', 'c', 'd', 'e' col = ['colnames'] df = pd.DataFrame(data, index=index, columns = col) df …

2 answers | 28 mins ago by user690462 on Stack Overflow stackoverflow.com
1 answer

Django can't find the files in static folder

I must be missing something. So this should be how my folder does look: Obviously with the asked image. To increase portability, I use dynamic path in the code. The code in settings.py ...

1 answers | 29 mins ago by Realdeo on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3