Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions pandas/io/sas/sas_xport.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import numpy as np

from pandas.util._decorators import Appender
from pandas.util._exceptions import find_stack_level

import pandas as pd
Expand Down Expand Up @@ -126,20 +125,6 @@
Contains information about the variables in the file
"""

_read_method_doc = """\
Read observations from SAS Xport file, returning as data frame.

Parameters
----------
nrows : int
Number of rows to read from data file; if None, read whole
file.

Returns
-------
A DataFrame.
"""


def _parse_date(datestr: str) -> DatetimeNaTType:
"""Given a date in xport format, return Python date."""
Expand Down Expand Up @@ -464,8 +449,19 @@ def _missing_double(self, vec):
miss &= miss1
return miss

@Appender(_read_method_doc)
def read(self, nrows: int | None = None) -> pd.DataFrame:
"""Read observations from SAS Xport file, returning as data frame.

Parameters
----------
nrows : int
Number of rows to read from data file; if None, read whole
file.

Returns
-------
A DataFrame.
"""
if nrows is None:
nrows = self.nobs

Expand Down
Loading