Skip to content

Commit 95e138f

Browse files
committed
misc small docstring fixes
1 parent 14e47b5 commit 95e138f

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

larray/core/array.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3277,6 +3277,7 @@ def wrapper(self, *args, **kwargs):
32773277
@_decorate_agg_method(np.all, commutative=True, long_name="AND reduction")
32783278
def all(self, *args, **kwargs):
32793279
"""{signature}
3280+
32803281
Test whether all selected elements evaluate to True.
32813282
32823283
{parameters}
@@ -3347,6 +3348,7 @@ def all(self, *args, **kwargs):
33473348
@_decorate_agg_method(np.all, commutative=True, by_agg=True, long_name="AND reduction")
33483349
def all_by(self, *args, **kwargs):
33493350
"""{signature}
3351+
33503352
Test whether all selected elements evaluate to True.
33513353
33523354
{parameters}
@@ -3414,6 +3416,7 @@ def all_by(self, *args, **kwargs):
34143416
@_decorate_agg_method(np.any, commutative=True, long_name="OR reduction")
34153417
def any(self, *args, **kwargs):
34163418
"""{signature}
3419+
34173420
Test whether any selected elements evaluate to True.
34183421
34193422
{parameters}
@@ -3484,6 +3487,7 @@ def any(self, *args, **kwargs):
34843487
@_decorate_agg_method(np.any, commutative=True, by_agg=True, long_name="OR reduction")
34853488
def any_by(self, *args, **kwargs):
34863489
"""{signature}
3490+
34873491
Test whether any selected elements evaluate to True.
34883492
34893493
{parameters}
@@ -3553,6 +3557,7 @@ def any_by(self, *args, **kwargs):
35533557
@_decorate_agg_method(np.sum, np.nansum, commutative=True, extra_kwargs=['dtype'])
35543558
def sum(self, *args, **kwargs):
35553559
"""{signature}
3560+
35563561
Computes the sum of array elements along given axes/groups.
35573562
35583563
{parameters}
@@ -3617,6 +3622,7 @@ def sum(self, *args, **kwargs):
36173622
@_decorate_agg_method(np.sum, np.nansum, commutative=True, by_agg=True, extra_kwargs=['dtype'], long_name="sum")
36183623
def sum_by(self, *args, **kwargs):
36193624
"""{signature}
3625+
36203626
Computes the sum of array elements for the given axes/groups.
36213627
36223628
{parameters}
@@ -3679,6 +3685,7 @@ def sum_by(self, *args, **kwargs):
36793685
@_decorate_agg_method(np.prod, np_nanprod, commutative=True, extra_kwargs=['dtype'], long_name="product")
36803686
def prod(self, *args, **kwargs):
36813687
"""{signature}
3688+
36823689
Computes the product of array elements along given axes/groups.
36833690
36843691
{parameters}
@@ -3744,6 +3751,7 @@ def prod(self, *args, **kwargs):
37443751
long_name="product")
37453752
def prod_by(self, *args, **kwargs):
37463753
"""{signature}
3754+
37473755
Computes the product of array elements for the given axes/groups.
37483756
37493757
{parameters}
@@ -3805,6 +3813,7 @@ def prod_by(self, *args, **kwargs):
38053813
@_decorate_agg_method(np.min, np.nanmin, commutative=True, long_name="minimum", action_verb="search")
38063814
def min(self, *args, **kwargs):
38073815
"""{signature}
3816+
38083817
Get minimum of array elements along given axes/groups.
38093818
38103819
{parameters}
@@ -3868,6 +3877,7 @@ def min(self, *args, **kwargs):
38683877
@_decorate_agg_method(np.min, np.nanmin, commutative=True, by_agg=True, long_name="minimum", action_verb="search")
38693878
def min_by(self, *args, **kwargs):
38703879
"""{signature}
3880+
38713881
Get minimum of array elements for the given axes/groups.
38723882
38733883
{parameters}
@@ -3928,6 +3938,7 @@ def min_by(self, *args, **kwargs):
39283938
@_decorate_agg_method(np.max, np.nanmax, commutative=True, long_name="maximum", action_verb="search")
39293939
def max(self, *args, **kwargs):
39303940
"""{signature}
3941+
39313942
Get maximum of array elements along given axes/groups.
39323943
39333944
{parameters}
@@ -3991,6 +4002,7 @@ def max(self, *args, **kwargs):
39914002
@_decorate_agg_method(np.max, np.nanmax, commutative=True, by_agg=True, long_name="maximum", action_verb="search")
39924003
def max_by(self, *args, **kwargs):
39934004
"""{signature}
4005+
39944006
Get maximum of array elements for the given axes/groups.
39954007
39964008
{parameters}
@@ -4051,6 +4063,7 @@ def max_by(self, *args, **kwargs):
40514063
@_decorate_agg_method(np.mean, np.nanmean, commutative=True, extra_kwargs=['dtype'])
40524064
def mean(self, *args, **kwargs):
40534065
"""{signature}
4066+
40544067
Computes the arithmetic mean.
40554068
40564069
{parameters}
@@ -4116,6 +4129,7 @@ def mean(self, *args, **kwargs):
41164129
@_decorate_agg_method(np.mean, np.nanmean, commutative=True, by_agg=True, extra_kwargs=['dtype'], long_name="mean")
41174130
def mean_by(self, *args, **kwargs):
41184131
"""{signature}
4132+
41194133
Computes the arithmetic mean.
41204134
41214135
{parameters}
@@ -4178,6 +4192,7 @@ def mean_by(self, *args, **kwargs):
41784192
@_decorate_agg_method(np.median, np.nanmedian, commutative=True)
41794193
def median(self, *args, **kwargs):
41804194
"""{signature}
4195+
41814196
Computes the arithmetic median.
41824197
41834198
{parameters}
@@ -4247,6 +4262,7 @@ def median(self, *args, **kwargs):
42474262
@_decorate_agg_method(np.median, np.nanmedian, commutative=True, by_agg=True, long_name="mediane")
42484263
def median_by(self, *args, **kwargs):
42494264
"""{signature}
4265+
42504266
Computes the arithmetic median.
42514267
42524268
{parameters}
@@ -4317,6 +4333,7 @@ def median_by(self, *args, **kwargs):
43174333
# signature as other aggregate functions (extra argument)
43184334
def percentile(self, q, *args, **kwargs):
43194335
"""{signature}
4336+
43204337
Computes the qth percentile of the data along the specified axis.
43214338
43224339
{parameters}
@@ -4404,6 +4421,7 @@ def percentile(self, q, *args, **kwargs):
44044421

44054422
def percentile_by(self, q, *args, **kwargs):
44064423
"""{signature}
4424+
44074425
Computes the qth percentile of the data for the specified axis.
44084426
44094427
{parameters}
@@ -4489,6 +4507,7 @@ def percentile_by(self, q, *args, **kwargs):
44894507

44904508
def ptp(self, *args, **kwargs):
44914509
"""{signature}
4510+
44924511
Returns the range of values (maximum - minimum).
44934512
44944513
The name of the function comes from the acronym for ‘peak to peak’.
@@ -4553,6 +4572,7 @@ def ptp(self, *args, **kwargs):
45534572
@_decorate_agg_method(np.var, np.nanvar, extra_kwargs=['dtype', 'ddof'], long_name="variance")
45544573
def var(self, *args, **kwargs):
45554574
"""{signature}
4575+
45564576
Computes the unbiased variance.
45574577
45584578
Normalized by N-1 by default. This can be changed using the ddof argument.
@@ -4616,6 +4636,7 @@ def var(self, *args, **kwargs):
46164636
@_decorate_agg_method(np.var, np.nanvar, by_agg=True, extra_kwargs=['dtype', 'ddof'], long_name="variance")
46174637
def var_by(self, *args, **kwargs):
46184638
"""{signature}
4639+
46194640
Computes the unbiased variance.
46204641
46214642
Normalized by N-1 by default. This can be changed using the ddof argument.
@@ -4679,6 +4700,7 @@ def var_by(self, *args, **kwargs):
46794700
@_decorate_agg_method(np.std, np.nanstd, extra_kwargs=['dtype', 'ddof'], long_name="standard deviation")
46804701
def std(self, *args, **kwargs):
46814702
"""{signature}
4703+
46824704
Computes the sample standard deviation.
46834705
46844706
Normalized by N-1 by default. This can be changed using the ddof argument.
@@ -4743,6 +4765,7 @@ def std(self, *args, **kwargs):
47434765
long_name="standard deviation")
47444766
def std_by(self, *args, **kwargs):
47454767
"""{signature}
4768+
47464769
Computes the sample standard deviation.
47474770
47484771
Normalized by N-1 by default. This can be changed using the ddof argument.
@@ -5472,10 +5495,10 @@ def append(self, axis, value, label=None):
54725495
Parameters
54735496
----------
54745497
axis : axis reference
5475-
Axis along which to append input array (`value`).
5498+
Axis along which to append `value`.
54765499
value : scalar or LArray
54775500
Scalar or array with compatible axes.
5478-
label : str, optional
5501+
label : scalar, optional
54795502
Label for the new item in axis
54805503
54815504
Returns
@@ -5906,6 +5929,8 @@ def drop(self, labels=None):
59065929
def transpose(self, *args):
59075930
"""Reorder axes.
59085931
5932+
By default, reverse axes, otherwise permute the axes according to the list given as argument.
5933+
59095934
Parameters
59105935
----------
59115936
*args
@@ -6688,7 +6713,7 @@ def diff(self, axis=-1, d=1, n=1, label='upper'):
66886713
66896714
Returns
66906715
-------
6691-
LArray :
6716+
LArray
66926717
The n-th order differences. The shape of the output is the same as `a` except for `axis` which is smaller
66936718
by `n` * `d`.
66946719

larray/inout/csv.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ def read_csv(filepath_or_buffer, nb_axes=None, index_col=None, sep=',', headerse
3434
----------
3535
filepath_or_buffer : str or any file-like object
3636
Path where the csv file has to be read or a file handle.
37-
nb_axes : int, optional
37+
nb_axes : int or None, optional
3838
Number of axes of output array. The first ``nb_axes`` - 1 columns and the header of the CSV file will be used
3939
to set the axes of the output array. If not specified, the number of axes is given by the position of the
4040
first column header including a ``\`` character plus one. If no column header includes a ``\`` character,
4141
the array is assumed to have one axis. Defaults to None.
42-
index_col : list, optional
42+
index_col : list or None, optional
4343
Positions of columns for the n-1 first axes (ex. [0, 1, 2, 3]). Defaults to None (see nb_axes above).
4444
sep : str, optional
4545
Separator.
@@ -57,9 +57,10 @@ def read_csv(filepath_or_buffer, nb_axes=None, index_col=None, sep=',', headerse
5757
Whether or not to assume the array is stored in "wide" format.
5858
If False, the array is assumed to be stored in "narrow" format: one column per axis plus one value column.
5959
Defaults to True.
60-
dialect : 'classic' | 'larray' | 'liam2', optional
60+
dialect : {'classic', 'larray', 'liam2'}, optional
6161
Name of dialect. Defaults to 'larray'.
6262
**kwargs
63+
Extra keyword arguments are passed on to pandas.read_csv
6364
6465
Returns
6566
-------

0 commit comments

Comments
 (0)