File tree 3 files changed +21
-14
lines changed
3 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -2614,7 +2614,7 @@ def to_html(
2614
2614
DataFrame.memory_usage: Memory usage of DataFrame columns."""
2615
2615
),
2616
2616
)
2617
- @doc (BaseInfo .to_buffer )
2617
+ @doc (BaseInfo .render )
2618
2618
def info (
2619
2619
self ,
2620
2620
verbose : Optional [bool ] = None ,
@@ -2627,7 +2627,7 @@ def info(
2627
2627
data = self ,
2628
2628
memory_usage = memory_usage ,
2629
2629
)
2630
- info .to_buffer (
2630
+ info .render (
2631
2631
buf = buf ,
2632
2632
max_cols = max_cols ,
2633
2633
verbose = verbose ,
Original file line number Diff line number Diff line change @@ -4640,7 +4640,7 @@ def replace(
4640
4640
Series.memory_usage: Memory usage of Series."""
4641
4641
),
4642
4642
)
4643
- @doc (BaseInfo .to_buffer )
4643
+ @doc (BaseInfo .render )
4644
4644
def info (
4645
4645
self ,
4646
4646
verbose : Optional [bool ] = None ,
@@ -4649,13 +4649,9 @@ def info(
4649
4649
memory_usage : Optional [Union [bool , str ]] = None ,
4650
4650
null_counts : bool = True ,
4651
4651
) -> None :
4652
- if max_cols is not None :
4653
- raise ValueError (
4654
- "Argument `max_cols` can only be passed "
4655
- "in DataFrame.info, not Series.info"
4656
- )
4657
- return SeriesInfo (self , memory_usage ).to_buffer (
4652
+ return SeriesInfo (self , memory_usage ).render (
4658
4653
buf = buf ,
4654
+ max_cols = max_cols ,
4659
4655
verbose = verbose ,
4660
4656
show_counts = null_counts ,
4661
4657
)
Original file line number Diff line number Diff line change @@ -160,7 +160,14 @@ def size_qualifier(self) -> str:
160
160
return size_qualifier
161
161
162
162
@abstractmethod
163
- def to_buffer ():
163
+ def render (
164
+ self ,
165
+ * ,
166
+ buf : Optional [IO [str ]],
167
+ max_cols : Optional [int ],
168
+ verbose : Optional [bool ],
169
+ show_counts : Optional [bool ],
170
+ ) -> None :
164
171
"""
165
172
Print a concise summary of a %(klass)s.
166
173
@@ -266,7 +273,7 @@ def memory_usage_bytes(self) -> int:
266
273
deep = False
267
274
return self .data .memory_usage (index = True , deep = deep ).sum ()
268
275
269
- def to_buffer (
276
+ def render (
270
277
self ,
271
278
* ,
272
279
buf : Optional [IO [str ]],
@@ -296,15 +303,19 @@ def __init__(
296
303
self .data : "Series" = data
297
304
self .memory_usage = _initialize_memory_usage (memory_usage )
298
305
299
- def to_buffer (
306
+ def render (
300
307
self ,
301
308
* ,
302
309
buf : Optional [IO [str ]],
310
+ max_cols : Optional [int ],
303
311
verbose : Optional [bool ],
304
312
show_counts : Optional [bool ],
305
313
) -> None :
306
- """
307
- """
314
+ if max_cols is not None :
315
+ raise ValueError (
316
+ "Argument `max_cols` can only be passed "
317
+ "in DataFrame.info, not Series.info"
318
+ )
308
319
printer = SeriesInfoPrinter (
309
320
info = self ,
310
321
verbose = verbose ,
You can’t perform that action at this time.
0 commit comments