@@ -743,7 +743,8 @@ def repr_class(x):
743743
744744
745745def assert_attr_equal (attr , left , right , obj = "Attributes" ):
746- """checks attributes are equal. Both objects must have attribute.
746+ """
747+ checks attributes are equal. Both objects must have attribute.
747748
748749 Parameters
749750 ----------
@@ -820,7 +821,8 @@ def assert_is_sorted(seq):
820821def assert_categorical_equal (
821822 left , right , check_dtype = True , check_category_order = True , obj = "Categorical"
822823):
823- """Test that Categoricals are equivalent.
824+ """
825+ Test that Categoricals are equivalent.
824826
825827 Parameters
826828 ----------
@@ -860,7 +862,8 @@ def assert_categorical_equal(
860862
861863
862864def assert_interval_array_equal (left , right , exact = "equiv" , obj = "IntervalArray" ):
863- """Test that two IntervalArrays are equivalent.
865+ """
866+ Test that two IntervalArrays are equivalent.
864867
865868 Parameters
866869 ----------
@@ -1009,12 +1012,13 @@ def _raise(left, right, err_msg):
10091012def assert_extension_array_equal (
10101013 left , right , check_dtype = True , check_less_precise = False , check_exact = False
10111014):
1012- """Check that left and right ExtensionArrays are equal.
1015+ """
1016+ Check that left and right ExtensionArrays are equal.
10131017
10141018 Parameters
10151019 ----------
10161020 left, right : ExtensionArray
1017- The two arrays to compare
1021+ The two arrays to compare.
10181022 check_dtype : bool, default True
10191023 Whether to check if the ExtensionArray dtypes are identical.
10201024 check_less_precise : bool or int, default False
@@ -1489,7 +1493,8 @@ def assert_sp_array_equal(
14891493 check_fill_value = True ,
14901494 consolidate_block_indices = False ,
14911495):
1492- """Check that the left and right SparseArray are equal.
1496+ """
1497+ Check that the left and right SparseArray are equal.
14931498
14941499 Parameters
14951500 ----------
@@ -1724,7 +1729,8 @@ def _make_timeseries(start="2000-01-01", end="2000-12-31", freq="1D", seed=None)
17241729
17251730
17261731def all_index_generator (k = 10 ):
1727- """Generator which can be iterated over to get instances of all the various
1732+ """
1733+ Generator which can be iterated over to get instances of all the various
17281734 index classes.
17291735
17301736 Parameters
@@ -1763,7 +1769,8 @@ def index_subclass_makers_generator():
17631769
17641770
17651771def all_timeseries_index_generator (k = 10 ):
1766- """Generator which can be iterated over to get instances of all the classes
1772+ """
1773+ Generator which can be iterated over to get instances of all the classes
17671774 which represent time-series.
17681775
17691776 Parameters
@@ -1854,7 +1861,8 @@ def makePeriodFrame(nper=None):
18541861def makeCustomIndex (
18551862 nentries , nlevels , prefix = "#" , names = False , ndupe_l = None , idx_type = None
18561863):
1857- """Create an index/multindex with given dimensions, levels, names, etc'
1864+ """
1865+ Create an index/multindex with given dimensions, levels, names, etc'
18581866
18591867 nentries - number of entries in index
18601868 nlevels - number of levels (> 1 produces multindex)
@@ -1970,35 +1978,39 @@ def makeCustomDataframe(
19701978 r_idx_type = None ,
19711979):
19721980 """
1973- nrows, ncols - number of data rows/cols
1974- c_idx_names, idx_names - False/True/list of strings, yields No names ,
1975- default names or uses the provided names for the levels of the
1976- corresponding index. You can provide a single string when
1977- c_idx_nlevels ==1.
1978- c_idx_nlevels - number of levels in columns index. > 1 will yield MultiIndex
1979- r_idx_nlevels - number of levels in rows index. > 1 will yield MultiIndex
1980- data_gen_f - a function f(row,col) which return the data value
1981- at that position, the default generator used yields values of the form
1982- "RxCy" based on position.
1983- c_ndupe_l, r_ndupe_l - list of integers, determines the number
1984- of duplicates for each label at a given level of the corresponding
1985- index. The default `None` value produces a multiplicity of 1 across
1986- all levels, i.e. a unique index. Will accept a partial list of length
1987- N < idx_nlevels, for just the first N levels. If ndupe doesn't divide
1988- nrows/ncol, the last label might have lower multiplicity.
1989- dtype - passed to the DataFrame constructor as is, in case you wish to
1990- have more control in conjunction with a custom `data_gen_f`
1991- r_idx_type, c_idx_type - "i"/"f"/"s"/"u"/"dt"/"td".
1992- If idx_type is not None, `idx_nlevels` must be 1.
1993- "i"/"f" creates an integer/float index,
1994- "s"/"u" creates a string/unicode index
1995- "dt" create a datetime index.
1996- "td" create a timedelta index.
1981+ Create a DataFrame using supplied parameters.
19971982
1998- if unspecified, string labels will be generated.
1999-
2000- Examples:
1983+ Parameters
1984+ ----------
1985+ nrows, ncols - number of data rows/cols
1986+ c_idx_names, idx_names - False/True/list of strings, yields No names ,
1987+ default names or uses the provided names for the levels of the
1988+ corresponding index. You can provide a single string when
1989+ c_idx_nlevels ==1.
1990+ c_idx_nlevels - number of levels in columns index. > 1 will yield MultiIndex
1991+ r_idx_nlevels - number of levels in rows index. > 1 will yield MultiIndex
1992+ data_gen_f - a function f(row,col) which return the data value
1993+ at that position, the default generator used yields values of the form
1994+ "RxCy" based on position.
1995+ c_ndupe_l, r_ndupe_l - list of integers, determines the number
1996+ of duplicates for each label at a given level of the corresponding
1997+ index. The default `None` value produces a multiplicity of 1 across
1998+ all levels, i.e. a unique index. Will accept a partial list of length
1999+ N < idx_nlevels, for just the first N levels. If ndupe doesn't divide
2000+ nrows/ncol, the last label might have lower multiplicity.
2001+ dtype - passed to the DataFrame constructor as is, in case you wish to
2002+ have more control in conjunction with a custom `data_gen_f`
2003+ r_idx_type, c_idx_type - "i"/"f"/"s"/"u"/"dt"/"td".
2004+ If idx_type is not None, `idx_nlevels` must be 1.
2005+ "i"/"f" creates an integer/float index,
2006+ "s"/"u" creates a string/unicode index
2007+ "dt" create a datetime index.
2008+ "td" create a timedelta index.
2009+
2010+ if unspecified, string labels will be generated.
20012011
2012+ Examples
2013+ --------
20022014 # 5 row, 3 columns, default names on both, single index on both axis
20032015 >> makeCustomDataframe(5,3)
20042016
@@ -2140,7 +2152,8 @@ def makeMissingDataframe(density=0.9, random_state=None):
21402152
21412153
21422154def optional_args (decorator ):
2143- """allows a decorator to take optional positional and keyword arguments.
2155+ """
2156+ allows a decorator to take optional positional and keyword arguments.
21442157 Assumes that taking a single, callable, positional argument means that
21452158 it is decorating a function, i.e. something like this::
21462159
@@ -2212,7 +2225,8 @@ def _get_default_network_errors():
22122225
22132226
22142227def can_connect (url , error_classes = None ):
2215- """Try to connect to the given url. True if succeeds, False if IOError
2228+ """
2229+ Try to connect to the given url. True if succeeds, False if IOError
22162230 raised
22172231
22182232 Parameters
@@ -2514,7 +2528,6 @@ class RNGContext:
25142528
25152529 Examples
25162530 --------
2517-
25182531 with RNGContext(42):
25192532 np.random.randn()
25202533 """
@@ -2581,7 +2594,8 @@ def use_numexpr(use, min_elements=None):
25812594
25822595
25832596def test_parallel (num_threads = 2 , kwargs_list = None ):
2584- """Decorator to run the same function multiple times in parallel.
2597+ """
2598+ Decorator to run the same function multiple times in parallel.
25852599
25862600 Parameters
25872601 ----------
@@ -2590,6 +2604,7 @@ def test_parallel(num_threads=2, kwargs_list=None):
25902604 kwargs_list : list of dicts, optional
25912605 The list of kwargs to update original
25922606 function kwargs on different threads.
2607+
25932608 Notes
25942609 -----
25952610 This decorator does not pass the return value of the decorated function.
@@ -2669,7 +2684,6 @@ def set_timezone(tz: str):
26692684
26702685 Examples
26712686 --------
2672-
26732687 >>> from datetime import datetime
26742688 >>> from dateutil.tz import tzlocal
26752689 >>> tzlocal().tzname(datetime.now())
0 commit comments