@@ -53,17 +53,21 @@ class SAS7BDATReader(BaseIterator):
53
53
Return SAS7BDATReader object for iterations, returns chunks
54
54
with given number of lines.
55
55
encoding : string, defaults to None
56
- String encoding. If None, text variables are left as raw bytes.
56
+ String encoding.
57
+ convert_text : bool, deafaults to True
58
+ If False, text variables are left as raw bytes.
57
59
"""
58
60
59
61
def __init__ (self , path_or_buf , index = None , convert_dates = True ,
60
- blank_missing = True , chunksize = None , encoding = None ):
62
+ blank_missing = True , chunksize = None , encoding = None ,
63
+ convert_text = True ):
61
64
62
65
self .index = index
63
66
self .convert_dates = convert_dates
64
67
self .blank_missing = blank_missing
65
68
self .chunksize = chunksize
66
69
self .encoding = encoding
70
+ self .convert_text = convert_text
67
71
68
72
self .compression = ""
69
73
self .column_names_strings = []
@@ -611,7 +615,7 @@ def _chunk_to_dataframe(self):
611
615
elif self .column_types [j ] == b's' :
612
616
rslt [name ] = self ._string_chunk [js , :]
613
617
rslt [name ] = rslt [name ].apply (lambda x : x .rstrip (b'\x00 ' ))
614
- if self .encoding is not None :
618
+ if self .convert_text and ( self . encoding is not None ) :
615
619
rslt [name ] = rslt [name ].apply (
616
620
lambda x : x .decode (encoding = self .encoding ))
617
621
if self .blank_missing :
0 commit comments