@@ -133,7 +133,33 @@ def _display_counts_and_dtypes(
133
133
space_num : int = 0 ,
134
134
) -> None :
135
135
"""
136
- Display count and dtype of Series (or of each column of Frame).
136
+ Append count and dtype of Series (or of each column of Frame) to `lines`.
137
+
138
+ Parameters
139
+ ----------
140
+ lines : List[str]
141
+ At this stage, this contains the main header and the info table headers.
142
+ ids : Index
143
+ Series name (or names of DataFrame columns).
144
+ dtypes : Series
145
+ Series dtype (or dtypes of DataFrame columns).
146
+ show_counts : bool
147
+ Whether to show non-null counts.
148
+ counts : Series
149
+ Non-null counts of Series (or of each of DataFrame's columns).
150
+ count_temp : str
151
+ String that can be formatted to include non-null count.
152
+ space_count : int
153
+ Number of spaces that count_header should occupy
154
+ (including space before `dtypes` column).
155
+ space_dtype : int
156
+ Number of spaces that `dtypes` column should occupy.
157
+ space : int = 0
158
+ Number of spaces that `Column` header should occupy
159
+ (including space before `non-null count` column).
160
+ space_num : int = 0
161
+ Number of spaces that ` # ` header should occupy (including space
162
+ before `Column` column), only applicable for `DataFrame.info`.
137
163
"""
138
164
for i , col in enumerate (ids ):
139
165
dtype = dtypes [i ]
@@ -157,12 +183,35 @@ def _get_header_and_spaces(
157
183
) -> Tuple [int , str , int ]:
158
184
"""
159
185
Append extra columns (count and type) to header, if applicable.
186
+
187
+ Parameters
188
+ ----------
189
+ dtypes : Series
190
+ Series dtype (or dtypes of DataFrame columns).
191
+ space_count : int
192
+ Number of spaces that count_header should occupy
193
+ (including space before `dtypes` column).
194
+ count_header : str
195
+ Header that will be printed out above non-null counts in output.
196
+ header : str
197
+ Current header.
198
+
199
+ Returns
200
+ -------
201
+ space_dtype : int
202
+ Number of spaces that `dtypes` column should occupy.
203
+ header : str
204
+ Header with extra columns (count and type) appended.
205
+ len_dtype : int
206
+ Length of dtype header.
160
207
"""
208
+ breakpoint ()
161
209
dtype_header = "Dtype"
162
210
len_dtype = len (dtype_header )
163
211
max_dtypes = max (len (pprint_thing (k )) for k in dtypes )
164
212
space_dtype = max (len_dtype , max_dtypes )
165
213
header += _put_str (count_header , space_count ) + _put_str (dtype_header , space_dtype )
214
+ breakpoint ()
166
215
return space_dtype , header , len_dtype
167
216
168
217
0 commit comments