Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python.
0
votes
1answer
5 views
Python 3.3 install “configobj”
could somebody walk me through installing the python configobj module? I downloaded it from here
but it throws an error during installation
except Exception, e:
^
SyntaxError: ...
0
votes
2answers
7 views
unittest testcase setup new object
I'm using pydev in Classic Eclipse 4.2.2 with Python2.7. Please consider the code and result below as you read.
Suppose I create an object with a variable of a predefined value. Now, suppose I ...
0
votes
1answer
16 views
Find the network distance between two IPv4 addresses (not geographic distance)
Given an IPv4 address (needle) and an unsorted array of IPv4 addresses (haystack), how could I, programmatically determine which single address in the given haystack is the closest (network-wise, NOT ...
0
votes
0answers
22 views
App as foreign key
So , i have a django project with 2 apps
├───Blog
post
comment
└───User
profile
user (basic authentification and profile dashboards)
blog (having basic blog models : post,comment)
I ...
1
vote
1answer
8 views
Pandas: Convert DataFrame Column Values Into New Dataframe Indices and Columns
I have a dataframe that looks like this:
a b c
0 1 10
1 2 10
2 2 20
3 3 30
4 1 40
4 3 10
The dataframe above as default (0,1,2,3,4...) indices. I would like to convert it into a ...
0
votes
0answers
10 views
How to read Excel with merge cells and save the Excel to a dict in python
I've a table as picture shown which with merged cells.
How can I read the Excel table in python and saved in a dict?
table_dict={S1:[a,b,c,d],
S2:[[a1,a2,a3],[b1,b2,b3],[d1,d2,d3]],
...
0
votes
1answer
7 views
Fatal error while compiling PyQt5: Python.h does not exist
I'm trying to install PyQt5 on my Ubuntu 12.04 box. So after downloading it from here I untarred it, ran python configure.py and make. Make however, results in the following:
cd qpy/ && ( ...
0
votes
0answers
4 views
Filtering an image with block processing histogram filter
I'm currently trying to filter an image by block processing an image that has been binarized with histogram filtering. Which means in theory that I will choose small blocks of the image and smooth it ...
0
votes
1answer
10 views
Beautiful Soup 4 find_all don't find links that Beautiful Soup 3 finds
I noticed a really annoying bug: BeautifulSoup4 (package: bs4) often finds less tags than the previous version (package: BeautifulSoup).
Here's a reproductible instance of that issue:
import ...
0
votes
1answer
12 views
plotting lines in pairs
I'm working on a network project in which I need to draw lines (edges) between pairs of points (nodes). Currently I'm using matplotlib.pyplot for this, but the problem is that pyplot.plot(x, y) starts ...
0
votes
0answers
6 views
Post Request in Python with a cookie set, but still not sending the datas correctly
I am new to Python, but I guess I'm handling the problem not too bad after 3h of research.
My POST request is bypassing the login wall thanks to the cookie but it never posts the informations I'd like ...
1
vote
3answers
36 views
Python: Sum of element for n-lists
can anybody please give me a hint how to aggregate (sum up) specific elements of multiple lists?
For example I have 20 lists with a similar name pattern, each representing consumption spending over ...
0
votes
0answers
10 views
Django TinyMCE: 'ModelFormMetaclass' object is not iterable
I'm currently working with the Django framework to build a content management system into a company website, and after successfully completing one page, began work on a different page that requires a ...
-1
votes
1answer
19 views
How to automatically get a unique value from a sequence?
Background:
The application I am currently developing is in transition from SQLite3 to PostgreSQL. All the data has been successfully migrated, using the .dump from the current database, changing all ...
0
votes
0answers
6 views
how to insert big object into mongo in 32 bit build
in following code I need to insert a lot of data into mongo,in works on my laptop with 64bit debian,but I need to run in on my vps with 32bit ubuntu OS,which has 256mb of rams.
import random
import ...