[Tutor] Docstring

2015-06-08 Thread Sunil Tech
Hi Team, what is the standard way of using docstrings? for example (Sphinx) def test(x): """ A dummy method Args: x (int): first argument Returns: "true or false" """ and if the method has no arguments? how should be the docstring? Thanks & Regards, Sunil. G

Re: [Tutor] Docstring

2015-06-08 Thread Steven D'Aprano
On Mon, Jun 08, 2015 at 03:04:05PM +0530, Sunil Tech wrote: > Hi Team, > > what is the standard way of using docstrings? There isn't one standard way of using docstrings. Different systems use different conventions. The conventions for the Python standard library are described here: https://ww

Re: [Tutor] Docstring

2015-06-08 Thread Sunil Tech
Thank you Steven D'Aprano On Mon, Jun 8, 2015 at 4:04 PM, Steven D'Aprano wrote: > On Mon, Jun 08, 2015 at 03:04:05PM +0530, Sunil Tech wrote: > > Hi Team, > > > > what is the standard way of using docstrings? > > There isn't one standard way of using docstrings. Different systems use > differen

[Tutor] Problem on filtering data

2015-06-08 Thread jarod_v6--- via Tutor
Dear All; I have a very silly problem. with open("Dati_differenzialigistvsminigist_solodiff.csv") as p: for i in p: lines = i.strip("\n").split("\t") if lines[8] != "NA": if lines[8] : print lines[8] Why I continue to obtain "" empity line? "bas

Re: [Tutor] Problem on filtering data

2015-06-08 Thread Alan Gauld
On 08/06/15 15:50, jarod_v6--- via Tutor wrote: with open("Dati_differenzialigistvsminigist_solodiff.csv") as p: You are usually better off processing CSV files (or in your case tab separated) using the CSV module. for i in p: lines = i.strip("\n").split("\t") if lin

Re: [Tutor] Docstring

2015-06-08 Thread Alan Gauld
On 08/06/15 10:34, Sunil Tech wrote: what is the standard way of using docstrings? As Steven said there are several "standards". Yet another option is to use the format required by doctest. For your example: def test(x): """ A dummy method >>> test(5) True >>> t

Re: [Tutor] Problem on filtering data

2015-06-08 Thread Steven D'Aprano
On Mon, Jun 08, 2015 at 04:50:13PM +0200, jarod_v6--- via Tutor wrote: > Dear All; > I have a very silly problem. The right way to handle CSV files is to use the csv module: https://docs.python.org/2/library/csv.html http://pymotw.com/2/csv/ Some more comments further below. > with open("Dati_

[Tutor] R: Tutor Digest, Vol 136, Issue 19

2015-06-08 Thread jarod_v6--- via Tutor
Thanks for the help!! The data I put unfortunately was runcated: ENSG0267199 11.8156750037 1.74423209120.51035586473.4176781572 0.00063157740.0122038731ENSG0267199 NA NA NA ENSG0267206 27.9863824875 -1.7496803666 0.5026610268-3.4808355401 0.0

Re: [Tutor] R: Tutor Digest, Vol 136, Issue 19

2015-06-08 Thread Danny Yoo
On Mon, Jun 8, 2015 at 1:12 PM, jarod_v6--- via Tutor wrote: > Thanks for the help!! The data I put unfortunately was runcated: > ENSG0267199 11.81567500371.74423209120.5103558647 > 3.4176781572 > 0.00063157740.0122038731ENSG0267199 NA NA NA > ENSG