@@ -627,10 +627,7 @@ def _obj_with_exclusions(self):
627
627
""" internal compat with SelectionMixin """
628
628
return self
629
629
630
- def set_axis (self ,
631
- labels : Sequence [Any ],
632
- axis = 0 ,
633
- inplace = False ) -> "NDFrame" :
630
+ def set_axis (self , labels : Sequence [Any ], axis = 0 , inplace = False ) -> "NDFrame" :
634
631
"""
635
632
Assign desired index to given axis.
636
633
@@ -777,10 +774,7 @@ def transpose(self, *args, **kwargs) -> "NDFrame":
777
774
nv .validate_transpose (tuple (), kwargs )
778
775
return self ._constructor (new_values , ** new_axes ).__finalize__ (self )
779
776
780
- def swapaxes (self ,
781
- axis1 : int ,
782
- axis2 : int ,
783
- copy = True ) -> "NDFrame" :
777
+ def swapaxes (self , axis1 : int , axis2 : int , copy = True ) -> "NDFrame" :
784
778
"""
785
779
Interchange axes and swap values axes appropriately.
786
780
@@ -805,9 +799,9 @@ def swapaxes(self,
805
799
806
800
return self ._constructor (new_values , * new_axes ).__finalize__ (self )
807
801
808
- def droplevel (self ,
809
- level : Union [int , str , Sequence [Union [int , str ]]],
810
- axis = 0 ) -> "NDFrame" :
802
+ def droplevel (
803
+ self , level : Union [int , str , Sequence [Union [int , str ]]], axis = 0
804
+ ) -> "NDFrame" :
811
805
"""
812
806
Return DataFrame with requested index / column level(s) removed.
813
807
@@ -866,8 +860,7 @@ def droplevel(self,
866
860
result = self .set_axis (new_labels , axis = axis , inplace = False )
867
861
return result
868
862
869
- def pop (self ,
870
- item : str ) -> "pd.Series" :
863
+ def pop (self , item : str ) -> "pd.Series" :
871
864
"""
872
865
Return item and drop from frame. Raise KeyError if not found.
873
866
@@ -1385,10 +1378,9 @@ class name
1385
1378
if not inplace :
1386
1379
return result
1387
1380
1388
- def _set_axis_name (self ,
1389
- name : Union [str , List [str ]],
1390
- axis = 0 ,
1391
- inplace = False ) -> "NDFrame" :
1381
+ def _set_axis_name (
1382
+ self , name : Union [str , List [str ]], axis = 0 , inplace = False
1383
+ ) -> "NDFrame" :
1392
1384
"""
1393
1385
Set the name(s) of the axis.
1394
1386
@@ -1457,8 +1449,7 @@ def _indexed_same(self, other):
1457
1449
self ._get_axis (a ).equals (other ._get_axis (a )) for a in self ._AXIS_ORDERS
1458
1450
)
1459
1451
1460
- def equals (self ,
1461
- other : "NDFrame" ) -> bool :
1452
+ def equals (self , other : "NDFrame" ) -> bool :
1462
1453
"""
1463
1454
Test whether two objects contain the same elements.
1464
1455
@@ -1636,9 +1627,7 @@ def __round__(self, decimals=0):
1636
1627
# operations should utilize/extend these methods when possible so that we
1637
1628
# have consistent precedence and validation logic throughout the library.
1638
1629
1639
- def _is_level_reference (self ,
1640
- key : str ,
1641
- axis = 0 ) -> bool :
1630
+ def _is_level_reference (self , key : str , axis = 0 ) -> bool :
1642
1631
"""
1643
1632
Test whether a key is a level reference for a given axis.
1644
1633
@@ -1668,9 +1657,7 @@ def _is_level_reference(self,
1668
1657
and not self ._is_label_reference (key , axis = axis )
1669
1658
)
1670
1659
1671
- def _is_label_reference (self ,
1672
- key : str ,
1673
- axis = 0 ) -> bool :
1660
+ def _is_label_reference (self , key : str , axis = 0 ) -> bool :
1674
1661
"""
1675
1662
Test whether a key is a label reference for a given axis.
1676
1663
@@ -1699,9 +1686,7 @@ def _is_label_reference(self,
1699
1686
and any (key in self .axes [ax ] for ax in other_axes )
1700
1687
)
1701
1688
1702
- def _is_label_or_level_reference (self ,
1703
- key : str ,
1704
- axis = 0 ) -> bool :
1689
+ def _is_label_or_level_reference (self , key : str , axis = 0 ) -> bool :
1705
1690
"""
1706
1691
Test whether a key is a label or level reference for a given axis.
1707
1692
@@ -1725,9 +1710,7 @@ def _is_label_or_level_reference(self,
1725
1710
key , axis = axis
1726
1711
)
1727
1712
1728
- def _check_label_or_level_ambiguity (self ,
1729
- key : str ,
1730
- axis = 0 ) -> None :
1713
+ def _check_label_or_level_ambiguity (self , key : str , axis = 0 ) -> None :
1731
1714
"""
1732
1715
Check whether `key` is ambiguous.
1733
1716
@@ -1776,9 +1759,7 @@ def _check_label_or_level_ambiguity(self,
1776
1759
)
1777
1760
raise ValueError (msg )
1778
1761
1779
- def _get_label_or_level_values (self ,
1780
- key : str ,
1781
- axis = 0 ) -> np .ndarray :
1762
+ def _get_label_or_level_values (self , key : str , axis = 0 ) -> np .ndarray :
1782
1763
"""
1783
1764
Return a 1-D array of values associated with `key`, a label or level
1784
1765
from the given `axis`.
@@ -1850,9 +1831,7 @@ def _get_label_or_level_values(self,
1850
1831
1851
1832
return values
1852
1833
1853
- def _drop_labels_or_levels (self ,
1854
- keys : Union [str , List [str ]],
1855
- axis = 0 ) -> "NDFrame" :
1834
+ def _drop_labels_or_levels (self , keys : Union [str , List [str ]], axis = 0 ) -> "NDFrame" :
1856
1835
"""
1857
1836
Drop labels and/or levels for the given `axis`.
1858
1837
@@ -2493,10 +2472,9 @@ def to_json(
2493
2472
indent = indent ,
2494
2473
)
2495
2474
2496
- def to_hdf (self ,
2497
- path_or_buf : Union [str , FilePathOrBuffer ],
2498
- key : str ,
2499
- ** kwargs ) -> None :
2475
+ def to_hdf (
2476
+ self , path_or_buf : Union [str , FilePathOrBuffer ], key : str , ** kwargs
2477
+ ) -> None :
2500
2478
"""
2501
2479
Write the contained data to an HDF5 file using HDFStore.
2502
2480
@@ -2601,10 +2579,9 @@ def to_hdf(self,
2601
2579
2602
2580
pytables .to_hdf (path_or_buf , key , self , ** kwargs )
2603
2581
2604
- def to_msgpack (self ,
2605
- path_or_buf : Optional [FilePathOrBuffer ] = None ,
2606
- encoding = "utf-8" ,
2607
- ** kwargs ) -> None :
2582
+ def to_msgpack (
2583
+ self , path_or_buf : Optional [FilePathOrBuffer ] = None , encoding = "utf-8" , ** kwargs
2584
+ ) -> None :
2608
2585
"""
2609
2586
Serialize object to input file path using msgpack format.
2610
2587
@@ -2800,10 +2777,9 @@ def to_sql(
2800
2777
method = method ,
2801
2778
)
2802
2779
2803
- def to_pickle (self ,
2804
- path : str ,
2805
- compression = "infer" ,
2806
- protocol = pickle .HIGHEST_PROTOCOL ) -> None :
2780
+ def to_pickle (
2781
+ self , path : str , compression = "infer" , protocol = pickle .HIGHEST_PROTOCOL
2782
+ ) -> None :
2807
2783
"""
2808
2784
Pickle (serialize) object to file.
2809
2785
0 commit comments