@@ -1757,18 +1757,11 @@ def __init__(
1757
1757
assert isinstance (self .cname , str )
1758
1758
assert isinstance (self .kind_attr , str )
1759
1759
1760
- def set_axis (self , axis : int ):
1761
- """ set the axis over which I index """
1762
- self .axis = axis
1763
-
1764
- return self
1765
-
1766
1760
def set_pos (self , pos : int ):
1767
1761
""" set the position of this column in the Table """
1768
1762
self .pos = pos
1769
1763
if pos is not None and self .typ is not None :
1770
1764
self .typ ._v_pos = pos
1771
- return self
1772
1765
1773
1766
def __repr__ (self ) -> str :
1774
1767
temp = tuple (
@@ -1843,8 +1836,6 @@ def convert(
1843
1836
1844
1837
self .values = _set_tz (self .values , self .tz )
1845
1838
1846
- return self
1847
-
1848
1839
def take_data (self ):
1849
1840
""" return the values & release the memory """
1850
1841
self .values , values = None , self .values
@@ -1965,8 +1956,6 @@ def update_info(self, info):
1965
1956
if value is not None or existing_value is not None :
1966
1957
idx [key ] = value
1967
1958
1968
- return self
1969
-
1970
1959
def set_info (self , info ):
1971
1960
""" set my state from the passed info """
1972
1961
idx = info .get (self .name )
@@ -2039,14 +2028,10 @@ def convert(
2039
2028
"""
2040
2029
assert self .table is not None # for mypy
2041
2030
2042
- assert self .table is not None
2043
-
2044
2031
_start = start if start is not None else 0
2045
2032
_stop = min (stop , self .table .nrows ) if stop is not None else self .table .nrows
2046
2033
self .values = Int64Index (np .arange (_stop - _start ))
2047
2034
2048
- return self
2049
-
2050
2035
def get_attr (self ):
2051
2036
pass
2052
2037
@@ -2486,8 +2471,6 @@ def convert(self, values, nan_rep, encoding, errors, start=None, stop=None):
2486
2471
self .data , nan_rep = nan_rep , encoding = encoding , errors = errors
2487
2472
)
2488
2473
2489
- return self
2490
-
2491
2474
def get_attr (self ):
2492
2475
""" get the data for this column """
2493
2476
self .values = getattr (self .attrs , self .kind_attr , None )
@@ -3768,9 +3751,12 @@ def create_axes(
3768
3751
3769
3752
if i in axes :
3770
3753
name = obj ._AXIS_NAMES [i ]
3771
- index_axes_map [ i ] = _convert_index (
3754
+ new_index = _convert_index (
3772
3755
name , a , self .encoding , self .errors , self .format_type
3773
- ).set_axis (i )
3756
+ )
3757
+ new_index .axis = i
3758
+ index_axes_map [i ] = new_index
3759
+
3774
3760
else :
3775
3761
3776
3762
# we might be able to change the axes on the appending data if
@@ -3797,10 +3783,12 @@ def create_axes(
3797
3783
self .non_index_axes .append ((i , append_axis ))
3798
3784
3799
3785
# set axis positions (based on the axes)
3800
- self .index_axes = [
3801
- index_axes_map [a ].set_pos (j ).update_info (self .info )
3802
- for j , a in enumerate (axes )
3803
- ]
3786
+ new_index_axes = [index_axes_map [a ] for a in axes ]
3787
+ for j , iax in enumerate (new_index_axes ):
3788
+ iax .set_pos (j )
3789
+ iax .update_info (self .info )
3790
+ self .index_axes = new_index_axes
3791
+
3804
3792
j = len (self .index_axes )
3805
3793
3806
3794
# check for column conflicts
@@ -4069,19 +4057,13 @@ def read_column(
4069
4057
# column must be an indexable or a data column
4070
4058
c = getattr (self .table .cols , column )
4071
4059
a .set_info (self .info )
4072
- return Series (
4073
- _set_tz (
4074
- a .convert (
4075
- c [start :stop ],
4076
- nan_rep = self .nan_rep ,
4077
- encoding = self .encoding ,
4078
- errors = self .errors ,
4079
- ).take_data (),
4080
- a .tz ,
4081
- True ,
4082
- ),
4083
- name = column ,
4060
+ a .convert (
4061
+ c [start :stop ],
4062
+ nan_rep = self .nan_rep ,
4063
+ encoding = self .encoding ,
4064
+ errors = self .errors ,
4084
4065
)
4066
+ return Series (_set_tz (a .take_data (), a .tz , True ), name = column )
4085
4067
4086
4068
raise KeyError ("column [{column}] not found in the table" .format (column = column ))
4087
4069
0 commit comments