68
68
Series ,
69
69
Timedelta ,
70
70
Timestamp ,
71
+ date_range ,
71
72
period_range ,
72
73
timedelta_range ,
73
74
)
@@ -608,15 +609,15 @@ def _create_mi_with_dt64tz_level():
608
609
"""
609
610
# GH#8367 round trip with pickle
610
611
return MultiIndex .from_product (
611
- [[1 , 2 ], ["a" , "b" ], pd . date_range ("20130101" , periods = 3 , tz = "US/Eastern" )],
612
+ [[1 , 2 ], ["a" , "b" ], date_range ("20130101" , periods = 3 , tz = "US/Eastern" )],
612
613
names = ["one" , "two" , "three" ],
613
614
)
614
615
615
616
616
617
indices_dict = {
617
618
"string" : Index ([f"pandas_{ i } " for i in range (100 )]),
618
- "datetime" : tm . makeDateIndex ( 100 ),
619
- "datetime-tz" : tm . makeDateIndex ( 100 , tz = "US/Pacific" ),
619
+ "datetime" : date_range ( "2020-01-01" , periods = 100 ),
620
+ "datetime-tz" : date_range ( "2020-01-01" , periods = 100 , tz = "US/Pacific" ),
620
621
"period" : period_range ("2020-01-01" , periods = 100 , freq = "D" ),
621
622
"timedelta" : timedelta_range (start = "1 day" , periods = 100 , freq = "D" ),
622
623
"range" : RangeIndex (100 ),
@@ -631,7 +632,7 @@ def _create_mi_with_dt64tz_level():
631
632
"float32" : Index (np .arange (100 ), dtype = "float32" ),
632
633
"float64" : Index (np .arange (100 ), dtype = "float64" ),
633
634
"bool-object" : Index ([True , False ] * 5 , dtype = object ),
634
- "bool-dtype" : Index (np . random . default_rng ( 2 ). standard_normal ( 10 ) < 0 ),
635
+ "bool-dtype" : Index ([ True , False ] * 5 , dtype = bool ),
635
636
"complex64" : Index (
636
637
np .arange (100 , dtype = "complex64" ) + 1.0j * np .arange (100 , dtype = "complex64" )
637
638
),
@@ -751,9 +752,9 @@ def object_series() -> Series:
751
752
"""
752
753
Fixture for Series of dtype object with Index of unique strings
753
754
"""
754
- s = tm . makeObjectSeries ()
755
- s . name = "objects"
756
- return s
755
+ data = [ f"foo_ { i } " for i in range ( 30 )]
756
+ index = Index ([ f"bar_ { i } " for i in range ( 30 )], dtype = object )
757
+ return Series ( data , index = index , name = "objects" , dtype = object )
757
758
758
759
759
760
@pytest .fixture
@@ -839,27 +840,12 @@ def int_frame() -> DataFrame:
839
840
Fixture for DataFrame of ints with index of unique strings
840
841
841
842
Columns are ['A', 'B', 'C', 'D']
842
-
843
- A B C D
844
- vpBeWjM651 1 0 1 0
845
- 5JyxmrP1En -1 0 0 0
846
- qEDaoD49U2 -1 1 0 0
847
- m66TkTfsFe 0 0 0 0
848
- EHPaNzEUFm -1 0 -1 0
849
- fpRJCevQhi 2 0 0 0
850
- OlQvnmfi3Q 0 0 -2 0
851
- ... .. .. .. ..
852
- uB1FPlz4uP 0 0 0 1
853
- EcSe6yNzCU 0 0 -1 0
854
- L50VudaiI8 -1 1 -2 0
855
- y3bpw4nwIp 0 -1 0 0
856
- H0RdLLwrCT 1 1 0 0
857
- rY82K0vMwm 0 0 0 0
858
- 1OPIUjnkjk 2 0 0 0
859
-
860
- [30 rows x 4 columns]
861
843
"""
862
- return DataFrame (tm .getSeriesData ()).astype ("int64" )
844
+ return DataFrame (
845
+ np .ones ((30 , 4 ), dtype = np .int64 ),
846
+ index = Index ([f"foo_{ i } " for i in range (30 )], dtype = object ),
847
+ columns = Index (list ("ABCD" ), dtype = object ),
848
+ )
863
849
864
850
865
851
@pytest .fixture
@@ -868,27 +854,12 @@ def float_frame() -> DataFrame:
868
854
Fixture for DataFrame of floats with index of unique strings
869
855
870
856
Columns are ['A', 'B', 'C', 'D'].
871
-
872
- A B C D
873
- P7GACiRnxd -0.465578 -0.361863 0.886172 -0.053465
874
- qZKh6afn8n -0.466693 -0.373773 0.266873 1.673901
875
- tkp0r6Qble 0.148691 -0.059051 0.174817 1.598433
876
- wP70WOCtv8 0.133045 -0.581994 -0.992240 0.261651
877
- M2AeYQMnCz -1.207959 -0.185775 0.588206 0.563938
878
- QEPzyGDYDo -0.381843 -0.758281 0.502575 -0.565053
879
- r78Jwns6dn -0.653707 0.883127 0.682199 0.206159
880
- ... ... ... ... ...
881
- IHEGx9NO0T -0.277360 0.113021 -1.018314 0.196316
882
- lPMj8K27FA -1.313667 -0.604776 -1.305618 -0.863999
883
- qa66YMWQa5 1.110525 0.475310 -0.747865 0.032121
884
- yOa0ATsmcE -0.431457 0.067094 0.096567 -0.264962
885
- 65znX3uRNG 1.528446 0.160416 -0.109635 -0.032987
886
- eCOBvKqf3e 0.235281 1.622222 0.781255 0.392871
887
- xSucinXxuV -1.263557 0.252799 -0.552247 0.400426
888
-
889
- [30 rows x 4 columns]
890
- """
891
- return DataFrame (tm .getSeriesData ())
857
+ """
858
+ return DataFrame (
859
+ np .random .default_rng (2 ).standard_normal ((30 , 4 )),
860
+ index = Index ([f"foo_{ i } " for i in range (30 )], dtype = object ),
861
+ columns = Index (list ("ABCD" ), dtype = object ),
862
+ )
892
863
893
864
894
865
@pytest .fixture
0 commit comments