Re: Ram memory not freed after executing python script on ubuntu system

2020-05-28 Thread Rahul Gupta
On Thursday, May 28, 2020 at 11:20:05 AM UTC+5:30, Rahul Gupta wrote: > I am having a Ubuntu system which has 125 Gb of RAM. I executed few python > scripts on that system. Those scripts uses numpy arrays and pandas. Now > execution was over but still 50 gb of RAM and 2 Gb cache and

Ram memory not freed after executing python script on ubuntu system

2020-05-27 Thread Rahul Gupta
I am having a Ubuntu system which has 125 Gb of RAM. I executed few python scripts on that system. Those scripts uses numpy arrays and pandas. Now execution was over but still 50 gb of RAM and 2 Gb cache and 8.4 Gb of swap is occupied. At this moment nothing is running on the system. I have go

Re: error in CSV resetting with seek(0)

2020-05-02 Thread Rahul Gupta
@peter Otten thanks -- https://mail.python.org/mailman/listinfo/python-list

error in CSV resetting with seek(0)

2020-05-01 Thread Rahul Gupta
consider the following code import csv import numpy as np with open("D:\PHD\obranking\\demo.csv", mode='r') as csv_file1, open("D:\PHD\obranking\\demo.csv", mode='r') as csv_file2: csv_reader1 = csv.DictReader(csv_file1) csv_reader2 = csv.DictReader(csv_file2) filename = "cell_split

unable to write content in csv filw

2020-04-27 Thread Rahul Gupta
FOLLWOING IS MY CODE import pandas as pd import csv from sklearn.preprocessing import LabelEncoder from sklearn.feature_selection import chi2 with open("D:\PHD\obranking\\test_chi.csv", 'w') as csvfilew1: fields = ['index', 'feature name', 'p_value'] csvwriter1 = csv.DictWriter(csvfilew1, f

chi square test in sklearn printing NAN values for most of the columns

2020-04-27 Thread Rahul Gupta
chi value for 10th column but for most of the columns it is behaving like below "C:\Users\Rahul Gupta\PycharmProjects\CSVLearn\venv\Scripts\python.exe" "C:/Users/Rahul Gupta/PycharmProjects/CSVLearn/ChiSq_learn.py" (array([nan]), array([nan])) Process finished with exit c

Incremental PCA

2020-04-18 Thread Rahul Gupta
i wanted to implement incremental PCA. Got this code for stack overflow but i am wondering what y = chunk.pop("y") does and what is this argument "y" to pop from sklearn.decomposition import IncrementalPCA import csv import sys import numpy as np import pandas as pd dataset = sys.argv[1] chunksiz

Re: To apply pca for a large csv

2020-04-14 Thread Rahul Gupta
64 bit version -- https://mail.python.org/mailman/listinfo/python-list

To apply pca for a large csv

2020-04-14 Thread Rahul Gupta
Hello all, i have a csv of 1 gb which consists of 25000 columns and 2 rows. I want to apply pca so i have seen sciki-learn had inbuilt fucntionality to use that. But i have seen to do eo you have to load data in data frame. But my machine is i5 with 8 gb of ram which fails to load all this d

Re: i am want to read data from the csv that i wrote using python csv module but apart from filed names and row count i am unable to read rest of the data

2020-04-12 Thread Rahul Gupta
@Peter Thanks alot -- https://mail.python.org/mailman/listinfo/python-list

Re: i am want to read data from the csv that i wrote using python csv module but apart from filed names and row count i am unable to read rest of the data

2020-04-12 Thread Rahul Gupta
import csv import numpy as np with open("D:\PHD\obranking\\cell_split_demo.csv", mode='r') as csv_file: csv_reader = csv.DictReader(csv_file) print(csv_reader.fieldnames) col_count = print(len(csv_reader.fieldnames)) #print(sum(1 for row in csv_file)) row_count = 0

Re: i am want to read data from the csv that i wrote using python csv module but apart from filed names and row count i am unable to read rest of the data

2020-04-12 Thread Rahul Gupta
On Sunday, April 12, 2020 at 1:35:10 PM UTC+5:30, Rahul Gupta wrote: > the cells in my csv that i wrote looks likes this > ['82#201#426#553#602#621#811#908#1289#1342#1401#1472#1593#1641#1794#2290#2341#2391#3023#3141#3227#3240#3525#3529#3690#3881#4406#4421#4497#4719#4722#4920#505

i am want to read data from the csv that i wrote using python csv module but apart from filed names and row count i am unable to read rest of the data

2020-04-12 Thread Rahul Gupta
the cells in my csv that i wrote looks likes this ['82#201#426#553#602#621#811#908#1289#1342#1401#1472#1593#1641#1794#2290#2341#2391#3023#3141#3227#3240#3525#3529#3690#3881#4406#4421#4497#4719#4722#4920#5053#5146#5433'] and the cells which are empty looks like [''] i have tried the following code

python file downloader not working

2017-07-25 Thread Rahul Sircar
So I recently tried to write a script using urllib2 module. Here is the code below: import urllib2 file = 'metasploitable-linux-2.0.0.zip' url='https://downloads.sourceforge.net/project/metasploitable/Metasploitable2/metasploitable-linux-2.0.0.zip' response = urllib2.urlopen(url) fh=open(file,'w')

[no subject]

2017-07-22 Thread Rahul Sircar
I wrote my code for downloading a file 'Metasploitable' using urllib2.But it seems to have entered infinite loop.Because the screen is blank.It just hangs there.Please have a look at my code. import urllib2 file = 'metasploitable-linux-2.0.0.zip' url=' https://downloads.sourceforge.net/project/met

Re: Combining every pair of list items and creating a new list.

2017-07-18 Thread Rahul K P
ing difficulty thinking about how to do this as a Python beginner. > > But I have a list that is represented as: > > [1,2,3,4,5,6,7,8] > > and I would like the following results: > > [1,2] [3,4] [5,6] [7,8] > > Any ideas? > > Thanks > -- > https://mail.python.org/

do_POST not working on http.server with python

2016-04-28 Thread Rahul Raghunath
0 down vote favorite I'm trying to create a simple http server with basic GET and POST functionality. The program is supposed to GET requests by printing out a simple webpage that greets a user and askes how he would rather be greeted. When the user enters a greeting of his choice, th

Fwd: PROBLEM IN INSTALLATION

2015-07-16 Thread rahul tiwari
I want to import PIL package but every time this is showing error " no PIL module find" . plz suggest me how i can fix this problem. -- -- Rahul Tiwari Research Engineer Robospecies Technology Pvt. Ltd. -- https://mail.python.org/mailman/listinfo/python-list

Re: pythonw.exe has stopped working

2014-09-12 Thread Rahul Bhagat
On Friday, 12 September 2014 11:18:25 UTC+5:30, Rahul Bhagat wrote: > Hello Folks, > > > > I'm using RIDE -- Robot Framework Test Data Editor > > RIDE 1.3 running on Python 2.7.6. > > > > When I click on some of my test case the RIDE GUI h

Re: MySQL dymanic query in Python

2013-05-30 Thread RAHUL RAJ
On Wednesday, May 29, 2013 3:32:51 PM UTC+5:30, Fábio Santos wrote: > On 29 May 2013 10:13, "RAHUL RAJ" wrote: > > > > > > Can anyone tell me the proper way in which I can execute dynamic MySQL > > queries in Python? > > > > > >

MySQL dymanic query in Python

2013-05-29 Thread RAHUL RAJ
Can anyone tell me the proper way in which I can execute dynamic MySQL queries in Python? I want to do dynamic queries for both CREATE and INSERT statement. Here is my attempted code: sql="create table %s (%%s, %%s, %%s ... )" % (tablename,''.join(fields)+' '.join(types)) cur.execute(sql)

Re: Append to python List

2013-05-09 Thread RAHUL RAJ
I'm getting same output for both code parts, why not for th code parts in question? On Thursday, May 9, 2013 1:48:51 PM UTC+5:30, RAHUL RAJ wrote: > Then what about this code part? > > > > [(x, y) for x in [1,2,3] for y in [3,1,4] if x != y] > > >

Re: Append to python List

2013-05-09 Thread RAHUL RAJ
Then what about this code part? [(x, y) for x in [1,2,3] for y in [3,1,4] if x != y] and the following code part: for x in [1,2,3]: for y in [3,1,4]: if x != y: combs.append((x, y)) On Thursday, May 9, 2013 12:24:24 PM UTC+5:30, Gary Herron wrote: > On 05/08/2013 11:36 PM, RA

Append to python List

2013-05-08 Thread RAHUL RAJ
Checkout the following code: sample2 = [x+y for x in range(1,10) for y in range(1,10) if x!=y] output=[] output=[x for x in sample2 if x not in output] the output I get is 3 4 5 6 7 8 9 10 3 5 6 7 8 9 10 11 4 5 7 8 9 10 11 12 5 6 7 9 10 11 12 13 6 7 8 9 11 12 13 14 7 8 9 10 11 13 14 15 8 9 10

Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString()

2012-08-02 Thread rahul
07:08 UTC+5:30, Tim Golden wrote: > On 02/08/2012 10:21, rahul wrote: > > > > > > Hi TJG, > > > > > > The above link also doesn't strictly said that return value should be > > > NULL only, it only said that usually NULL pointer used. No w

Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString()

2012-08-02 Thread rahul
sed 0 for error value. Thanks, Rahul -- http://mail.python.org/mailman/listinfo/python-list

C extension module doesn't throw exception after setting error indicator through PyErr_SetString()

2012-08-02 Thread rahul
quot;O", &input)){ return NULL; } . . PyErr_SetString(PyExc_Exception, "Throwing Error through check function"); Py_RETURN_FALSE; } Any idea on why this is happening? Any help will be appreciated. Thanks, Rahul -- http://mail.

Python Weekly

2011-09-26 Thread Rahul
ubscribe to it here, http://www.pythonweekly.com/ Regards Rahul Chaudhary -- http://mail.python.org/mailman/listinfo/python-list

Re: Struggling to convert a mysql datetime object to a python string of a different format

2011-02-24 Thread rahul mishra
try this test = time.time(2011, 2, 1, 2, 4, 10) # this is your datetime object from mysql print time.mktime(test.timetuple()) hope this would help you > On Wednesday, August 04, 2010 7:40 PM ? wrote: > Okey, i have many hours now struggling to convert a mysql datetime > field that i retr

Re: Python API Functions equivalent to ruby's rb_big2str() and rb_str2cstr()

2009-05-12 Thread rahul
On May 12, 5:25 pm, Christian Heimes wrote: > rahul schrieb: > > > Is functions equivalent to ruby's  rb_big2str() and rb_str2cstr() > > available in Python. > > I had search a lot in google but not able to find that. > > If anybody know than please giv

Python API Functions equivalent to ruby's rb_big2str() and rb_str2cstr()

2009-05-12 Thread rahul
Is functions equivalent to ruby's rb_big2str() and rb_str2cstr() available in Python. I had search a lot in google but not able to find that. If anybody know than please give me the name of those functions of Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web based application development using python

2009-04-28 Thread Rahul
On Apr 28, 5:07 pm, Tim Hoffman wrote: > On Apr 28, 7:50 pm, Rahul wrote: > > > > > On Apr 28, 1:02 pm, Marco Mariani wrote: > > > > Rahul wrote: > > > > 1) Do you have any idea about web based support (like mod_python) > > > > provided by

Re: Web based application development using python

2009-04-28 Thread Rahul
On Apr 28, 1:02 pm, Marco Mariani wrote: > Rahul wrote: > > 1) Do you have any idea about web based support (like mod_python) > > provided by python.org (official web site) > > > Details: - As we know mod_python is used for embeding python code into > > apache

Re: Web based application development using python

2009-04-28 Thread Rahul
framework for embeding python on web server Thanks, Rahul -- http://mail.python.org/mailman/listinfo/python-list

Re: Web based application development using python

2009-04-27 Thread Rahul
s best for your application.  In general "have all the features > of" and "but better" conflict. > > --Scott David Daniels > scott.dani...@acm.org hi scott, i am getting more specific, is there any web development framework better than mod python which is easy to mai

is PyCodec_Encode API able to change encoding fron UCS-2 to UCS-4

2009-04-27 Thread rahul
"ucs-4-le" for little endian system and "ucs-4-be" for big endian system to set ucs-4 encoding. - Rahul Priyadarshi -- http://mail.python.org/mailman/listinfo/python-list

is PyCodec_Encode API able to change encoding fron UCS-2 to UCS-4

2009-04-27 Thread rahul
is this generic API can be use to change ucs-2 to ucs-4 PyObject * PyCodec_Encode( PyObject *object, const char *encoding, const char *errors ); if yes than what is the format of denoting ucs-4, because i try to do that but all times i got segmentation fault, i used "

Web based application development using python

2009-04-27 Thread Rahul
regarding will be greatly appreciated. Thanks & Regards, Rahul Warhekar -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with PyMapping_SetItemString()

2009-04-21 Thread rahul
On Apr 22, 12:17 am, Stefan Behnel wrote: > rahul wrote: > > tatic PyObject *upadteCheck(PyObject *self,PyObject *args){ > >    PyObject *var_pyvalue=NULL,*newVar_pyvalue=NULL,*dict=NULL; > >    char *varName; > > >    if (!PyArg_ParseTuple(args, "s", &am

problem with PyMapping_SetItemString()

2009-04-21 Thread rahul
i have a c extension tatic PyObject *upadteCheck(PyObject *self,PyObject *args){ PyObject *var_pyvalue=NULL,*newVar_pyvalue=NULL,*dict=NULL; char *varName; if (!PyArg_ParseTuple(args, "s", &varName)){ return NULL; } dict=PyEval_GetLocals();

problem with PyMapping_SetItemString()

2009-04-21 Thread rahul
i have a c extension tatic PyObject *upadteCheck(PyObject *self,PyObject *args){ PyObject *var_pyvalue=NULL,*newVar_pyvalue=NULL,*dict=NULL; char *varName; if (!PyArg_ParseTuple(args, "s", &varName)){ return NULL; } dict=PyEval_GetLocals();

is PyCodec_Encode() API returns New reference or Borrowed reference

2009-04-20 Thread rahul
Is PyCodec_Encode(PyObject *object,char *encoding,char *errors ) returns New reference or Borrowed reference -- http://mail.python.org/mailman/listinfo/python-list

Re: how to know argument name with which a function of extended c called

2009-04-15 Thread rahul
On Apr 14, 6:24 pm, John Machin wrote: > On Apr 14, 10:35 pm, rahul wrote: > > > Hi, > >   i need to write a 'c extension function' in this function i need to > > change argument value with  which this function called. > > The appropriate way for a functi

how to know argument name with which a function of extended c called

2009-04-14 Thread rahul
Hi, i need to write a 'c extension function' in this function i need to change argument value with which this function called. ie, if a python code like import changeValue as c arg="old value" c.changeValue(arg) print arg then it print

Re: what does "execfile" mean within profiler output and why does it not have a attached line number

2009-04-06 Thread Rahul
Thanks Robert. I was executing the profiler on the commandline like so: python -m profile ~/bin/visualize.py *.nc Is there any way to pass further options of the form sort etc. via this invocation. The manual did not specify usage of this form. -- Rahul -- http://mail.python.org/mailman/listinfo/python-list

Re: cProfile.py not found.

2009-04-04 Thread Rahul
ed the last bit about "New in version 2.5." -- Rahul -- http://mail.python.org/mailman/listinfo/python-list

what does "execfile" mean within profiler output and why does it not have a attached line number

2009-04-04 Thread Rahul
no(function) [snip] 10.0100.0101.2801.280 :0(execfile) [snip] ## -- Rahul -- http://mail.python.org/mailman/listinfo/python-list

Re: cProfile.py not found.

2009-04-04 Thread Rahul
John Machin wrote in news:4c8ee09e-71e2-464a-a3c0- b630b4707...@c18g2000prh.googlegroups.com: > Looks like our definitions of "read" differ :-) > Sorry. I ought to have said "skimmed" :) I guess I am one of those guilty lazy-bums that the manual refers to unde

Re: cProfile.py not found.

2009-04-04 Thread Rahul
John Yeung wrote in news:c0752f32-b0cf-4fde- 87a8-eb665252e...@k41g2000yqh.googlegroups.com: > I believe cProfile was added in 2.5. Your best bet on 2.4 is probably > the profile module. That is what the docs recommend. > Thanks John. That works. I'll use "profile&q

Re: cProfile.py not found.

2009-04-04 Thread Rahul
tself and other protected packages zope.i386 : Web application server for flexible content management applications -- Rahul -- http://mail.python.org/mailman/listinfo/python-list

cProfile.py not found.

2009-04-04 Thread Rahul
17 2008, 15:06:10). I am aware this is kind of dated but some of our legacy codes insist on using that exact version. -- Rahul -- http://mail.python.org/mailman/listinfo/python-list

Re: adodb has no attribute connect

2009-02-09 Thread Rahul
On Feb 10, 5:01 am, "Diez B. Roggisch" wrote: > Rahul schrieb: > > > Hello all, > > > I have to access data from database usingadodbso I did > > > Importadodb > > Conn=adodb.NewADOConnection("odbc") > > > Upto this it works p

adodb has no attribute connect

2009-02-08 Thread Rahul
Hello all, I have to access data from database using adodb so I did Import adodb Conn=adodb.NewADOConnection("odbc") Upto this it works properly but when I say Conn.Connect("","","") It gives error as [Attributrerror]: Object Nonetype has no attribute Connect. I have Red Hat Enterprise Linux

Re: i have an query regarding pyodbc

2009-02-06 Thread Rahul
On Feb 6, 3:53 pm, Rahul wrote: > On Feb 6, 11:27 am, Rahul wrote: > > > > > hello all, > > > I have installed pyodbc on my red hat enterprise 4 linux machine but > > when i go to use that using statement, > > > import pyodbc > > > through py

Re: i have an query regarding pyodbc

2009-02-06 Thread Rahul
On Feb 6, 11:27 am, Rahul wrote: > hello all, > > I have installed pyodbc on my red hat enterprise 4 linux machine but > when i go to use that using statement, > > import pyodbc > > through python console it gives me error as > > ImportError : dynamic module

i have an query regarding pyodbc

2009-02-05 Thread Rahul
JCR_LIST__ w _Jv_RegisterClasses 15fc d p.0 which means there is no init function. So what might be the cause for that? I have build that pyodbc twice. Any help regarding this will be greatly appreciated. Thanks & Regards Rahul -- http://mail.python.org/mailman/listinfo/python-list

Insatlling python on compute-node-linux (Cray).

2008-12-15 Thread Rahul
Has anyone tried installing Python on Compute Node Linux (on a cray)? I was having trouble getting it running. I see that CNL does not support dynamic libraries but I am not sure what the best way then is to get Python running. Any tips? -- Rahul -- http://mail.python.org/mailman/listinfo

Python 3000 C API Changes

2008-08-23 Thread rahul
I am trying to find out what Python C APIs are changing from Python 2.5 to Python 3.0 but there does not seem to be a single list of changes (or at least google is not finding one). If someone knows about where I should look, please let me know. -- http://mail.python.org/mailman/listinfo/python-lis

yum installs Tkinter in a way visible to only one python installation

2008-05-29 Thread Rahul
thon-2.4.4. What's the best way to work around this? -- Rahul -- http://mail.python.org/mailman/listinfo/python-list

adding tkinter support on an existing python installation

2008-05-28 Thread Rahul
'import _tkinter' fails on my system. I wanted to enable tk support. I do have tk and tk-devel installed (but they weren't around when we installed python). What's the best way to get these modules into python? I hope I do not have to reinstall python itself? Or do I

Re: python command mis-interprets arrow keys

2008-04-29 Thread Rahul
ually worked? I suspect we upgraded our RHEL and that broke it. Has never worked after. Is there a way to extract what cmd-line options my python was compiled with? Might be worth it before I go the long-painful route of re-installing. -- Rahul -- http://mail.python.org/mailman/listinfo/python-list

Re: python command mis-interprets arrow keys

2008-04-29 Thread Rahul
c/Python-2.4.4/Doc/lib/libreadline.tex Any better way to check? -- Rahul -- http://mail.python.org/mailman/listinfo/python-list

python command mis-interprets arrow keys

2008-04-29 Thread Rahul
mmand like is OK. vim interprets keystrokes correctly. So do other interpreters e.g. gnuplot. $LANG $TERM en_US xterm-color Versions: Python 2.4.4 GCC 4.1.2 20070925 (Red Hat 4.1.2-33) Any sugesstions? Google did not throw anything relevant. -- Rahul -- http://mail.python.org/mailman/lis

Python Developer, DIRECT CLIENT REQUIREMENT: Please Respond

2008-04-21 Thread Rahul Ka
years of UNIX experience 5 to 7 years of TCP/IP network development experience 3 to 5 years of Oracle DB experience- Good to have Payment industry knowledge a plus With Warm Regards and Wishes ! RAHUL Marketing Executive AMPLIFY SYSTEMS E Mail:[EMAIL PROTECTED] Phone :603-791-4428 Fax :267-284

importing a csv file as a Numeric array

2008-03-25 Thread Rahul
What's a good way of importing a csv text file of floats into a Numeric array? I tried the csv module and it seems to work well so long as I've ints. Does anyone have any suggestions / snippets that work to import a csv file of floats into a Numeric array? -Rahul -- http://mail.

Re: Lisp development with macros faster than Python development?..

2005-07-06 Thread Rahul
incorrect too. rahul [EMAIL PROTECTED] wrote: > I've been reading the beloved Paul Graham's "Hackers and Painters". > He claims he developed a web app at light speed using Lisp and lots > of macros. > > It got me curious if Lisp > is inherently faster to develop

Re: strange __call__

2005-06-29 Thread Rahul
Hi. I understood your point. thanks... rahul Steven Bethard wrote: > Steven Bethard wrote: > > > > def wrap(obj): > > def f(*args, **kwargs): > > for arg in args: > > print arg > > return obj(*args, **kwargs) > >

Re: strange __call__

2005-06-29 Thread Rahul
If you do C = wrap(C) C no longer remains a class..it becomes a function. Steven Bethard wrote: > Rahul wrote: > > def wrapper(obj): > >g = obj.__call__ > >def f(*args,**kwargs): > > for arg in args:print arg > > return g(*args,**kwargs) >

Re: strange __call__

2005-06-29 Thread Rahul
setting "__X__" special methods won't work in most cases > because these are usually optimized when the class is created. > > It might work if a.__call__ did exist before (because class a: contained > a __call__ definition). > > Andreas > > On Wed, Jun 29, 20

strange __call__

2005-06-28 Thread Rahul
Consider the following: def a(x): return x+1 def b(f): def g(*args,**kwargs): for arg in args: print arg return f(*args,**kwargs) return g a.__call__ = b(a.__call__) now calling a(1) and a.__call__(1) yield 2 different results!! i.e. for functions a(1) doesnt seem to be tran

Re: Multiple instances of a python program

2005-06-17 Thread Rahul
Steven D'Aprano wrote: > On Thu, 16 Jun 2005 11:47:10 -0700, Rahul wrote: > > > Hi. > > I am part of a group in my univ where we organize a programming > > contest. In this contest we have a UDP based server. The server > > simulates a game and each contest

Re: Multiple instances of a python program

2005-06-17 Thread Rahul
Hi. I will look into it..thanks rahul Jeremy Sanders wrote: > On Thu, 16 Jun 2005 11:47:10 -0700, Rahul wrote: > > > If you have a python script and you want that 75 copies of the script be > > run simultaneously how will you do it? Is there anyway to do so without > >

Re: Multiple instances of a python program

2005-06-17 Thread Rahul
Daniel Dittmar wrote: > Rahul wrote: > > Hi. > > I am part of a group in my univ where we organize a programming > > contest. In this contest we have a UDP based server. The server > > simulates a game and each contestant is to develop a team of virtual > > pla

Multiple instances of a python program

2005-06-16 Thread Rahul
Hi. I am part of a group in my univ where we organize a programming contest. In this contest we have a UDP based server. The server simulates a game and each contestant is to develop a team of virtual players. Each team is composed of 75 similar bots...i.e. governed by the same logic. Thus the cont

Re: computer algebra packages

2005-06-08 Thread Rahul
write the thing in python. if none is available then probably i will need to work on an interface to some package written in some other language or work in that language itself. rahul Kay Schluehr wrote: > Rahul wrote: > > Hi. > > Well is there an open source computer algebra system wr

computer algebra packages

2005-06-07 Thread Rahul
Hi. Well is there an open source computer algebra system written in python or at least having a python interface? I know of 2 efforts: pythonica and pyginac...are there any others? rahul -- http://mail.python.org/mailman/listinfo/python-list

Re: Optional Static Typing

2004-12-25 Thread Rahul
t 'expects' be a additional keyword.You can go like this also : def (int a,int b): or whatever you like. Only that expects make it a bit clearer IMHO. sincerely., rahul Scott David Daniels wrote: > Rahul wrote: > > 1.def gcd(a,b) expects (int,int) > > I presume by

Re: Optional Static Typing

2004-12-24 Thread Rahul
stressing on adding 'expects' as keyword or something. Only that type should not be enforced and 'expects' makes this clear. Rahul Garg -- http://mail.python.org/mailman/listinfo/python-list

Re: dot products

2004-12-19 Thread Rahul
Raymond Hettinger wrote: > [Rahul]. > > I want to compute dot product of two vectors stored as lists a and b.a > > and b are of the same length. > > > > one simple way is > > sum(a[i]*b[i] for i in range(len(a))) > > > > another simple way is > >

dot products

2004-12-19 Thread Rahul
above. (By the way profiling them i found that the second is faster by about 30%.) rahul -- http://mail.python.org/mailman/listinfo/python-list

why not arrays?

2004-12-16 Thread Rahul
Hi. I just wanted to know why arrays have not been included as a builtin datatype like lists or dictionaries? The numpy extension shows that it can be implemented. then why not include arrays in core python? rahul -- http://mail.python.org/mailman/listinfo/python-list