§ <ˆjxøã óh—dZgd¢ZdZddlZddlZddlZ ddlmZn#e$r ddl mZYnwxYwddl Z ddl m ZddlmZmZmZmZdd l mZdd lmZmZmZmZmZmZmZdd lmZdd lmZm Z m!Z!dd l m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(ddl)m*Z*m+Z+ddl,Z,ddl-Z-ddl.Z.ddddddddddej/dœ Z0 dVd„Z1e+d¦« dWddœd„¦«Z2e+d¦«d„¦«Z3d„Z4e+d¦«e.j5d„¦«¦«Z6dXd!„Z7d"„Z8d#„Z9d$„Z:d%„Z;d&„Z d[ddœd,„Z?e*e?d¬-¦«dddd)d*e j@dddddd*f ddœd.„¦«ZAd/„ZBd0„ZCd1„ZDd2„ZEGd3„d4¦«ZFe+d¦« d\d7„¦«ZGe+d¦« d]d8„¦«ZHGd9„d:¦«ZIGd;„d<¦«ZJGd=„d>¦«ZKGd?„d@¦«ZLGdA„dBeL¦«ZMGdC„dDeL¦«ZNGdE„dF¦«ZOGdG„dH¦«ZPdI„ZQe$e%e&e'gZRdJ„ZSdK„ZTdddeAfdL„ZU d^dM„ZVe*eVd¬-¦«d^dN„¦«ZWe=¦«dO„¦«ZXdddeAfdP„ZY d^dQ„ZZe*eZd¬-¦«d^dR„¦«Z[e\eAdSeA¦«Z]ej^eYe]¬T¦«Z_ej^eUe]¬T¦«Z`d_dU„ZadS)`zXArray printing function $Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $ ) Ú array2stringÚ array_strÚ array_reprÚset_string_functionÚset_printoptionsÚget_printoptionsÚ printoptionsÚformat_float_positionalÚformat_float_scientificÚrestructuredtextéN)Ú get_identé)Ú numerictypes)ÚabsoluteÚisinfÚisfiniteÚisnat)Ú multiarray)ÚarrayÚdragon4_positionalÚdragon4_scientificÚdatetime_as_stringÚ datetime_dataÚndarrayÚset_legacy_print_mode)Úany)Ú concatenateÚasarrayÚerrstate)ÚlonglongÚintcÚint_Úfloat_Úcomplex_Úbool_Úflexible)Úarray_function_dispatchÚ set_moduleéièÚmaxprecéFéKÚnanÚinfú-) Ú edgeitemsÚ thresholdÚ floatmodeÚ precisionÚsuppressÚ linewidthÚnanstrÚinfstrÚsignÚ formatterÚlegacyc ó—d„t¦« ¦«D¦«} |�t|¦«| d<gd¢} | | dgzvr/tdd d„| D¦«¦«z¦«‚|dvrtd ¦«‚| d krt j| d <n1| d krd | d <n%| dkrd| d <n| €ntjdd¬¦«|�Lt|tj ¦«std¦«‚tj|¦«rtd¦«‚|�; tj|¦«| d<n"#t$r} td¦«| ‚d} ~ wwxYw| S)zm Make a dictionary out of the non-None arguments, plus conversion of *legacy* and sanity checks. có—i|] \}}|®||“Œ S©N©)Ú.0ÚkÚvs úL/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/core/arrayprint.pyú z&_make_options_dict..Hs€ÐBÐBÐB™˜˜1°A°Mˆq�!°M°M°MóNr4)ÚfixedÚuniquer*Ú maxprec_equalz floatmode option must be one of ú, c3ó@K—|]}d |¦«V—ŒdS)z"{}"N©Úformat)r?Úms rBú z%_make_options_dict..Ps.èè€Ð"CÐ"C¸ 6§=¢=°Ñ#3Ô#3Ð"CÐ"CÐ"CÐ"CÐ"CÐ"CrD)Nr/ú+ú z+sign option must be one of ' ', '+', or '-'Fr:ú1.13éqú1.21éyzGlegacy printing option can currently only be '1.13', '1.21', or `False`r)©Ú stacklevelzthreshold must be numericzIthreshold must be non-NAN, try sys.maxsize for untruncated representationr3zprecision must be an integer)ÚlocalsÚitemsÚboolÚ ValueErrorÚjoinÚsysÚmaxsizeÚwarningsÚwarnÚ isinstanceÚnumbersÚNumberÚ TypeErrorÚnpÚisnanÚoperatorÚindex)r3r1r0r5r4r6r7r8r9r2r:ÚoptionsÚmodesÚes rBÚ_make_options_dictrj@sÛ€ðCÐB¥¡¤§¢Ñ 0Ô 0ÐBÑBÔB€GàÐÝ" 8™nœnˆ� Ñà ;Ð ;Ð ;€Eؘ  ™Ð&Ð&ÝÐ;ØŸšÐ"CÐ"C¸UÐ"CÑ"CÔ"CÑCÔCñDñEôEð Eð Ð(Ð(Ð(ÝÐFÑGÔGÐGà �‚€ÝœKˆ�ÑÐØ �6Ò Ð Øˆ�ÑÐØ �6Ò Ð Øˆ�ÑÐØ ˆØ åŒ ð Ø"#ð %ñ %ô %ð %ðÐå˜)¥W¤^Ñ4Ô4ð 9ÝÐ7Ñ8Ô8Ð 8Ý Œ8�IÑ Ô ð KÝðJñKôKð KðÐð CÝ#+¤>°)Ñ#<Ô#<ˆG�KÑ Ð øÝð Cð Cð CÝÐ:Ñ;Ô;ÀÐ Bøøøøð Cøøøð €NsÄ%D=Ä= EÅEÅEÚnumpy©r:c  ój—t|||||||||| | ¦ « } || d<t | ¦«tddkrtd¦«dtd<dStddkrtd¦«dStdtjkrtd¦«dSdS) a Set printing options. These options determine the way floating point numbers, arrays and other NumPy objects are displayed. Parameters ---------- precision : int or None, optional Number of digits of precision for floating point output (default 8). May be None if `floatmode` is not `fixed`, to print as many digits as necessary to uniquely specify the value. threshold : int, optional Total number of array elements which trigger summarization rather than full repr (default 1000). To always use the full repr without summarization, pass `sys.maxsize`. edgeitems : int, optional Number of array items in summary at beginning and end of each dimension (default 3). linewidth : int, optional The number of characters per line for the purpose of inserting line breaks (default 75). suppress : bool, optional If True, always print floating point numbers using fixed point notation, in which case numbers equal to zero in the current precision will print as zero. If False, then scientific notation is used when absolute value of the smallest number is < 1e-4 or the ratio of the maximum absolute value to the minimum is > 1e3. The default is False. nanstr : str, optional String representation of floating point not-a-number (default nan). infstr : str, optional String representation of floating point infinity (default inf). sign : string, either '-', '+', or ' ', optional Controls printing of the sign of floating-point types. If '+', always print the sign of positive values. If ' ', always prints a space (whitespace character) in the sign position of positive values. If '-', omit the sign character of positive values. (default '-') formatter : dict of callables, optional If not None, the keys should indicate the type(s) that the respective formatting function applies to. Callables should return a string. Types that are not specified (by their corresponding keys) are handled by the default formatters. Individual types for which a formatter can be set are: - 'bool' - 'int' - 'timedelta' : a `numpy.timedelta64` - 'datetime' : a `numpy.datetime64` - 'float' - 'longfloat' : 128-bit floats - 'complexfloat' - 'longcomplexfloat' : composed of two 128-bit floats - 'numpystr' : types `numpy.bytes_` and `numpy.str_` - 'object' : `np.object_` arrays Other keys that can be used to set a group of types at once are: - 'all' : sets all types - 'int_kind' : sets 'int' - 'float_kind' : sets 'float' and 'longfloat' - 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat' - 'str_kind' : sets 'numpystr' floatmode : str, optional Controls the interpretation of the `precision` option for floating-point types. Can take the following values (default maxprec_equal): * 'fixed': Always print exactly `precision` fractional digits, even if this would print more or fewer digits than necessary to specify the value uniquely. * 'unique': Print the minimum number of fractional digits necessary to represent each value uniquely. Different elements may have a different number of digits. The value of the `precision` option is ignored. * 'maxprec': Print at most `precision` fractional digits, but if an element can be uniquely represented with fewer digits only print it with that many. * 'maxprec_equal': Print at most `precision` fractional digits, but if every element in the array can be uniquely represented with an equal number of fewer digits, use that many digits for all elements. legacy : string or `False`, optional If set to the string `'1.13'` enables 1.13 legacy printing mode. This approximates numpy 1.13 print output by including a space in the sign position of floats and different behavior for 0d arrays. This also enables 1.21 legacy printing mode (described below). If set to the string `'1.21'` enables 1.21 legacy printing mode. This approximates numpy 1.21 print output of complex structured dtypes by not inserting spaces after commas that separate fields and after colons. If set to `False`, disables legacy mode. Unrecognized strings will be ignored with a warning for forward compatibility. .. versionadded:: 1.14.0 .. versionchanged:: 1.22.0 See Also -------- get_printoptions, printoptions, set_string_function, array2string Notes ----- `formatter` is always reset with a call to `set_printoptions`. Use `printoptions` as a context manager to set the values temporarily. Examples -------- Floating point precision can be set: >>> np.set_printoptions(precision=4) >>> np.array([1.123456789]) [1.1235] Long arrays can be summarised: >>> np.set_printoptions(threshold=5) >>> np.arange(10) array([0, 1, 2, ..., 7, 8, 9]) Small results can be suppressed: >>> eps = np.finfo(float).eps >>> x = np.arange(4.) >>> x**2 - (x + eps)**2 array([-4.9304e-32, -4.4409e-16, 0.0000e+00, 0.0000e+00]) >>> np.set_printoptions(suppress=True) >>> x**2 - (x + eps)**2 array([-0., -0., 0., 0.]) A custom formatter can be used to display array elements as desired: >>> np.set_printoptions(formatter={'all':lambda x: 'int: '+str(-x)}) >>> x = np.arange(3) >>> x array([int: 0, int: -1, int: -2]) >>> np.set_printoptions() # formatter gets reset >>> x array([0, 1, 2]) To put back the default options, you can use: >>> np.set_printoptions(edgeitems=3, infstr='inf', ... linewidth=75, nanstr='nan', precision=8, ... suppress=False, threshold=1000, formatter=None) Also to temporarily override options, use `printoptions` as a context manager: >>> with np.printoptions(precision=2, suppress=True, threshold=5): ... np.linspace(0, 10, 10) array([ 0. , 1.11, 2.22, ..., 7.78, 8.89, 10. ]) r9r:rQr/r8rSr N)rjÚ_format_optionsÚupdaterr[r\) r3r1r0r5r4r6r7r9r8r2r:Úopts rBrrts΀õB ˜Y¨ °9¸iØ% v¨v°t¸YØ&¨ñ 0ô 0€Cð!€Cˆ ÑÝ×Ò˜3ÑÔÐõ�xÔ  CÒ'Ð'ݘcÑ"Ô"Ð"à"%�˜ÑÐÐÝ ˜Ô " cÒ )Ð )ݘcÑ"Ô"Ð"Ð"Ð"Ý ˜Ô "¥c¤kÒ 1Ð 1ݘaÑ Ô Ð Ð Ð ð 2Ð 1rDcóz—t ¦«}ddddtjdi|d|d<|S)a. Return the current print options. Returns ------- print_opts : dict Dictionary of current print options with keys - precision : int - threshold : int - edgeitems : int - linewidth : int - suppress : bool - nanstr : str - infstr : str - formatter : dict of callables - sign : str For a full description of these options, see `set_printoptions`. See Also -------- set_printoptions, printoptions, set_string_function rQrPrSrRFr:)rnÚcopyr[r\)Úoptss rBrr'sB€õ6 × Ò Ñ !Ô !€Dà ˆV�S˜&¥#¤+¨uðà ˆ8„nô€Dˆ�Nð €KrDcó—tdS)z'Return the legacy print mode as an int.r:)rnr>rDrBÚ_get_legacy_print_moderuIs €å ˜8Ô $Ð$rDc/óÌK—tj¦«} tj|i|¤Žtj¦«V—tjdi|¤ŽdS#tjdi|¤ŽwxYw)aƒContext manager for setting print options. Set print options for the scope of the `with` block, and restore the old options at the end. See `set_printoptions` for the full description of available options. Examples -------- >>> from numpy.testing import assert_equal >>> with np.printoptions(precision=2): ... np.array([2.0]) / 3 array([0.67]) The `as`-clause of the `with`-statement gives the current print options: >>> with np.printoptions(precision=2) as opts: ... assert_equal(opts, np.get_printoptions()) See Also -------- set_printoptions, get_printoptions Nr>)rcrr)ÚargsÚkwargsrss rBrrNs€èè€õ6 Ô Ñ Ô €Dð$Ý Ô˜TÐ, VÐ,Ð,Ð,ÝÔ!Ñ#Ô#Ð#Ð#Ð#å ÔÐ#Ð#˜dÐ#Ð#Ð#Ð#Ð#ø�ÔÐ#Ð#˜dÐ#Ð#Ð#Ð#øøøs —&AÁA#r>c ór—t|¦«}||jkr||S|j|d|zkr\tt |||t jd|…z¦«t |||t j| d…z¦«f|¬¦«St |||t jdd…z¦«S)z· Keep only the N-D corners (leading and trailing edges) of an array. Should be passed a base-class ndarray, since it makes no guarantees about preserving subclasses. éN)Úaxis)ÚlenÚndimÚshaperÚ_leading_trailingrcÚ index_exp)Úar0rfr{s rBrrqs¼€õ ˆu‰:Œ:€DØ ˆqŒv‚~€~Ø�Œxˆà„wˆt„}�q˜‘{Ò"Ð"ÝÝ ˜a ¨EµB´LÀ*À9À*Ô4MÑ,MÑ NÔ NÝ ˜a ¨EµB´LÀ)ÀÀÀÔ4MÑ,MÑ NÔ Nð ððñôð õ !  I¨uµr´|ÀAÀAÀA´Ñ/FÑGÔGÐGrDcób—t|¦«turd}nd}| |¦«S)z@ Object arrays containing lists should be printed unambiguously z list({!r})z{!r})ÚtypeÚlistrK)ÚoÚfmts rBÚ_object_formatr‡…s-€å ˆA�w„w•$€€ØˆˆàˆØ �:Š:�a‰=Œ=ÐrDcó —t|¦«Sr=)Úrepr©Úxs rBÚ repr_formatrŒ�s €Ý �‰7Œ7€NrDcó —t|¦«Sr=)ÚstrrŠs rBÚ str_formatr��s €Ý ˆq‰6Œ6€MrDc ót‡‡‡‡‡‡‡—ˆfd„ˆfd„ˆˆˆˆˆˆfd„ˆˆˆˆˆˆfd„ˆˆˆˆˆˆfd„ˆˆˆˆˆˆfd„ˆˆfd„ˆfd„d „d „d „d œ }d „} ‰�íˆfd„‰ ¦«D¦«} d| vr+| ¦«D]} | ‰d¦«|| <Œd| vrdD]} | ‰d¦«|| <Œd| vrdD]} | ‰d¦«|| <Œd| vrdD]} | ‰d¦«|| <Œd| vr| ‰d¦«|d<| ¦«D]} | | vr| ‰| ¦«|| <Œ|S)Ncó"•—t‰¦«Sr=)Ú BoolFormat©Údatas€rBúz!_get_formatdict..™sø€�  4Ñ(Ô(€rDcó"•—t‰¦«Sr=)Ú IntegerFormatr“s€rBr•z!_get_formatdict..šsø€•} TÑ*Ô*€rDcó.•—t‰‰‰‰‰‰¬¦«S©Nrl©ÚFloatingFormat©r”r2r:r3r8r4s€€€€€€rBr•z!_get_formatdict..›s&ø€�Ø �)˜Y¨°$¸vðGñGôG€rDcó.•—t‰‰‰‰‰‰¬¦«Sr™ršrœs€€€€€€rBr•z!_get_formatdict..�s&ø€�^Ø �)˜Y¨°$¸vðGñGôG€rDcó.•—t‰‰‰‰‰‰¬¦«Sr™©ÚComplexFloatingFormatrœs€€€€€€rBr•z!_get_formatdict..Ÿs'ø€Õ 5Ø �)˜Y¨°$¸vð!Gñ!Gô!G€rDcó.•—t‰‰‰‰‰‰¬¦«Sr™rŸrœs€€€€€€rBr•z!_get_formatdict..¡s'ø€Õ$9Ø �)˜Y¨°$¸vð%Gñ%Gô%G€rDcó&•—t‰‰¬¦«Sr™)ÚDatetimeFormat)r”r:s€€rBr•z!_get_formatdict..£sø€�N¨4¸Ð?Ñ?Ô?€rDcó"•—t‰¦«Sr=)ÚTimedeltaFormatr“s€rBr•z!_get_formatdict..¤sø€�_¨TÑ2Ô2€rDcó—tSr=)r‡r>rDrBr•z!_get_formatdict..¥s€�.€rDcó—tSr=)r�r>rDrBr•z!_get_formatdict..¦s€� €rDcó—tSr=)rŒr>rDrBr•z!_get_formatdict..§s€�K€rD) rXÚintÚfloatÚ longfloatÚ complexfloatÚlongcomplexfloatÚdatetimeÚ timedeltaÚobjectÚvoidÚnumpystrcó‡—ˆfd„S)Ncó•—‰Sr=r>rŠs€rBr•z3_get_formatdict..indirect..¬sø€�q€rDr>rŠs`rBÚindirectz!_get_formatdict..indirect«sø€ØˆyˆyˆyÐrDcó$•—g|] }‰|® |‘Œ Sr=r>)r?r@r9s €rBú z#_get_formatdict..¯s"ø€ÐIÐIÐI�q° ¸!´ Ð0H�Ð0HÐ0HÐ0HrDÚallÚint_kind)r©Ú float_kind)rªr«Ú complex_kind)r¬r­Ústr_kindr²)Úkeys) r”r3r2r4r8r:r9rxÚ formatdictrµÚfkeysÚkeys ``````` rBÚ_get_formatdictrÁ“s°øøøøøøø€ð )Ð(Ð(Ð(Ø*Ð*Ð*Ð*ðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGðGà?Ð?Ð?Ð?Ð?Ø2Ð2Ð2Ð2Ø(Ð(Ø"Ð"Ø'Ð'ð)ð)€Jð&ðððÐØIÐIÐIÐI˜IŸNšNÑ,Ô,ÐIÑIÔIˆØ �Eˆ>ˆ>Ø!—’Ñ(Ô(ð =ð =�Ø"* (¨9°UÔ+;Ñ"<Ô"<� ˜3‘�Ø ˜Ð Ð Øð Bð B�Ø"* (¨9°ZÔ+@Ñ"AÔ"A� ˜3‘�Ø ˜5Ð Ð Ø-ð Dð D�Ø"* (¨9°\Ô+BÑ"CÔ"C� ˜3‘�Ø ˜UÐ "Ð "Ø;ð Fð F�Ø"* (¨9°^Ô+DÑ"EÔ"E� ˜3‘�Ø ˜Ð Ð Ø%- X¨i¸ Ô.CÑ%DÔ%DˆJ�zÑ "Ø—?’?Ñ$Ô$ð ;ð ;ˆCØ�eˆ|ˆ|Ø"* (¨9°S¬>Ñ":Ô":� ˜3‘øà ÐrDc ób—|j}|j}t|fi|¤Ž}|€|d¦«St|tj¦«r|d¦«St|tj¦«r:t|tj¦«r|d¦«S|d¦«St|tj¦«r:t|tj ¦«r|d¦«S|d¦«St|tj ¦«r:t|tj ¦«r|d¦«S|d ¦«St|tj tj f¦«r|d¦«St|tj¦«r|d ¦«St|tj¦«r|d ¦«St|tj¦«r)|j�t%j|fi|¤ŽS|d ¦«S|d¦«S) z; find the right formatting function for the dtype_ Nr²rXr¯r©r«rªr­r¬r®r°r±)ÚdtyperƒrÁÚ issubclassÚ_ntr%ÚintegerÚ timedelta64Úfloatingr«ÚcomplexfloatingÚ clongfloatÚstr_Úbytes_Ú datetime64Úobject_r±ÚnamesÚStructuredVoidFormatÚ from_data)r”rgÚdtype_Údtypeobjr¾s rBÚ_get_format_functionrÔÄs*€ðŒZ€FØŒ{€HÝ  Ð1Ð1¨Ð1Ð1€JØÐØ%ˆz˜*Ô%Ñ'Ô'Ð'Ý �H�cœiÑ (Ô (ð(Ø!ˆz˜&Ô!Ñ#Ô#Ð#Ý �H�cœkÑ *Ô *ð(Ý �h¥¤Ñ 0Ô 0ð 'Ø*�:˜kÔ*Ñ,Ô,Ð ,à$�:˜eÔ$Ñ&Ô&Ð &Ý �H�cœlÑ +Ô +ð(Ý �h¥¤ Ñ .Ô .ð )Ø*�:˜kÔ*Ñ,Ô,Ð ,à&�:˜gÔ&Ñ(Ô(Ð (Ý �H�cÔ1Ñ 2Ô 2ð(Ý �h¥¤Ñ /Ô /ð 0Ø1�:Ð0Ô1Ñ3Ô3Ð 3à-�:˜nÔ-Ñ/Ô/Ð /Ý �H�sœx­¬Ð4Ñ 5Ô 5ð (Ø%ˆz˜*Ô%Ñ'Ô'Ð'Ý �H�cœnÑ -Ô -ð (Ø%ˆz˜*Ô%Ñ'Ô'Ð'Ý �H�cœkÑ *Ô *ð(Ø#ˆz˜(Ô#Ñ%Ô%Ð%Ý �H�cœhÑ 'Ô 'ð(Ø Œ<Ð #Ý'Ô1°$ÐBÐB¸'ÐBÐBÐ Bà%�:˜fÔ%Ñ'Ô'Ð 'à%ˆz˜*Ô%Ñ'Ô'Ð'rDú...có‡—ˆfd„}|S)a  Like the python 3.2 reprlib.recursive_repr, but forwards *args and **kwargs Decorates a function such that if it calls itself with the same first argument, it returns `fillvalue` instead of recursing. Largely copied from reprlib.recursive_repr cój•‡‡—t¦«Štj‰¦«ˆˆˆfd„¦«}|S)Ncóì•—t|¦«t¦«f}|‰vr‰S‰ |¦« ‰|g|¢Ri|¤Ž‰ |¦«S#‰ |¦«wxYwr=)Úidr ÚaddÚdiscard)ÚselfrwrxrÀÚfÚ fillvalueÚ repr_runnings €€€rBÚwrapperz>_recursive_guard..decorating_function..wrapperús�ø€å�T‘(”(�I™KœKÐ'ˆCØ�lÐ"Ð"Ø Ð Ø × Ò ˜SÑ !Ô !Ð !ð *Ø�q˜Ð/ Ð/Ð/Ð/¨Ð/Ð/à×$Ò$ SÑ)Ô)Ð)Ð)ø� ×$Ò$ SÑ)Ô)Ð)Ð)øøøs » AÁA3)ÚsetÚ functoolsÚwraps)rÝràrßrÞs` @€rBÚdecorating_functionz-_recursive_guard..decorating_function÷sMøøø€Ý‘u”uˆ å Œ˜Ñ Ô ð *ð *ð *ð *ð *ð *ñ Ô ð *ðˆrDr>)rÞräs` rBÚ_recursive_guardråís$ø€ðððððð ÐrDrOÚc ó.—t|¦«}|jdkr|}|j|dkrd}t||d¦«}nd}t |fi|¤Ž}d}|dt |¦«zz }t |||d|||d||d¦«}|S) Nr>r1rÕr0rærOr5r:)rr~ÚsizerrÔr|Ú _formatArray) r�rgÚ separatorÚprefixr”Úsummary_insertÚformat_functionÚnext_line_prefixÚlsts rBÚ _array2stringrð s¼€õ �1‰:Œ:€DØ„w�"‚}€}Ø ˆà„v�˜ Ô$Ò$Ð$ØˆÝ   w¨{Ô';Ñ<Ô<ˆˆàˆõ+¨4Ð;Ð;°7Ð;Ð;€OðÐà˜�C ™KœK™Ñ'Ðå �q˜/¨7°;Ô+?Ø'¨°G¸KÔ4HØ% w¨xÔ'8ñ :ô :€Cð €JrDc ó—|fSr=r>)r�Úmax_line_widthr3Úsuppress_smallrêrëÚstyler9r1r0r8r2Úsuffixr:s rBÚ_array2string_dispatcherrö(s €ð ˆ4€KrD)Úmodulec  ó —t||| ||dd| || | ¦ « }t ¦«}| |¦«|ddkrJ|tjurt }|jdkr)|jj €||  ¦«¦«Sn*|tjurtj dtd¬¦«|ddkr|dxxt| ¦«zcc<|jd krd St!||||¦«S) a‹ Return a string representation of an array. Parameters ---------- a : ndarray Input array. max_line_width : int, optional Inserts newlines if text is longer than `max_line_width`. Defaults to ``numpy.get_printoptions()['linewidth']``. precision : int or None, optional Floating point precision. Defaults to ``numpy.get_printoptions()['precision']``. suppress_small : bool, optional Represent numbers "very close" to zero as zero; default is False. Very close is defined by precision: if the precision is 8, e.g., numbers smaller (in absolute value) than 5e-9 are represented as zero. Defaults to ``numpy.get_printoptions()['suppress']``. separator : str, optional Inserted between elements. prefix : str, optional suffix : str, optional The length of the prefix and suffix strings are used to respectively align and wrap the output. An array is typically printed as:: prefix + array2string(a) + suffix The output is left-padded by the length of the prefix string, and wrapping is forced at the column ``max_line_width - len(suffix)``. It should be noted that the content of prefix and suffix strings are not included in the output. style : _NoValue, optional Has no effect, do not use. .. deprecated:: 1.14.0 formatter : dict of callables, optional If not None, the keys should indicate the type(s) that the respective formatting function applies to. Callables should return a string. Types that are not specified (by their corresponding keys) are handled by the default formatters. Individual types for which a formatter can be set are: - 'bool' - 'int' - 'timedelta' : a `numpy.timedelta64` - 'datetime' : a `numpy.datetime64` - 'float' - 'longfloat' : 128-bit floats - 'complexfloat' - 'longcomplexfloat' : composed of two 128-bit floats - 'void' : type `numpy.void` - 'numpystr' : types `numpy.bytes_` and `numpy.str_` Other keys that can be used to set a group of types at once are: - 'all' : sets all types - 'int_kind' : sets 'int' - 'float_kind' : sets 'float' and 'longfloat' - 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat' - 'str_kind' : sets 'numpystr' threshold : int, optional Total number of array elements which trigger summarization rather than full repr. Defaults to ``numpy.get_printoptions()['threshold']``. edgeitems : int, optional Number of array items in summary at beginning and end of each dimension. Defaults to ``numpy.get_printoptions()['edgeitems']``. sign : string, either '-', '+', or ' ', optional Controls printing of the sign of floating-point types. If '+', always print the sign of positive values. If ' ', always prints a space (whitespace character) in the sign position of positive values. If '-', omit the sign character of positive values. Defaults to ``numpy.get_printoptions()['sign']``. floatmode : str, optional Controls the interpretation of the `precision` option for floating-point types. Defaults to ``numpy.get_printoptions()['floatmode']``. Can take the following values: - 'fixed': Always print exactly `precision` fractional digits, even if this would print more or fewer digits than necessary to specify the value uniquely. - 'unique': Print the minimum number of fractional digits necessary to represent each value uniquely. Different elements may have a different number of digits. The value of the `precision` option is ignored. - 'maxprec': Print at most `precision` fractional digits, but if an element can be uniquely represented with fewer digits only print it with that many. - 'maxprec_equal': Print at most `precision` fractional digits, but if every element in the array can be uniquely represented with an equal number of fewer digits, use that many digits for all elements. legacy : string or `False`, optional If set to the string `'1.13'` enables 1.13 legacy printing mode. This approximates numpy 1.13 print output by including a space in the sign position of floats and different behavior for 0d arrays. If set to `False`, disables legacy mode. Unrecognized strings will be ignored with a warning for forward compatibility. .. versionadded:: 1.14.0 Returns ------- array_str : str String representation of the array. Raises ------ TypeError if a callable in `formatter` does not return a string. See Also -------- array_str, array_repr, set_printoptions, get_printoptions Notes ----- If a formatter is specified for a certain type, the `precision` keyword is ignored for that type. This is a very flexible function; `array_repr` and `array_str` are using `array2string` internally so keywords with the same name should work identically in all three functions. Examples -------- >>> x = np.array([1e-16,1,2,3]) >>> np.array2string(x, precision=2, separator=',', ... suppress_small=True) '[0.,1.,2.,3.]' >>> x = np.arange(3.) >>> np.array2string(x, formatter={'float_kind':lambda x: "%.2f" % x}) '[0.00 1.00 2.00]' >>> x = np.arange(3) >>> np.array2string(x, formatter={'int':lambda x: hex(x)}) '[0x0 0x1 0x2]' Nr:rQr>zT'style' argument is deprecated and no longer functional except in 1.13 'legacy' moderzrTr5r z[])rjrnrrrorcÚ_NoValuer‰r~rÃrÏÚitemr]r^ÚDeprecationWarningr|rèrð)r�ròr3rórêrërôr9r1r0r8r2rõr:Ú overridesrgs rBrr1s*€õl# 9¨i¸Ø#1°>À4ÈØ#'¨°I¸vñGôG€Iõ×"Ò"Ñ$Ô$€GØ ‡N‚N�9ÑÔÐàˆxÔ˜CÒÐØ •B”KРР݈Eà Œ7�bŠ=ˆ=˜QœWœ]Ð2Ø�5˜Ÿš™œ‘?”?Ð "øØ •b”kÐ !Ð !åŒ ð6å(°Qð 8ñ 8ô 8ð 8ðˆxÔ˜3ÒÐØ� ÐÐÔ¥ F¡ ¤ Ñ+ÐÐÑð „v�‚{€{؈tå ˜˜G Y°Ñ 7Ô 7Ð7rDcóæ—t|¦«t|¦«z|k}|dkr"t|¦«t|¦«krd}|r|| ¦«dzz }|}||z }||fS)NrQFú )r|Úrstrip)ÚsÚlineÚwordÚ line_widthrîr:Ú needs_wraps rBÚ _extendLinerãs{€Ý�T‘”�S ™YœYÑ&¨Ò3€JØ �‚|€|å ˆt‰9Œ9�Ð,Ñ-Ô-Ò -Ð -؈Jàð Ø ˆT�[Š[‰]Œ]˜TÑ !Ñ!ˆØˆØˆD�L€DØ ˆdˆ7€NrDcóL—| ¦«}t|¦«dks|dkrt||||||¦«Std„|D¦«¦«}t|¦«|z|krHt|¦«t|¦«kr(|| ¦«dzz }||dz}|}nt|¦«dz}||dz }|dd…D]!}|| ¦«dzz }||z}Œ"|t|d¦«z } || dzz }||fS) zS Extends line with nicely formatted (possibly multi-line) string ``word``. rrQc3ó4K—|]}t|¦«V—ŒdSr=©r|)r?rs rBrMz%_extendLine_pretty..ùs(èè€Ð6Ð6¨�#˜d™)œ)Ð6Ð6Ð6Ð6Ð6Ð6rDrþr rONéÿÿÿÿ)Ú splitlinesr|rÚmaxrÿ) rrrrrîr:ÚwordsÚmax_word_lengthÚindentÚ suffix_lengths rBÚ_extendLine_prettyrñs=€ð �OŠOÑ Ô €EÝ ˆ5�z„z�Q‚€˜& Cš-˜-ݘ1˜d D¨*Ð6FÈÑOÔOÐOåÐ6Ð6°Ð6Ñ6Ô6Ñ6Ô6€OÝ ˆD‰ Œ �OÑ# jÒ0Ð0Ý �‰IŒI�Ð,Ñ-Ô-Ò -Ð -Ø ˆT�[Š[‰]Œ]˜TÑ !Ñ!ˆØ %¨¤(Ñ*ˆØ!ˆˆå�T‘”˜3‘ˆØ ��a”шà�a�c�c” ððˆØ ˆT�[Š[‰]Œ]˜TÑ !Ñ!ˆØ˜‰}ˆˆà#¥c¨%°¬)¡n¤nÑ4€M؈M˜#Ñ Ñ€Dà ˆdˆ7€NrDcóV‡‡‡‡‡‡‡—ˆˆˆˆˆˆˆfd„Š ‰d||¬¦«dŠS#dŠwxYw)zgformatArray is designed for two modes of operation: 1. Full output 2. Summarized output c ó<•—t|¦«}‰j|z }|dkr‰‰|¦«S|dz}‰dkr|}n|td¦«z }‰j|}‰od‰z|k}|r‰} ‰} nd} |} d} |dk�rL‰dkr%|t‰ ¦«¦«z } n?|t t‰ ¦«¦«td¦«¦«z } |} t | ¦«D]/}‰||fz||¦«}t | | || |‰¦«\} } | ‰z } Œ0|r(t| | ‰| |‰¦«\} } ‰dkr| dz } n| ‰z } t | dd ¦«D]0}‰|| fz||¦«}t | | || |‰¦«\} } | ‰z } Œ1‰dkr|} ‰|d z||¦«}t | | || |‰¦«\} } | | z } nµd} ‰ ¦«d |dz zz}t | ¦«D]}‰||fz||¦«}| ||z|zz } Œ|r‰dkr | |‰zd zz } n | |‰z|zz } t | dd ¦«D]}‰|| fz||¦«}| ||z|zz } Œ ‰|d z||¦«}| ||zz } d | t|¦«d…zdz} | S)z¼ By using this local function, we don't need to recurse with all the arguments. Since this function is not created recursively, the cost is not significant r rOrQú]rzrærrHr )r rþz, ú[N)r|r}r~rÿr Úrangerr)rfÚhanging_indentÚ curr_widthr{Ú axes_leftÚnext_hanging_indentÚ next_widthÚa_lenÚ show_summaryÚ leading_itemsÚtrailing_itemsrÚ elem_widthrÚirÚline_sepÚnestedr�Ú edge_itemsrír:Úrecurserrêrìs €€€€€€€rBr$z_formatArray..recursers»ø€õ �5‰zŒzˆØ”F˜T‘Mˆ à ˜Š>ˆ>Ø"�? 1 U¤8Ñ,Ô,Ð ,ð-¨sÑ2ÐØ �SŠ=ˆ=Ø#ˆJˆJà#¥c¨#¡h¤hÑ.ˆJà”˜” ˆØ%Ð>¨!¨J©,¸Ò*>ˆ Ø ð #Ø&ˆMØ'ˆNˆNàˆMØ"ˆNð ˆð ˜Š>‰>à˜Š}ˆ}Ø'­#¨i×.>Ò.>Ñ.@Ô.@Ñ*AÔ*AÑA� � à'­#­c°)×2BÒ2BÑ2DÔ2DÑ.EÔ.EÅsÈ3ÁxÄxÑ*PÔ*PÑP� à!ˆDݘ=Ñ)Ô)ð "ð "�Ø�x ¨¨¡ Ð.AÀ:ÑNÔN�Ý,Ø�t˜T :¨~¸vñGôG‘��4à˜ Ñ!��àð &Ý%Ø�t˜^¨Z¸ÈñQôQ‘��4à˜S’=�=ؘD‘L�D�Dà˜IÑ%�Då˜>¨1¨bÑ1Ô1ð "ð "�Ø�x ¨!¨¨¡ Ð/BÀJÑOÔO�Ý,Ø�t˜T :¨~¸vñGôG‘��4à˜ Ñ!��à˜Š}ˆ}à'� Ø�8˜E E™MÐ+>À ÑKÔKˆDÝ(Ø�4˜˜z¨>¸6ñCôC‰GˆAˆtð �‰IˆAˆAðˆAØ ×'Ò'Ñ)Ô)¨D°)¸a±-Ñ,@Ñ@ˆHå˜=Ñ)Ô)ð 8ð 8�Ø!˜ %¨1¨$¡,Ð0CÀZÑPÔP�Ø�^ fÑ,¨xÑ7Ñ7��àð DؘS’=�=à˜¨.Ñ8¸6ÑAÑA�A�Aà˜¨.Ñ8¸8ÑCÑC�Aå˜>¨1¨bÑ1Ô1ð 8ð 8�Ø!˜ %¨A¨2¨%¡-Ð1DØ",ñ.ô.�à�^ fÑ,¨xÑ7Ñ7��à�X˜e e™mÐ-@À*ÑMÔMˆFØ � &Ñ(Ñ (ˆAð �!•C˜Ñ'Ô'Ð(Ð(Ô)Ñ )¨CÑ /ˆØˆrDr>)rfrrNr>) r�rírrîrêr#rìr:r$s `` ````@rBréré sƒøøøøøøø€ð`ð`ð`ð`ð`ð`ð`ð`ð`ð`ð`ðD àˆx˜bØ'7Ø#-ð/ñ/ô/ðˆˆø�4ˆˆˆˆˆs” $¤(có^—|€dS|dkr"td |¦«¦«‚|S)Nr r z{} must be >= 0)rYrK)r‹Únames rBÚ_none_or_positive_argr'‚s7€Ø€y؈r؈1‚u€uÝÐ*×1Ò1°$Ñ7Ô7Ñ8Ô8Ð8Ø €HrDcó,—eZdZdZdddœd„Zd„Zd„ZdS) r›z' Formatter for subtypes of np.floating FNrlcóT—t|t¦«r|rdnd}||_|jdkr|jdkr|dkrd}||_|dkrd|_n||_t |jd¦«|_||_||_d|_ d|_ |  |¦«dS) NrNr/rQr>rOrFr3F) r_rXÚ_legacyr~r2r3r'rór8Ú exp_formatÚlarge_exponentÚ fillFormat)rÜr”r3r2rór8r:s rBÚ__init__zFloatingFormat.__init__‹s½€õ �d�DÑ !Ô !ð (ØÐ'�3�3 CˆDàˆŒ Ø Œ<˜3Ò Ð àŒz˜RÒРD¨C¢K KØ�à"ˆŒØ ˜Ò Ð Ø!ˆDŒNˆNà&ˆDŒNå.¨t¬~¸{ÑKÔKˆŒà,ˆÔ؈Œ ؈ŒØ#ˆÔà �Š˜ÑÔÐÐÐrDc󞇇‡—|t|¦«}t||dk¦«}t|¦«dkrstj|¦«}tj|¦«}t d¬¦«5|dks‰js|dks ||z dkrd‰_ddd¦«n #1swxYwYt|¦«dkr,d‰_ d‰_ d‰_ d ‰_ d‰_ d‰_�nê‰jrÿd \ŠŠ‰jd ks ‰jd krd \ŠŠˆˆˆfd„|D¦«}t#d„|D¦«Ž\}}} t#d„|D¦«Ž\} } t d„| D¦«¦«dz ‰_ d‰_ t d„| D¦«¦«‰_‰j‰_‰‰_ ‰jd krd‰_ nt d„| D¦«¦«‰_ ‰j dz‰jz‰_ näd \ŠŠ‰jd krd \ŠŠˆˆˆfd„|D¦«}t#d„|D¦«Ž\} } ‰jd kr"dt d„| D¦«¦«z‰_ nt d„| D¦«¦«‰_ t d„| D¦«¦«‰_ d ‰_ ‰‰_ ‰jdvr‰j x‰_‰_d‰_ nd‰_ d‰_‰jd kr<‰jdkr1t)tj|¦«¦«s‰xj dz c_ |j|jkr•‰jdkp%t)|t/|¦«dk¦«} tt0d ¦«} tt0d!¦«| z}‰j dz}t ‰j | |z ||z ¦«‰_ dSdS)"Nr Úignore)Úoverg„×—Ag-Cëâ6?g@�@Tú.r )r2TrErQ)r@Fc 3ó\•K—|]&}t|‰j‰‰‰jdk¬¦«V—Œ'dS)rN)r3rFÚtrimr8N)rr3r8©r?r‹rÜr4rFs €€€rBrMz,FloatingFormat.fillFormat..Às]øèè€ð*ð*àõ' q°D´NØ&,°4¸d¼iÈ3Ò>NðPñPôPð*ð*ð*ð*ð*ð*rDc3ó@K—|]}| d¦«V—ŒdS)riN)Ú partition©r?rs rBrMz,FloatingFormat.fillFormat..Ãs.èè€Ð*JÐ*JÀ¨1¯;ª;°sÑ+;Ô+;Ð*JÐ*JÐ*JÐ*JÐ*JÐ*JrDc3ó@K—|]}| d¦«V—ŒdS©r2N©Úsplitr8s rBrMz,FloatingFormat.fillFormat..Äs,èè€Ð'HÐ'H¸¨¯ª°© ¬ Ð'HÐ'HÐ'HÐ'HÐ'HÐ'HrDc3ó4K—|]}t|¦«V—ŒdSr=rr8s rBrMz,FloatingFormat.fillFormat..Ås(èè€Ð9Ð9¨1¥ A¡¤Ð9Ð9Ð9Ð9Ð9Ð9rDrr@c3ó4K—|]}t|¦«V—ŒdSr=rr8s rBrMz,FloatingFormat.fillFormat..Èó(èè€Ð ;Ð ;¨A¥ Q¡¤Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;rDr)c3ó4K—|]}t|¦«V—ŒdSr=rr8s rBrMz,FloatingFormat.fillFormat..Ñó(èè€Ð#=Ð#=¨q¥C¨¡F¤FÐ#=Ð#=Ð#=Ð#=Ð#=Ð#=rDrzc 3ó^•K—|]'}t|‰jd‰‰‰jdk¬¦«V—Œ(dS)TrN)r3Ú fractionalrFr4r8N)rr3r8r5s €€€rBrMz,FloatingFormat.fillFormat..Øs`øèè€ð*ð*ðõ ' q°D´NØ26Ø.4¸4Ø,0¬I¸Ò,<ð>ñ>ô>ð*ð*ð*ð*ð*ð*rDc3ó@K—|]}| d¦«V—ŒdSr:r;r8s rBrMz,FloatingFormat.fillFormat..Ýs,èè€Ð'CÐ'C¸¨¯ª°© ¬ Ð'CÐ'CÐ'CÐ'CÐ'CÐ'CrDc3óZK—|]&}t| d¦«¦«V—Œ'dS)z-+N)r|Úlstripr8s rBrMz,FloatingFormat.fillFormat..ßs4èè€Ð'NÐ'NÀ­¨A¯HªH°T©N¬NÑ(;Ô(;Ð'NÐ'NÐ'NÐ'NÐ'NÐ'NrDc3ó4K—|]}t|¦«V—ŒdSr=rr8s rBrMz,FloatingFormat.fillFormat..árArDc3ó4K—|]}t|¦«V—ŒdSr=rr8s rBrMz,FloatingFormat.fillFormat..âr?rD)rErGrOr/r6r7)rrr|rcr Úminrrór+Úpad_leftÚ pad_rightr4Úexp_sizerFÚ min_digitsr2r*Úzipr3r8rÚsignbitrèrrn)rÜr”Ú finite_valsÚ abs_non_zeroÚmax_valÚmin_valÚstrsÚ frac_strsÚ_Úexp_strsÚint_partÚ frac_partÚneginfÚnanlenÚinflenÚoffsetr4rFs` @@rBr-zFloatingFormat.fillFormat¦s‚øøø€à�8 D™>œ>Ô*ˆ õ   ¨K¸1Ò,<Ô =Ñ>Ô>ˆ Ý ˆ|Ñ Ô  Ò !Ð !Ý”f˜\Ñ*Ô*ˆGÝ”f˜\Ñ*Ô*ˆGݘxÐ(Ñ(Ô(ð +ð +ؘd’?�?¨4Ô+>�?Ø  6Ò)Ð)¨W°W©_¸uÒ-DÐ-DØ&*�D”Oð +ð +ð +ñ +ô +ð +ð +ð +ð +ð +ð +øøøð +ð +ð +ð +õ ˆ{Ñ Ô ˜qÒ Ð ØˆDŒM؈DŒN؈DŒI؈DŒM؈DŒKØ"ˆDŒO‰OØ Œ_ð/ $Ø$‰LˆD�&ØŒ~ Ò(Ð(¨D¬L¸CÒ,?Ð,?Ø)‘ ��fð*ð*ð*ð*ð*ð*à(ð*ñ*ô*ˆDõ&)Ð*JÐ*JÀTÐ*JÑ*JÔ*JÐ%KÑ "ˆI�q˜(Ý"%Ð'HÐ'H¸iÐ'HÑ'HÔ'HÐ"IÑ ˆH�iÝÐ9Ð9°Ð9Ñ9Ô9Ñ9Ô9¸AÑ=ˆDŒMàˆDŒIÝ Ð ;Ð ;°Ð ;Ñ ;Ô ;Ñ;Ô;ˆDŒNØ"œnˆDŒOØ ˆDŒKðŒ|˜sÒ"Ð"Ø !�” � õ!$Ð#=Ð#=°HÐ#=Ñ#=Ô#=Ñ =Ô =�” à!œ]¨QÑ.°´Ñ?ˆDŒNˆNà$‰LˆD�&ØŒ~ Ò(Ð(Ø)‘ ��fð*ð*ð*ð*ð*ð*ð)ð *ñ*ô*ˆDõ #&Ð'CÐ'C¸dÐ'CÑ'CÔ'CÐ"DÑ ˆH�iØŒ|˜sÒ"Ð"Ø !¥CÐ'NÐ'NÀXÐ'NÑ'NÔ'NÑ$NÔ$NÑ N�” � å #Ð#=Ð#=°HÐ#=Ñ#=Ô#=Ñ =Ô =�” Ý Ð ;Ð ;°Ð ;Ñ ;Ô ;Ñ;Ô;ˆDŒN؈DŒMØ ˆDŒKàŒ~Ð!;Ð;Ð;Ø37´>ÐA�” ¤Ø�” � à�” Ø"#�”à Œ<˜#Ò Ð àŒy˜CÒЭ­B¬J°{Ñ,CÔ,CÑ(DÔ(DÐØ� ”  Ñ"� ” ð Œ9˜ Ô(Ò (Ð (Ø”Y #Ò%ÐC­¨Tµ%¸±+´+Ô->ÀÒ-BÑ)CÔ)CˆFÝ�¨Ô2Ñ3Ô3ˆFÝ�¨Ô2Ñ3Ô3°fÑ<ˆFØ”^ aÑ'ˆFÝ ¤ ¨v¸©ÀÈÁÑPÔPˆDŒMˆMˆMð )Ð (sÁ=$B-Â-B1Â4B1c óˆ—tj|¦«s«td¬¦«5tj|¦«r |jdkrdnd}|t dz}n'|dkrdn|jdkrdnd}|t dz}d |j|jzd zt|¦«z z|zcddd¦«S#1swxYwY|j r>t||j |j |j |j|jdk|j|j¬ ¦«St!||j |j |j d |j|jdk|j|j¬ ¦ « S)Nr0)ÚinvalidrNrær6r r/r7rOr)r3rMrFr4r8rJÚ exp_digitsT)r3rMrFrCr4r8rJrK)rcrrrdr8rnrJrKr|r+rr3rMrFr4rLr)rÜr‹r8Úrets rBÚ__call__zFloatingFormat.__call__ús¸€ÝŒ{˜1‰~Œ~ð QÝ (Ð+Ñ+Ô+ð Qð QÝ”8˜A‘;”;ð;Ø"&¤)¨sÒ"2Ð"2˜3˜3¸�DØ¥°Ô!:Ñ:�C�Cà"# a¢% %˜3˜3°D´IÀÒ4DÐ4D¨S¨SÈ"�DØ¥°Ô!:Ñ:�CؘDœM¨D¬NÑ:¸QÑ>ÅÀSÁÄÑIÑJÈSÑPð Qð Qð Qð Qñ Qô Qð Qð Qð Qð Qð Qð Qøøøð Qð Qð Qð Qð Œ?ð @Ý% aØ04´Ø15´Ø-1¬[Ø+/¬9Ø+/¬9¸Ò+;Ø/3¬}Ø15´ð@ñ@ô@ð @õ& aØ04´Ø15´Ø-1¬[Ø15Ø+/¬9Ø+/¬9¸Ò+;Ø/3¬}Ø04´ð@ñ@ô@ð @s¥BB5Â5B9Â<B9©F)Ú__name__Ú __module__Ú __qualname__Ú__doc__r.r-rbr>rDrBr›r›‰se€€€€€Ø1Ð1ðØðððððð6RQðRQðRQðh@ð@ð@ð@ð@rDr›Tr@c óò—t|d¦«}t|d¦«}t|d¦«}t|d¦«}|dkr|dkr||krtd¦«‚t||||||||¬¦«S)aä Format a floating-point scalar as a decimal string in scientific notation. Provides control over rounding, trimming and padding. Uses and assumes IEEE unbiased rounding. Uses the "Dragon4" algorithm. Parameters ---------- x : python float or numpy floating scalar Value to format. precision : non-negative integer or None, optional Maximum number of digits to print. May be None if `unique` is `True`, but must be an integer if unique is `False`. unique : boolean, optional If `True`, use a digit-generation strategy which gives the shortest representation which uniquely identifies the floating-point number from other values of the same type, by judicious rounding. If `precision` is given fewer digits than necessary can be printed. If `min_digits` is given more can be printed, in which cases the last digit is rounded with unbiased rounding. If `False`, digits are generated as if printing an infinite-precision value and stopping after `precision` digits, rounding the remaining value with unbiased rounding trim : one of 'k', '.', '0', '-', optional Controls post-processing trimming of trailing digits, as follows: * 'k' : keep trailing zeros, keep decimal point (no trimming) * '.' : trim all trailing zeros, leave decimal point * '0' : trim all but the zero before the decimal point. Insert the zero if it is missing. * '-' : trim trailing zeros and any trailing decimal point sign : boolean, optional Whether to show the sign for positive values. pad_left : non-negative integer, optional Pad the left side of the string with whitespace until at least that many characters are to the left of the decimal point. exp_digits : non-negative integer, optional Pad the exponent with zeros until it contains at least this many digits. If omitted, the exponent will be at least 2 digits. min_digits : non-negative integer or None, optional Minimum number of digits to print. This only has an effect for `unique=True`. In that case more digits than necessary to uniquely identify the value may be printed and rounded unbiased. -- versionadded:: 1.21.0 Returns ------- rep : string The string representation of the floating point value See Also -------- format_float_positional Examples -------- >>> np.format_float_scientific(np.float32(np.pi)) '3.1415927e+00' >>> s = np.float32(1.23e24) >>> np.format_float_scientific(s, unique=False, precision=15) '1.230000071797338e+24' >>> np.format_float_scientific(s, exp_digits=4) '1.23e+0024' r3rJr`rMr ú2min_digits must be less than or equal to precision)r3rFr4r8rJr`rM)r'rYr)r‹r3rFr4r8rJr`rMs rBr r s˜€õJ& i°Ñ=Ô=€IÝ$ X¨zÑ:Ô:€HÝ& z°<Ñ@Ô@€JÝ& z°<Ñ@Ô@€JØ�A‚~€~˜) aš-˜-¨J¸Ò,BÐ,BÝÐMÑNÔNÐNÝ ˜a¨9¸VØ#'¨d¸XØ)3À ð Lñ Lô LðLrDc ó"—t|d¦«}t|d¦«}t|d¦«}t|d¦«}|s|dkrtd¦«‚|dkr|dkr||krtd¦«‚t|||||||||¬¦ « S) aŠ Format a floating-point scalar as a decimal string in positional notation. Provides control over rounding, trimming and padding. Uses and assumes IEEE unbiased rounding. Uses the "Dragon4" algorithm. Parameters ---------- x : python float or numpy floating scalar Value to format. precision : non-negative integer or None, optional Maximum number of digits to print. May be None if `unique` is `True`, but must be an integer if unique is `False`. unique : boolean, optional If `True`, use a digit-generation strategy which gives the shortest representation which uniquely identifies the floating-point number from other values of the same type, by judicious rounding. If `precision` is given fewer digits than necessary can be printed, or if `min_digits` is given more can be printed, in which cases the last digit is rounded with unbiased rounding. If `False`, digits are generated as if printing an infinite-precision value and stopping after `precision` digits, rounding the remaining value with unbiased rounding fractional : boolean, optional If `True`, the cutoffs of `precision` and `min_digits` refer to the total number of digits after the decimal point, including leading zeros. If `False`, `precision` and `min_digits` refer to the total number of significant digits, before or after the decimal point, ignoring leading zeros. trim : one of 'k', '.', '0', '-', optional Controls post-processing trimming of trailing digits, as follows: * 'k' : keep trailing zeros, keep decimal point (no trimming) * '.' : trim all trailing zeros, leave decimal point * '0' : trim all but the zero before the decimal point. Insert the zero if it is missing. * '-' : trim trailing zeros and any trailing decimal point sign : boolean, optional Whether to show the sign for positive values. pad_left : non-negative integer, optional Pad the left side of the string with whitespace until at least that many characters are to the left of the decimal point. pad_right : non-negative integer, optional Pad the right side of the string with whitespace until at least that many characters are to the right of the decimal point. min_digits : non-negative integer or None, optional Minimum number of digits to print. Only has an effect if `unique=True` in which case additional digits past those necessary to uniquely identify the value may be printed, rounding the last additional digit. -- versionadded:: 1.21.0 Returns ------- rep : string The string representation of the floating point value See Also -------- format_float_scientific Examples -------- >>> np.format_float_positional(np.float32(np.pi)) '3.1415927' >>> np.format_float_positional(np.float16(np.pi)) '3.14' >>> np.format_float_positional(np.float16(0.3)) '0.3' >>> np.format_float_positional(np.float16(0.3), unique=False, precision=10) '0.3000488281' r3rJrKrMr z4precision must be greater than 0 if fractional=Falseri)r3rFrCr4r8rJrKrM)r'rYr) r‹r3rFrCr4r8rJrKrMs rBr r js€õZ& i°Ñ=Ô=€IÝ$ X¨zÑ:Ô:€HÝ% i°Ñ=Ô=€IÝ& z°<Ñ@Ô@€JØ ð-˜) qš.˜.Ýð,ñ-ô-ð -à�A‚~€~˜) aš-˜-¨J¸Ò,BÐ,BÝÐMÑNÔNÐNÝ ˜a¨9¸VØ)3¸$Ø#'°(Ø(1¸jð Jñ Jô JðJrDcó—eZdZd„Zd„ZdS)r—c ó&—|jdkritttt j|¦«¦«¦«ttt j|¦«¦«¦«¦«}nd}d |¦«|_dS)Nr z%{}d)rèr r|rŽrcrIrK)rÜr”Ú max_str_lens rBr.zIntegerFormat.__init__Çsq€Ø Œ9�qŠ=ˆ=Ý�c¥#¥b¤f¨T¡l¤lÑ"3Ô"3Ñ4Ô4Ý!¥#¥b¤f¨T¡l¤lÑ"3Ô"3Ñ4Ô4ñ6ô6ˆKˆKðˆKØ—m’m KÑ0Ô0ˆŒ ˆ ˆ rDcó—|j|zSr=rJ©rÜr‹s rBrbzIntegerFormat.__call__Ïs€ØŒ{˜Q‰ÐrDN©rdrerfr.rbr>rDrBr—r—Æs2€€€€€ð1ð1ð1ðððððrDr—có—eZdZd„Zd„ZdS)r’c ó.—|jdkrdnd|_dS)Nr>z TrueÚTrue)r~Útruestr)rÜr”rxs rBr.zBoolFormat.__init__Ôs€ð#'¤*°Ò"2Ð"2�w�w¸ˆŒ ˆ ˆ rDcó—|r|jndS)NÚFalse)rtros rBrbzBoolFormat.__call__Ùs€Ø Ð-ˆtŒ|ˆ| gÐ-rDNrpr>rDrBr’r’Ós2€€€€€ð?ð?ð?ð .ð.ð.ð.ð.rDr’có(—eZdZdZ dddœd„Zd„ZdS)r z. Formatter for subtypes of np.complexfloating FNrlcóÔ—t|t¦«r|rdnd}|x}}|dkrd}d}t|j|||||¬¦«|_t|j|||d|¬¦«|_dS)NrNr/rQrGr*)r8r:)r_rXr›ÚrealÚ real_formatÚimagÚ imag_format) rÜr‹r3r2rór8r:Úfloatmode_realÚfloatmode_imags rBr.zComplexFloatingFormat.__init__ßs—€õ �d�DÑ !Ô !ð (ØÐ'�3�3 CˆDà*3Ð3ˆ˜Ø �SŠ=ˆ=Ø,ˆNØ&ˆNå)Ø ŒF�I˜~¨~ؘfð ñ ô ˆÔõ*Ø ŒF�I˜~¨~ؘVð ñ ô ˆÔÐÐrDcóæ—| |j¦«}| |j¦«}t | ¦«¦«}|d|…dz||d…z}||zS)NÚj)rzryr|r{r|rÿ)rÜr‹Úrr Úsps rBrbzComplexFloatingFormat.__call__ósh€Ø × Ò ˜QœVÑ $Ô $ˆØ × Ò ˜QœVÑ $Ô $ˆõ�—’‘”‰_Œ_ˆØ ˆcˆrˆcŒF�S‰L˜1˜R˜S˜Sœ6Ñ !ˆà�1‰uˆ rDrc)rdrerfrgr.rbr>rDrBr r ÝsM€€€€€Ø8Ð8àð Ø'+ð ð ð ð ð ð(ððððrDr có —eZdZd„Zd„Zd„ZdS)Ú_TimelikeFormatc óþ—|t|¦«}t|¦«dkrutt| t j|¦«¦«¦«t| t j|¦«¦«¦«¦«}nd}t|¦«|jkrt|d¦«}d |¦«|_d  |¦«|_ dS)Nr éz%{}sz'NaT') rr|r Ú_format_non_natrcrIrèrKÚ_formatÚrjustÚ_nat)rÜr”Únon_natrms rBr.z_TimelikeFormat.__init__ÿsÌ€Ø�˜d™ œ �|Ô$ˆÝ ˆw‰<Œ<˜!Ò Ð å�c $×"6Ò"6µr´v¸g±´Ñ"GÔ"GÑHÔHÝ! $×"6Ò"6µr´v¸g±´Ñ"GÔ"GÑHÔHñJôJˆKˆKðˆKÝ ˆw‰<Œ<˜$œ)Ò #Ð #å˜k¨1Ñ-Ô-ˆKØ—}’} [Ñ1Ô1ˆŒ Ø—M’M +Ñ.Ô.ˆŒ ˆ ˆ rDcó—t‚r=)ÚNotImplementedErrorros rBr‡z_TimelikeFormat._format_non_nat s€å!Ð!rDcóh—t|¦«r|jS|j| |¦«zSr=)rrŠrˆr‡ros rBrbz_TimelikeFormat.__call__s3€Ý �‰8Œ8ð :Ø”9Ð à”< $×"6Ò"6°qÑ"9Ô"9Ñ9Ð 9rDN)rdrerfr.r‡rbr>rDrBr„r„þsA€€€€€ð /ð /ð /ð"ð"ð"ð:ð:ð:ð:ð:rDr„có4‡—eZdZ dˆfd„ Zˆfd„Zd„ZˆxZS)r£NÚ same_kindFcóè•—|€-|jjdkrt|j¦«d}nd}|€d}||_||_||_||_t¦« |¦«dS)NÚMr rÚnaive) rÃÚkindrÚtimezoneÚunitÚcastingr:Úsuperr.)rÜr‹r–r•r—r:Ú __class__s €rBr.zDatetimeFormat.__init__s{ø€ð ˆ<ØŒwŒ|˜sÒ"Ð"Ý$ Q¤WÑ-Ô-¨aÔ0��à�à Р؈HØ ˆŒ ؈Œ ؈Œ ؈Œ õ ‰Œ×Ò˜ÑÔÐÐÐrDc󆕗|jdkr| |¦«St¦« |¦«S)NrQ)r:r‡r˜rb)rÜr‹r™s €rBrbzDatetimeFormat.__call__,s<ø€Ø Œ;˜#Ò Ð Ø×'Ò'¨Ñ*Ô*Ð *݉wŒw×Ò Ñ"Ô"Ð"rDcóL—dt||j|j|j¬¦«zS)Nú'%s')r–r•r—)rr–r•r—ros rBr‡zDatetimeFormat._format_non_nat1s2€ØÕ*¨1Ø)-¬Ø-1¬]Ø,0¬Lð:ñ:ô:ñ:ð :rD)NNr�F)rdrerfr.rbr‡Ú __classcell__)r™s@rBr£r£skø€€€€€Ø”>Ñ"Ô"Ð"rDN)rdrerfr‡r>rDrBr¥r¥8s#€€€€€ð#ð#ð#ð#ð#rDr¥có —eZdZd„Zd„Zd„ZdS)ÚSubArrayFormatc óH—||_|d|_|d|_dS)Nr1r0)rír1r#)rÜrírgs rBr.zSubArrayFormat.__init__>s&€Ø.ˆÔØ  Ô-ˆŒØ! +Ô.ˆŒˆˆrDcó^—|j|jkrdnd|_| |¦«S)NrÕræ)rèr1rìÚ format_array)rÜr�s rBrbzSubArrayFormat.__call__Cs0€Ø'(¤v°´Ò'>Ð'>˜e˜eÀBˆÔØ× Ò  Ñ#Ô#Ð#rDcót‡—tj|¦«dkr‰ |¦«S‰jr[|jdd‰jzkrBˆfd„|d‰j…D¦«‰jgzˆfd„|‰j d…D¦«z}nˆfd„|D¦«}dd |¦«zdzS) Nr rzcó:•—g|]}‰ |¦«‘ŒSr>©r¦©r?Úa_rÜs €rBr·z/SubArrayFormat.format_array..Ms'ø€ÐEÐEÐE¨2�×"Ò" 2Ñ&Ô&ÐEÐEÐErDcó:•—g|]}‰ |¦«‘ŒSr>r©rªs €rBr·z/SubArrayFormat.format_array..Os'ø€ÐHÐHÐH¨R�4×$Ò$ RÑ(Ô(ÐHÐHÐHrDcó:•—g|]}‰ |¦«‘ŒSr>r©rªs €rBr·z/SubArrayFormat.format_array..Rs'ø€Ð;Ð;Ð;°2˜×*Ò*¨2Ñ.Ô.Ð;Ð;Ð;rDrrHr)rcr}rírìr~r#rZ)rÜr�Ú formatteds` rBr¦zSubArrayFormat.format_arrayGsçø€Ý Œ7�1‰:Œ:˜Š?ˆ?Ø×'Ò'¨Ñ*Ô*Ð *à Ô ð < 1¤7¨1¤:°°$´/Ñ0AÒ#AÐ#AàEÐEÐEÐE°Ð3C°D´OÐ3CÔ1DÐEÑEÔEØÔ&Ð'ñ(àHÐHÐHÐH°1°d´oÐ5EÐ5FÐ5FÔ3GÐHÑHÔHñIð ˆIð <Ð;Ð;Ð;¸Ð;Ñ;Ô;ˆIà�T—Y’Y˜yÑ)Ô)Ñ)¨CÑ/Ð/rDN)rdrerfr.rbr¦r>rDrBr£r£=sA€€€€€ð/ð/ð/ð $ð$ð$ð 0ð 0ð 0ð 0ð 0rDr£có4—eZdZdZd„Zed„¦«Zd„ZdS)rÐzô Formatter for structured np.void objects. This does not work on structured alias types like np.dtype(('i4', 'i2,i2')), as alias scalars lose their field information, and the implementation relies upon np.void.__getitem__. có—||_dSr=)Úformat_functions)rÜr±s rBr.zStructuredVoidFormat.__init___s€Ø 0ˆÔÐÐrDc óЗg}|jjD]M}t||fi|¤Ž}|j|jdkr t |fi|¤Ž}| |¦«ŒN||¦«S)z¢ This is a second way to initialize StructuredVoidFormat, using the raw data as input. Added to avoid changing the signature of __init__. r>)rÃrÏrÔr~r£Úappend)Úclsr”rgr±Ú field_namerís rBrÑzStructuredVoidFormat.from_databsŠ€ð ÐØœ*Ô*ð 5ð 5ˆJÝ2°4¸ Ô3CÐOÐOÀwÐOÐOˆOØŒz˜*Ô%Ô+¨rÒ1Ð1Ý"0°Ð"LÐ"LÀGÐ"LÐ"L�Ø × #Ò # OÑ 4Ô 4Ð 4Ð 4؈sÐ#Ñ$Ô$Ð$rDcóì—d„t||j¦«D¦«}t|¦«dkrd |d¦«Sd d |¦«¦«S)Ncó*—g|]\}}||¦«‘ŒSr>r>)r?Úfieldrís rBr·z1StructuredVoidFormat.__call__..qs6€ð ð ð á&��ð ˆO˜EÑ "Ô "ð ð ð rDrz({},)r z({})rH)rNr±r|rKrZ)rÜr‹Ú str_fieldss rBrbzStructuredVoidFormat.__call__pst€ð ð å*-¨a°Ô1FÑ*GÔ*Gð ñ ô ˆ õ ˆz‰?Œ?˜aÒ Ð Ø—>’> *¨Q¤-Ñ0Ô0Ð 0à—=’= §¢¨:Ñ!6Ô!6Ñ7Ô7Ð 7rDN)rdrerfrgr.Ú classmethodrÑrbr>rDrBrÐrÐWsW€€€€€ððð1ð1ð1ðð %ð %ñ„[ð %ð8ð8ð8ð8ð8rDrÐcó\—tjt|¦«fit¤Ž|¦«S)z½ Implements the repr for structured-void scalars. It is called from the scalartypes.c.src code, and is placed here because it uses the elementwise formatters defined above. )rÐrÑrrnrŠs rBÚ_void_scalar_reprr¼{s/€ð GÕ Ô )­%°©(¬(Ð FÐ FµoÐ FÐ FÀqÑ IÔ IÐIrDcó°—tj|¦«}tddkr|jtkrdS|j�dS|jsdS|jtvS)a Determine if the given dtype is implied by the representation of its values. Parameters ---------- dtype : dtype Data type Returns ------- implied : bool True if the dtype is implied by the representation of its values. Examples -------- >>> np.core.arrayprint.dtype_is_implied(int) True >>> np.array([1, 2, 3], int) array([1, 2, 3]) >>> np.core.arrayprint.dtype_is_implied(np.int8) False >>> np.array([1, 2, 3], np.int8) array([1, 2, 3], dtype=int8) r:rQF)rcrÃrnrƒr%rÏÚisnativeÚ _typelessdata)rÃs rBÚdtype_is_impliedrÀ‡s_€õ2 ŒH�U‰OŒO€EÝ�xÔ  CÒ'Ð'¨E¬J½%Ò,?Ð,?؈uð „{ÐØˆuð Œ>ð؈uà Œ:�Ð &Ð&rDcó´—t|¦«jtjjkrt |¦«S|j�t |¦«St|jt¦«rdt |¦«zS|j }|j sdt |¦«zS|r=|d  ¦«r|  ¦«st |¦«}|S)zñ Convert a dtype to a short form which evaluates to the same dtype. The intent is roughly that the following holds >>> from numpy import * >>> dt = np.int64([1, 2]).dtype >>> assert eval(dtype_short_repr(dt)) == dt Nrœr ) rƒÚ__repr__rcrÃr‰rÏrŽrÄr&r&r¾ÚisalphaÚisalnum)rÃÚtypenames rBÚdtype_short_reprrƯsÈ€õ ˆE�{„{Ô�rœxÔ0Ò0Ð0å�E‰{Œ{ÐØ „{Ðå�5‰zŒzÐÝ �E”J¥Ñ )Ô )ð#à�˜E™ œ Ñ"Ð"àŒz€HØ Œ>ð#ð�˜E™ œ Ñ"Ð"àð"˜ !œ×,Ò,Ñ.Ô.ð"°8×3CÒ3CÑ3EÔ3Eð"ݘ‘>”>ˆØ €OrDc ó —|€ td}t|¦«turt|¦«j}nd}t |j¦«o |jdk}|dz}|rdnd}tdd kr9|jd kr.|jjs"t|  ¦«¦«} n@|jdks |jd kr|||||d ||¬ ¦«} ndt|j¦«›�} || z|z} |r| Sd  t|j¦«¦«} t| ¦«|  d¦«dzz } d} tdd kr8t|jjt ¦«rddt|dz¦«zz} n1| t| ¦«zdz|krddt|dz¦«zz} | | z| zS)zEInternal version of array_repr() that allows overriding array2string.Nr5rr ú(ú)ú,r:rQr>)r rH)rõz [], shape=z dtype={})rþrrO)rnrƒrrdrÀrÃrèr~rÏr‰rúrKrÆr|ÚrfindrÄr&)Úarrròr3rórÚ class_nameÚ skipdtyperërõrïÚarr_strÚ dtype_strÚ last_line_lenÚspacers rBÚ_array_repr_implementationrÓÏsè€ðÐÝ(¨Ô5ˆå ˆC�y„y�ÐÐݘ#‘Y”YÔ'ˆ ˆ àˆ å  ¤Ñ+Ô+Ð<°´¸1² €Ià ˜#Ñ €FØÐ &ˆSˆS 3€Få˜Ô! SÒ(Ð(Ø ŒI˜ŠOˆO C¤I¤OˆOÝ�3—8’8‘:”:ÑÔˆˆØ Œ�AŠˆ˜œ dÒ*Ð*؈l˜3 ° ¸>Ø °ð8ñ8ô8ˆˆð+õ!% S¤Y¡¤ Ð1ˆà�s‰l˜VÑ#€Gàð؈à×"Ò"Õ#3°C´IÑ#>Ô#>Ñ?Ô?€Iõ ˜‘L”L G§M¢M°$Ñ$7Ô$7¸!Ñ$;Ñ<€MØ €FÝ�xÔ  CÒ'Ð'Ý �c”i”n¥hÑ /Ô /ð 6ؘC¥ J°Ñ$4Ñ 5Ô 5Ñ5Ñ5ˆFøØ �˜Y™œÑ '¨!Ñ +¨nÒ <Ð <ؘ�C  ¨SÑ 0Ñ1Ô1Ñ1Ñ1ˆà �VÑ ˜iÑ 'Ð'rDcó—|fSr=r>©rÌròr3rós rBÚ_array_repr_dispatcherrÖþs €à ˆ6€MrDcó&—t||||¦«S)a  Return the string representation of an array. Parameters ---------- arr : ndarray Input array. max_line_width : int, optional Inserts newlines if text is longer than `max_line_width`. Defaults to ``numpy.get_printoptions()['linewidth']``. precision : int, optional Floating point precision. Defaults to ``numpy.get_printoptions()['precision']``. suppress_small : bool, optional Represent numbers "very close" to zero as zero; default is False. Very close is defined by precision: if the precision is 8, e.g., numbers smaller (in absolute value) than 5e-9 are represented as zero. Defaults to ``numpy.get_printoptions()['suppress']``. Returns ------- string : str The string representation of an array. See Also -------- array_str, array2string, set_printoptions Examples -------- >>> np.array_repr(np.array([1,2])) 'array([1, 2])' >>> np.array_repr(np.ma.array([0.])) 'MaskedArray([0.])' >>> np.array_repr(np.array([], np.int32)) 'array([], dtype=int32)' >>> x = np.array([1e-6, 4e-7, 2, 3]) >>> np.array_repr(x, precision=6, suppress_small=True) 'array([0.000001, 0. , 2. , 3. ])' )rÓrÕs rBrrs €õZ &Ø ˆ^˜Y¨ñ 8ô 8ð8rDcóh—t|t¦«rt|¦«St|¦«Sr=)r_Úbytesr‰rŽ)rAs rBÚ_guarded_repr_or_strrÚ4s*€å�!•UÑÔðÝ�A‰wŒwˆÝ ˆq‰6Œ6€MrDcó$—tddkr8|jdkr-|jjs!t | ¦«¦«S|jdkr-t tj  |d¦«¦«S|||||dd¦«S)zDInternal version of array_str() that allows overriding array2string.r:rQr>rOræ) rnr~rÃrÏrŽrúrÚrcrÚ __getitem__)r�ròr3rórs rBÚ_array_str_implementationrÝ;s„€õ ˜Ô! SÒ(Ð(Ø ŒG�rŠMˆM !¤'¤-ˆMÝ�1—6’6‘8”8‰}Œ}Ðð  „w�"‚}€}õ$¥B¤J×$:Ò$:¸1¸bÑ$AÔ$AÑBÔBÐBà ˆ<˜˜>¨9°nÀcÈ2Ñ NÔ NÐNrDcó—|fSr=r>©r�ròr3rós rBÚ_array_str_dispatcherràOs €à ˆ4€KrDcó&—t||||¦«S)aa Return a string representation of the data in an array. The data in the array is returned as a single string. This function is similar to `array_repr`, the difference being that `array_repr` also returns information on the kind of array and its data type. Parameters ---------- a : ndarray Input array. max_line_width : int, optional Inserts newlines if text is longer than `max_line_width`. Defaults to ``numpy.get_printoptions()['linewidth']``. precision : int, optional Floating point precision. Defaults to ``numpy.get_printoptions()['precision']``. suppress_small : bool, optional Represent numbers "very close" to zero as zero; default is False. Very close is defined by precision: if the precision is 8, e.g., numbers smaller (in absolute value) than 5e-9 are represented as zero. Defaults to ``numpy.get_printoptions()['suppress']``. See Also -------- array2string, array_repr, set_printoptions Examples -------- >>> np.array_str(np.arange(3)) '[0 1 2]' )rÝrßs rBrrTs €õH %Ø ˆ>˜9 nñ 6ô 6ð6rDÚ __wrapped__)rcóœ—|€6|rtjtd¦«Stjtd¦«Stj||¦«S)aù Set a Python function to be used when pretty printing arrays. Parameters ---------- f : function or None Function to be used to pretty print arrays. The function should expect a single array argument and return a string of the representation of the array. If None, the function is reset to the default NumPy function to print arrays. repr : bool, optional If True (default), the function for pretty printing (``__repr__``) is set, if False the function that returns the default string representation (``__str__``) is set. See Also -------- set_printoptions, get_printoptions Examples -------- >>> def pprint(arr): ... return 'HA! - What are you going to do now?' ... >>> np.set_string_function(pprint) >>> a = np.arange(10) >>> a HA! - What are you going to do now? >>> _ = a >>> # [0 1 2 3 4 5 6 7 8 9] We can reset the function to the default: >>> np.set_string_function(None) >>> a array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) `repr` affects either pretty printing or normal string representation. Note that ``__repr__`` is still affected by setting ``__str__`` because the width of each array element in the returned string becomes equal to the length of the result of ``__str__()``. >>> x = np.arange(4) >>> np.set_string_function(lambda x:'random', repr=False) >>> x.__str__() 'random' >>> x.__repr__() 'array([0, 1, 2, 3])' Nrr )rrÚ_default_array_reprÚ_default_array_str)rÝr‰s rBrr„sN€ðf €yØ ð IÝÔ1Õ2EÀqÑIÔIÐ IåÔ1Õ2DÀaÑHÔHÐ HåÔ-¨a°Ñ6Ô6Ð6rD) NNNNNNNNNNN) NNNNNNNNNN)r>)rÕ)rOræ) NNNNNNNNNNNN)NTr@FNNN)NTTr@FNNN)NNN)T)brgÚ__all__Ú __docformat__râr`r[Ú_threadr Ú ImportErrorÚ _dummy_threadrkrcrærrÅÚumathrrrrrrrrrrrrÚ fromnumericrÚnumericrrrr r!r"r#r$r%r&rür'r(rer]Ú contextlibr\rnrjrrruÚcontextmanagerrrr‡rŒr�rÁrÔrårðrörùrrrrér'r›r r r—r’r r„r£r¥r£rÐr¼r¿rÀrÆrÓrÖrrÚrÝràrÚgetattrÚ_array2string_implÚpartialrårärr>rDrBúrósJðððð  Að Að A€ð#€ ð ÐÐÐØ€€€Ø € € € ð(Ø!Ð!Ð!Ð!Ð!Ð!Ð!øØð(ð(ð(Ø'Ð'Ð'Ð'Ð'Ð'Ð'Ð'ð(øøøðÐÐÐØ!Ð!Ð!Ð!Ð!Ð!Ø3Ð3Ð3Ð3Ð3Ð3Ð3Ð3Ð3Ð3Ð3Ð3ØÐÐÐÐÐð0ð0ð0ð0ð0ð0ð0ð0ð0ð0ð0ð0ð0ð0ð0ð0ð0ð0ðÐÐÐÐÐØ3Ð3Ð3Ð3Ð3Ð3Ð3Ð3Ð3Ð3ð%ð%ð%ð%ð%ð%ð%ð%ð%ð%ð%ð%ð%ð%ð%ð%ð%ð%à:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ø€€€Ø€€€ØÐÐÐðØØØØØØØØ ØðŒkð ð €ðBFØJNØIMð1ð1ð1ð1ðh €ˆGÑÔØ?CØHLØ:>ðo!àJNðo!ðo!ðo!ðo!ñÔðo!ðd €ˆGÑÔððñÔððB%ð%ð%ð  €ˆGÑÔØ Ôð$ð$ñÔñÔð$ðBHðHðHðHð(ððððððððð/ð/ð/ðb&(ð&(ð&(ðRðððð<ÐÑÔðððñÔðð:+/Ø48Ø.2Ø:>ð ð ð ðððððÐÐ1¸'ÐBÑBÔBØ#'°4Ø $°¸BØ”{¨d¸dØ d°dÀ2ðn8ð ð n8ðn8ðn8ðn8ñCÔBðn8ðb ð ð ðððð6tðtðtðl ð ð ðN@ðN@ðN@ðN@ðN@ñN@ôN@ðN@ðb €ˆGÑÔØADØBFØ'+ðLLðLLðLLñÔðLLð^ €ˆGÑÔØ6:Ø