typeddfs._mixins._fwf_mixin
ο
Mixin for fixed-width format.
Module Contentsο
- class typeddfs._mixins._fwf_mixin._FwfMixinο
- classmethod read_fwf(cls, *args, **kwargs) __qualname__ ο
- to_fwf(self, path_or_buff=None, mode: str = 'w', colspecs: Optional[Sequence[Tuple[int, int]]] = None, widths: Optional[Sequence[int]] = None, na_rep: Optional[str] = None, float_format: Optional[str] = None, date_format: Optional[str] = None, decimal: str = '.', **kwargs) Optional[str] ο
Writes a fixed-width text format. See
read_fwf
andto_flexwf
for more info.- Parameters
path_or_buff β Path or buffer
mode β write or append (w/a)
colspecs β A list of tuples giving the extents of the fixed-width fields of each line as half-open intervals (i.e., [from, to[ )
widths β A list of field widths which can be used instead of
colspecs
if the intervals are contiguousna_rep β Missing data representation
float_format β Format string for floating point numbers
date_format β Format string for datetime objects
decimal β Character recognized as decimal separator. E.g. use β,β for European data.
kwargs β Passed to
typeddfs.utils.Utils.write()
- Returns
The string data if
path_or_buff
is a buffer; None if it is a file