zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
U
­ý°d…-ã@s–ddlmZmZddlmZddlZddlZddlmZm    Z    m
Z
m Z m Z m Z mZmZmZmZmZddlmZddlmmmZGdd„dƒZdS)é)ÚdatetimeÚ    timedelta)ÚStringION) ÚNAÚ CategoricalÚ    DataFrameÚ
MultiIndexÚNaTÚ PeriodIndexÚSeriesÚ    TimestampÚ
date_rangeÚoption_contextÚ period_rangec@s<eZdZdd„Zdd„Zdd„Zdd„Zd    d
„Zd d „Zd d„Z    dd„Z
dd„Z dd„Z dd„Z ejjdd„ƒZdd„Zdd„Zejjdd„ƒZdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zej d1ej ej!g¡ej d2e"d3ge#d4gg¡d5d6„ƒƒZ$d7d8„Z%d9d:„Z&d;d<„Z'd=d>„Z(d?d@„Z)dAS)BÚTestDataFrameReprInfoEtccsˆtdƒ‰d‰d}‡‡fdd„t|ƒDƒ}t|ƒ d¡}|jtk ¡sHt‚t|ƒt|j    dd…dd…fƒt|j    dd…dd…fƒdS)    NZACDEFGHIJKLMNOPé2éècs"g|]}‡fdd„tˆƒDƒ‘qS)csg|]}tj ˆ¡‘qS©)ÚnpÚrandomÚchoice)Ú.0Úx)ÚletsrúXd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/frame/test_repr_info.pyÚ
<listcomp>"szPTestDataFrameReprInfoEtc.test_repr_bytes_61_lines.<locals>.<listcomp>.<listcomp>)Úrange)rÚ_©rÚslenrrr"szETestDataFrameReprInfoEtc.test_repr_bytes_61_lines.<locals>.<listcomp>ZU1é<é=)
ÚlistrrZastypeZdtypesÚobjectÚallÚAssertionErrorÚreprÚiloc)ÚselfZnseqsÚwordsÚdfrrrÚtest_repr_bytes_61_linessz1TestDataFrameReprInfoEtc.test_repr_bytes_61_linescCsDtjddgddgd}ttj dd¡|d}t ||¡}t|ƒdS)    N)rr)ér,uΔÚi1©Únameséé©Úindex)    rÚ from_tuplesrrrÚrandnÚtmÚget_objr&)r(Zframe_or_seriesr3ÚobjrrrÚtest_repr_unicode_level_names+s z6TestDataFrameReprInfoEtc.test_repr_unicode_level_namescCsjtdddgdddgddd    gd
œƒ d d g¡}t|jƒ}d |d<||_t|ƒddg|d<||_t|ƒdS)Nr,r0ér1ééééé    )ÚaÚbÚcr@rA)ÚfazÚboorrCrD)rÚ    set_indexr"r3r&)r(r*r3rrrÚtest_assign_index_sequences2s"ÿ
 z4TestDataFrameReprInfoEtc.test_assign_index_sequencescCs@tdddgittdƒgddggd}t|ƒ}d}||ks<t‚dS)    NÚXr,r0Z20130101r@rAr2z/              X
NaT        a  1
2013-01-01 b  2)rr    r r&r%©r(r*ÚresultÚexpectedrrrÚtest_repr_with_mi_natAs$z.TestDataFrameReprInfoEtc.test_repr_with_mi_natcCs8tddddgddtjtgƒ}t|ƒ}d}||ks4t‚dS)Nr,r0r:r1Tz'      0
True  1
None  2
NaN   3
NaT   4)rrÚnanr    r&r%rHrrrÚtest_repr_with_different_nullsGsz7TestDataFrameReprInfoEtc.test_repr_with_different_nullsc    CsLtjddgdddgtddgddd    gi}t|d
}t|ƒ}d }||ksHt‚dS) Nr,r0r:r1r<r=Tr>r?)ÚdatazG   NaN  None  NaT  True
0    1     3    6     8
1    2     4    7     9)rrLr    rr&r%)r(Údr*rIrJrrrÚ#test_repr_with_different_nulls_colsRs
&
z<TestDataFrameReprInfoEtc.test_repr_with_different_nulls_colscCsPtddidtjidtjidtjiddidtjidœƒ}| ddg¡}t|ƒdS)N)ÚAÚA0006000ZnuitrRrQ)ÚAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBÚCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCZDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDZEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEZFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFrSrT)rrrLrEr&)r(Zdf3ZidfrrrÚtest_multiindex_na_repr\súÿ z0TestDataFrameReprInfoEtc.test_multiindex_na_reprcCsPtjddgdddgd}tddd    gi|d
}t|ƒ d ¡}|d  d ¡sLt‚dS)N)r@rÚfoo)rAr,Úbarr@rArBr.Úvaluerr,r2Ú
r0za 0 foo)rr4rr&ÚsplitÚ
startswithr%)r(r3r*ÚlinesrrrÚtest_repr_name_coincidelsÿz0TestDataFrameReprInfoEtc.test_repr_name_coincidecCsj|}|}t|ƒt|ƒt|jƒt|jƒtƒ}|j|d|j|d|jj|d|jj|ddS)N©Úbuf)r&ÚTrÚ    to_string)r(Z/multiindex_year_month_day_dataframe_random_dataZ multiindex_dataframe_random_dataZymdÚframer_rrrÚtest_repr_to_stringvs
 
  z,TestDataFrameReprInfoEtc.test_repr_to_stringcCs&ttƒƒtt d¡d}t|ƒdS)Nrr2)r&rrÚarange)r(rbrrrÚtest_repr_empty‰s
z(TestDataFrameReprInfoEtc.test_repr_emptycCs tƒ}t|ƒ|jd|ddS)NF©Úverboser_)rr&Úinfo)r(Zfloat_string_framer_rrrÚtest_repr_mixed‘sz(TestDataFrameReprInfoEtc.test_repr_mixedcCsXttj d¡t d¡dœtdƒd}tj|jdd…df<tj|jdd…df<t    |ƒdS)NéÈ)rQÚBr2érQrk)
rrrr5r6ZmakeStringIndexrrLÚlocr&©r(ZbiggierrrÚtest_repr_mixed_big˜sÿz,TestDataFrameReprInfoEtc.test_repr_mixed_bigcCs¼tƒ}t|ƒ|jd|d|jdgdjd|d|jddgdjd|dtdddgd}t|ƒtƒj|d    td
gd gd gd }dt|ƒks˜t‚dt|ƒks¨t‚dt|ƒks¸t‚dS)NFrfrQ©Úcolumnsrkrr,r:r^za
    bza
    dza
    f©rqr3ú    ú za
)rr&rhZreindexrr%)r(Ú float_framer_Úno_indexr*rrrÚ    test_repr£sz"TestDataFrameReprInfoEtc.test_reprc    CsŠtddgddggƒ}tddƒdt|ƒks0t‚W5QRXtddƒdt|ƒksVt‚W5QRXtdd    ƒdt|ƒks|t‚W5QRXdS)
Nr,r0r:r1zdisplay.show_dimensionsTz2 rows x 2 columnsFÚtruncate©rrr&r%©r(r*rrrÚtest_repr_dimensions¼s   z-TestDataFrameReprInfoEtc.test_repr_dimensionscCs(tt d¡tdƒtdƒd}t|ƒdS)N)rjr1r1rjrr)rrÚzerosrr&rnrrrÚ test_repr_bigÇsz&TestDataFrameReprInfoEtc.test_repr_bigc
Cs¢tddgdt ¡dgdddgdt ¡tdƒdgdit d¡d}t|ƒt dd¡t|ƒt dd    d
d ¡t|ƒt dd d
d ¡t|ƒt     
¡dS) NrVr,rrWr2zdisplay.precisionr:zdisplay.max_rowsé
údisplay.max_columnsr0r) rrÚtodayrrrdr&ÚfmtZ
set_optionr6Zreset_display_options)r(ruZ
unsortablerrrÚtest_repr_unsortableÍs(üù     z-TestDataFrameReprInfoEtc.test_repr_unsortablecCspd}td||giƒ}t|ƒ}d}| d¡d ¡|ks:t‚td||giƒ}t|ƒ}| d¡d ¡|kslt‚dS)NuσσσσrQz      ArYr)rr&rZÚrstripr%)r(Zuvalr*rIZex_toprrrÚtest_repr_unicodeæsz*TestDataFrameReprInfoEtc.test_repr_unicodecCstddgiƒ}t|ƒdS)NrQõא)rÚstrrzrrrÚ test_unicode_string_with_unicodeósz9TestDataFrameReprInfoEtc.test_unicode_string_with_unicodecCs0tdddgdddgddd    gd
œƒ}t|jƒdS) Nr,r0r:r1r;r<r=r>r?)r…uבrB)rr&rqrzrrrÚtest_repr_unicode_columns÷s"z2TestDataFrameReprInfoEtc.test_repr_unicode_columnsc    Cs8tddgiƒ}d}tjt|dt|ƒW5QRXdS)NrQÚabcz2^'str' object cannot be interpreted as an integer$)Úmatch)rÚpytestZraisesÚ    TypeErrorÚbytes)r(r*ÚmsgrrrÚtest_str_to_bytes_raisesûsz1TestDataFrameReprInfoEtc.test_str_to_bytes_raisescCs*ttj dd¡t dd¡d}t|ƒdS)Nr~rlrp)rrrr5r6Z rands_arrayr&rzrrrÚtest_very_wide_info_reprsz1TestDataFrameReprInfoEtc.test_very_wide_info_reprc    Cs:tdgddœƒ}tddƒdt|ƒks,t‚W5QRXdS)NizšluIs it possible to modify drop plot codeso that the output graph is displayed in iphone simulator, Is it possible to modify drop plot code so that the output graph is Ã¢Â€Â¨displayed in iphone simulator.Now we are adding the CSV file externally. I want to Call the File through the code..)ZIdÚ    StringColrrlr‘ryrzrrrÚ,test_repr_column_name_unicode_truncation_bugsýÿ zETestDataFrameReprInfoEtc.test_repr_column_name_unicode_truncation_bugc    Csht d¡d}tddddƒ2tdddgd    d
d ggƒ}| ¡}||ksJt‚W5QRX| ¡dksdt‚dS) NZjinja2z{\begin{tabular}{llll}
\toprule
 & 0 & 1 & 2 \\
\midrule
0 & $\alpha$ & b & c \\
1 & 1 & 2 & 3 \\
\bottomrule
\end{tabular}
zstyler.format.escapezstyler.render.reprZlatexz$\alpha$rArBr,r0r:)r‹Z importorskiprrZ _repr_latex_r%)r(rJr*rIrrrÚtest_latex_reprs
    ÿz(TestDataFrameReprInfoEtc.test_latex_reprcCsjtddddd}tdddd}t||d    œƒ}d
}t|ƒ|ks@t‚tt|ƒt|ƒd    œƒ}t|ƒ|ksft‚dS) Nz2011-01-01 09:00ÚHr;z
US/Eastern)ÚfreqÚperiodsÚtzz2011-01ÚM)r•r–)ÚdtÚpzÝ                         dt        p
0 2011-01-01 09:00:00-05:00  2011-01
1 2011-01-01 10:00:00-05:00  2011-02
2 2011-01-01 11:00:00-05:00  2011-03
3 2011-01-01 12:00:00-05:00  2011-04
4 2011-01-01 13:00:00-05:00  2011-05)r rrr&r%r)r(r™ršr*ÚexpZdf2rrrÚ#test_repr_categorical_dates_periods0sz<TestDataFrameReprInfoEtc.test_repr_categorical_dates_periodsÚargz box, expectedz0    NaT
dtype: objectz      0
0  NaTcCs&t||dƒgtdƒ}||ks"t‚dS)Nr    ©Zdtype)r&r#r%)r(rZboxrJrIrrrÚtest_repr_np_nat_with_objectAsz5TestDataFrameReprInfoEtc.test_repr_np_nat_with_objectcCs"tdtddddiƒ}t|ƒdS)NÚyearz1/1/1700rzA-DEC)r–r•)rr r&rzrrrÚ"test_frame_datetime64_pre1900_reprKsz;TestDataFrameReprInfoEtc.test_frame_datetime64_pre1900_reprcCs4tdddgdd}ttj dd¡|d}| ¡dS)    Nz2011-1z2011-2z2011-3r˜)r•r:r1r2)r
rrrr5ra)r(r3rbrrrÚ%test_frame_to_string_with_periodindexPsz>TestDataFrameReprInfoEtc.test_frame_to_string_with_periodindexcCsDtdddgit ttdgddg¡d}| ¡}d}||ks@t‚dS)Nr@r,r0ÚInt64ržr2z      a
<NA>  1
1     2)rrZ from_arraysr rrar%rHrrrÚ"test_to_string_ea_na_in_multiindexWs
þz;TestDataFrameReprInfoEtc.test_to_string_ea_na_in_multiindexcCsLtdtddddiƒ}t|ƒ}|jdd…dd…f}t|ƒ}||ksHt‚dS)NrZ2019r~ÚUTC)r–r—r;)rr r&r'r%)r(r*rJrIrrrÚ$test_datetime64tz_slice_non_truncateds
z=TestDataFrameReprInfoEtc.test_datetime64tz_slice_non_truncatecCsNttddgddtddgdddœƒ}|jd    jd    jgd
}d }||ksJt‚dS) Ng_c97ݚ¿?g6–sÓ­ùñ?ZFloat64ržr,r0r£)r@rAz{:.2f})Ú
formattersz)      a     b
0  0.12  1.00
1  1.12  2.00)rr raÚformatr%rHrrrÚtest_masked_ea_with_formatterlsþÿz6TestDataFrameReprInfoEtc.test_masked_ea_with_formatterN)*Ú__name__Ú
__module__Ú __qualname__r+r9rFrKrMrPrUr]rcrerir‹ÚmarkZslowrorwr{r}r‚r„r‡rˆrrr’r“rœZ parametrizerZ
datetime64Z timedelta64r rrŸr¡r¢r¤r¦r©rrrrrsJ 
 
 
 
 
 þ  r)rrÚiorÚnumpyrr‹Zpandasrrrrr    r
r r r rrZpandas._testingZ_testingr6Zpandas.io.formats.formatÚformatsr¨rrrrrrÚ<module>s 4