strange array size problem

2013-10-18 Thread chip9munk
Hello everybody! One strange problem, please help! I have the following 2D array: users_elements_matrix numpy.shape(users_elements_matrix) is (100,43) and array merged_binary_ratings numpy.shape(merged_binary_ratings) is (100,) Now,when I run: numpy.linalg.lstsq(users_elements_matrix,

Re: strange array size problem

2013-10-18 Thread chip9munk
one more thing. the problem is not in the last column, if I use it in regression (only that column, or with a few others) I will get the results. But if I use all 43 columns python breaks! whhh?!?!?! thanks! -- https://mail.python.org/mailman/listinfo/python-list

Re: strange array size problem

2013-10-18 Thread chip9munk
Interesting! rank of the whole minus last row numpy.linalg.matrix_rank(users_elements_matrix[:,0:42]) is 42 but also rank of whole is numpy.linalg.matrix_rank(users_elements_matrix[:,0:43]) is 42 but what does that mean?! could you explain briefly what now? thank you! On Friday, October 18,

Re: strange array size problem

2013-10-18 Thread chip9munk
On 18.10.2013 18:05, Oscar Benjamin wrote: It means that the additional column is a linear combination of the existing columns. This means that your system of equations can contain a contradiction. Essentially you're trying to get the least squares solution to something like: 3*x + y = 1 1*x +

Re: strange array size problem

2013-10-18 Thread chip9munk
On Friday, October 18, 2013 5:37:14 PM UTC+2, Robert Kern wrote: The numpy-discussion mailing list is probably the best place to ask. I recommend posting a complete working example (with data) that demonstrates the problem. Use pastebin.com or a similar service if necessary.

scipy and numpy for Python3

2012-10-12 Thread chip9munk
Hello! I am an absolute beginner in this. Does anyone know hot to build scipy for python 3? here: http://scipy.org/Installing_SciPy/Windows it says that it was not yet tested... (?) any help is appreciated! any additional help for numpy is also welcome! Thanx in advance! --

Re: scipy and numpy for Python3

2012-10-12 Thread chip9munk
ok, i have solved it by the help from the previously mentioned page. python 3.2 should be used, 3.3 has issues with building numpy and scipy. -- http://mail.python.org/mailman/listinfo/python-list

python scripts for web

2012-10-18 Thread chip9munk
Hello all! Please help me start learning about this thing. Sorry for my inexperience! Here is what I need to do: on some webpage (done in php, or any other different technology), user inputs some data, that data and the request then goes to the server where python scripts calculate something

Re: python scripts for web

2012-10-18 Thread chip9munk
To explain, I am basically doing different algorithms and would like to make them work and be accessible as I mentioned in the example... and to add them to the functionality of a specific page... so I have experience in programming, just no experience in web development etc.. On Thursday,

Re: python scripts for web

2012-10-18 Thread chip9munk
On Thursday, October 18, 2012 10:42:56 AM UTC+2, Zero Piraeus wrote: That is exactly what a webserver does. Is there some reason you don't want to use e.g. Apache to handle the requests? no reason at all. so i guess the solution is much easier then I have anticipated. So i guess in that case i

Re: python scripts for web

2012-10-18 Thread chip9munk
thank you for the answer! On Thursday, October 18, 2012 12:03:02 PM UTC+2, Chris Angelico wrote: CGI is a protocol between Apache and your script. What you want to do is set up Apache to call your CGI scripts. yes, but as I have just answered to Zero, is using mod_wsgi a better strategy? --

Re: python scripts for web

2012-10-18 Thread chip9munk
On Thursday, October 18, 2012 12:02:40 PM UTC+2, Zero Piraeus wrote: Assuming your scripts accept the request as sent and return an appropriate response, they are CGI scripts (unless there's some wrinkle in the precise definition of CGI that escapes me right now). yes, they are, but, I came

Re: python scripts for web

2012-10-18 Thread chip9munk
thank you guys for pointing the double posting issue out, I am having some issues with the news server i am using, so I am doing this via google.groups at the time! :) i think i managed to fix it -- http://mail.python.org/mailman/listinfo/python-list

Re: python scripts for web

2012-10-19 Thread chip9munk
On Thursday, October 18, 2012 11:10:45 PM UTC+2, Zero Piraeus wrote: WSGI would enable you to write a persistent application that sits around waiting for requests and returns responses for them as and when, as opposed to a simple CGI script that gets started each time a request comes in, and

Re: python scripts for web

2012-10-23 Thread chip9munk
On Friday, October 19, 2012 12:32:48 PM UTC+2, Gilles wrote: In that case, are you sure a web script is a good idea? If you're thinking web to make it easy for people to upload data, click on a button, and get the results back, you might want to write the UI in Python but write the number

debugging in eclipse

2012-11-15 Thread chip9munk
Hi all! I have a stupid problem, for which I cannot find a solution... I have a python module, lets call it debugTest.py. and it contains: def test(): a=1 b=2 c=a+b c so as simple as possible. Now I would like to debug it in eclipse.. (I have pydev and all) so the question is

Re: debugging in eclipse

2012-11-15 Thread chip9munk
On Thursday, November 15, 2012 1:49:22 PM UTC+1, Roy Smith wrote: Heh. It took me a while to realize that the subject line was not referring to http://en.wikipedia.org/wiki/Solar_eclipse_of_November_13,_2012 :)) -- http://mail.python.org/mailman/listinfo/python-list

Re: debugging in eclipse

2012-11-15 Thread chip9munk
On Thursday, November 15, 2012 2:42:09 PM UTC+1, Dave Angel wrote: Add a call to test() to the end of the file, and it might do better. I'd also add a print statement, just to assure yourself that it's running. thanks, that is it, (stupid me) now if I have many functions in the model I

Re: debugging in eclipse

2012-11-15 Thread chip9munk
On Thursday, November 15, 2012 2:44:22 PM UTC+1, Martin P. Hellwig wrote: I assume you have at the end of the debugTest.py file something like this: if __name__ == '__main__': test() no i did not have it... is main really necessary? -- http://mail.python.org/mailman/listinfo/python-list

Re: debugging in eclipse

2012-11-15 Thread chip9munk
On Thursday, November 15, 2012 2:43:26 PM UTC+1, Ulrich Eckhardt wrote: Should that be return c instead of c on a line? oh it is just a silly example function, the functionality is not important. It does not have to return anything... For a start, I would try to actually call the function.

Re: debugging in eclipse

2012-11-15 Thread chip9munk
On Thursday, November 15, 2012 3:21:52 PM UTC+1, Alister wrote: doing it that way means that it will only call test when executed directly not when imported as a module I see, thanks! -- http://mail.python.org/mailman/listinfo/python-list

editing conf file

2012-11-16 Thread chip9munk
Hi all! I would like to use conf file to get all the variables in my code. And it works great. I use the following (simple example): execfile(example.conf, config) print config[value1] and it works like a charm. Now the problem is I do not know how to edit the conf file... let us say

Re: editing conf file

2012-11-16 Thread chip9munk
ok, I've got it: http://docs.python.org/3.1/library/configparser.html works like a charm! Sorry for the unnecessary question. :/ -- http://mail.python.org/mailman/listinfo/python-list

Re: editing conf file

2012-11-16 Thread chip9munk
On 11/16/2012 1:35 PM, rusi wrote: And there may be better options (allows nested sections) http://www.voidspace.org.uk/python/configobj.html but it does not seem to work with python 3 I have an issue... configparser has four functions: get, getboolean, getfloat and getint. how do I get

Re: editing conf file

2012-11-16 Thread chip9munk
On 11/16/2012 2:02 PM, Ulrich Eckhardt wrote: Am 16.11.2012 13:06, schrieb chip9munk: I would like to use conf file to get all the variables in my code. And it works great. I use the following (simple example): execfile(example.conf, config) print config[value1] and it works like a charm

Re: editing conf file

2012-11-16 Thread chip9munk
On 11/16/2012 2:04 PM, Thomas Bach wrote: On Fri, Nov 16, 2012 at 01:48:49PM +0100, chip9munk wrote: configparser has four functions: get, getboolean, getfloat and getint. how do I get list from cfg file?! AFAIK you have to parse the list yourself. Something like my_list = [ s.strip() for s

django - adding a button with parallel functionality

2013-12-08 Thread chip9munk
Hi all! I'll try to be clear and brief. I have created a django project some months ago. It is an online survey. Now I want to add a button that when pressed adds something to a database, but does not change any existing functionalities. Brief explanation: button will always be present at the

csv read _csv.Error: line contains NULL byte

2014-03-21 Thread chip9munk
Hi all! I am reading from a huge csv file ( 20 Gb), so I have to read line by line: for i, row in enumerate(input_reader): # and I do something on each row Everything works fine until i get to a row with some strange symbols 0I`00�^ at that point I get an error: _csv.Error: line contains

Re: csv read _csv.Error: line contains NULL byte

2014-03-21 Thread chip9munk
On Friday, March 21, 2014 2:39:37 PM UTC+1, Tim Golden wrote: Without disturbing your existing code too much, you could wrap the input_reader in a generator which skips malformed lines. That would look something like this: def unfussy_reader(reader): while True:

Re: csv read _csv.Error: line contains NULL byte

2014-03-21 Thread chip9munk
Ok, I have figured it out: for i, row in enumerate(unfussy_reader(input_reader): # and I do something on each row Sorry, it is my first face to face with generators! Thank you very much! Best, Chip Munk -- https://mail.python.org/mailman/listinfo/python-list

python-django for dynamic web survey?

2013-06-18 Thread chip9munk
Hi guys! Please help me with your advices and ideas. I need to create a web survey that will dynamically (randomly) select questions and descriptions from a dataset, present them to users, collect their answers and store them back in the dataset. (Every user gets different set of questions

Re: python-django for dynamic web survey?

2013-06-18 Thread chip9munk
On 18-Jun-13 12:59 PM, andrea crotti wrote: Django makes your life a lot easier in many ways, but you still need some time to learn it. The task you're trying it's not trivial though, depending on your experience it might take a while with any library/framework.. I have an overall experience

Re: python-django for dynamic web survey?

2013-06-19 Thread chip9munk
On 19-Jun-13 7:04 AM, Jason Friedman wrote: How random do the questions need to be? Is a handful or two different combinations sufficient? Can you manually create these different surveys using, for example, surveymonkey, and distribute them? There are a lot possible combinations and