Skip to content

Commit 8d0ee56

Browse files
Fix html docs.
Missing newlines.
1 parent bcf416c commit 8d0ee56

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/frame.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,7 @@ def to_records(self, index=True, convert_datetime64=True):
12311231
12321232
Examples
12331233
--------
1234+
12341235
>>> df = pd.DataFrame({'col1': [1, 2], 'col2': [0.5, 0.75]}, index=['a', 'b'])
12351236
>>> df
12361237
col1 col2
@@ -1241,11 +1242,13 @@ def to_records(self, index=True, convert_datetime64=True):
12411242
dtype=[('index', 'O'), ('col1', '<i8'), ('col2', '<f8')])
12421243
12431244
The index can be excluded from the record array:
1245+
12441246
>>> df.to_records(index=False)
12451247
rec.array([(1, 0.5 ), (2, 0.75)],
12461248
dtype=[('col1', '<i8'), ('col2', '<f8')])
12471249
1248-
By default, timestamps are converted to `datetime.datetime` objects
1250+
By default, timestamps are converted to `datetime.datetime` objects:
1251+
12491252
>>> df.index = pd.date_range('2018-01-01 09:00', periods=2, freq='min')
12501253
>>> df
12511254
col1 col2
@@ -1257,6 +1260,7 @@ def to_records(self, index=True, convert_datetime64=True):
12571260
dtype=[('index', 'O'), ('col1', '<i8'), ('col2', '<f8')])
12581261
12591262
The timestamp conversion can be disabled to use NumPy datetime64 objects instead:
1263+
12601264
>>> df.to_records(convert_datetime64=False)
12611265
rec.array([('2018-01-01T09:00:00.000000000', 1, 0.5 ),
12621266
('2018-01-01T09:01:00.000000000', 2, 0.75)],

0 commit comments

Comments
 (0)