repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
pandas-dev/pandas
pandas/core/dtypes/cast.py
maybe_infer_dtype_type
def maybe_infer_dtype_type(element): """Try to infer an object's dtype, for use in arithmetic ops Uses `element.dtype` if that's available. Objects implementing the iterator protocol are cast to a NumPy array, and from there the array's type is used. Parameters ---------- element : object Possibly has a `.dtype` attribute, and possibly the iterator protocol. Returns ------- tipo : type Examples -------- >>> from collections import namedtuple >>> Foo = namedtuple("Foo", "dtype") >>> maybe_infer_dtype_type(Foo(np.dtype("i8"))) numpy.int64 """ tipo = None if hasattr(element, 'dtype'): tipo = element.dtype elif is_list_like(element): element = np.asarray(element) tipo = element.dtype return tipo
python
def maybe_infer_dtype_type(element): """Try to infer an object's dtype, for use in arithmetic ops Uses `element.dtype` if that's available. Objects implementing the iterator protocol are cast to a NumPy array, and from there the array's type is used. Parameters ---------- element : object Possibly has a `.dtype` attribute, and possibly the iterator protocol. Returns ------- tipo : type Examples -------- >>> from collections import namedtuple >>> Foo = namedtuple("Foo", "dtype") >>> maybe_infer_dtype_type(Foo(np.dtype("i8"))) numpy.int64 """ tipo = None if hasattr(element, 'dtype'): tipo = element.dtype elif is_list_like(element): element = np.asarray(element) tipo = element.dtype return tipo
[ "def", "maybe_infer_dtype_type", "(", "element", ")", ":", "tipo", "=", "None", "if", "hasattr", "(", "element", ",", "'dtype'", ")", ":", "tipo", "=", "element", ".", "dtype", "elif", "is_list_like", "(", "element", ")", ":", "element", "=", "np", ".", "asarray", "(", "element", ")", "tipo", "=", "element", ".", "dtype", "return", "tipo" ]
Try to infer an object's dtype, for use in arithmetic ops Uses `element.dtype` if that's available. Objects implementing the iterator protocol are cast to a NumPy array, and from there the array's type is used. Parameters ---------- element : object Possibly has a `.dtype` attribute, and possibly the iterator protocol. Returns ------- tipo : type Examples -------- >>> from collections import namedtuple >>> Foo = namedtuple("Foo", "dtype") >>> maybe_infer_dtype_type(Foo(np.dtype("i8"))) numpy.int64
[ "Try", "to", "infer", "an", "object", "s", "dtype", "for", "use", "in", "arithmetic", "ops" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L486-L516
train
Try to infer the dtype of an object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,q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8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1935 - 1887) + chr(111) + chr(0b110010) + chr(1133 - 1078) + chr(1202 - 1147), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011000 + 0o27) + chr(51) + chr(1143 - 1093) + chr(194 - 142), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\x31' + '\062', 44309 - 44301), ehT0Px3KOsy9('\x30' + '\157' + '\x36', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\064' + chr(717 - 663), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + '\061' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(8293 - 8182) + chr(0b110010) + '\x37' + chr(0b1110 + 0o42), 0o10), ehT0Px3KOsy9('\x30' + chr(5237 - 5126) + chr(507 - 457) + '\x34' + chr(0b101001 + 0o7), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(0b110010) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(7946 - 7835) + chr(0b11101 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b101100 + 0o13) + chr(55), 13542 - 13534), ehT0Px3KOsy9(chr(48) + chr(0b1101100 + 0o3) + chr(0b110001) + chr(0b10111 + 0o34) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + '\x37' + '\060', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11 + 0o60) + '\063', 7194 - 7186), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b11100 + 0o123) + chr(51) + '\066' + chr(0b1011 + 0o50), ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(10314 - 10203) + chr(0b110001) + '\066' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101011 + 0o10) + chr(556 - 507) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + '\063' + chr(932 - 881) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(95 - 44) + chr(55) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(284 - 234) + '\x34' + chr(2502 - 2447), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(1453 - 1402) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(49) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(1992 - 1942) + chr(54), 0b1000), ehT0Px3KOsy9(chr(2178 - 2130) + '\x6f' + '\x32' + chr(1662 - 1614) + chr(699 - 647), 0b1000), ehT0Px3KOsy9(chr(606 - 558) + chr(0b1101111) + '\066' + chr(0b100100 + 0o20), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(596 - 541) + chr(50), 44833 - 44825), ehT0Px3KOsy9(chr(911 - 863) + chr(0b1001001 + 0o46) + chr(0b110011) + chr(51) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(4157 - 4046) + chr(0b110001) + chr(0b110011) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(899 - 849) + '\x36' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(0b11010 + 0o27) + chr(0b110011) + '\060', 62479 - 62471), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100101 + 0o15) + '\x35' + chr(2365 - 2314), 0b1000), ehT0Px3KOsy9(chr(48) + chr(7444 - 7333) + chr(50) + chr(2031 - 1982) + chr(0b100001 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(833 - 783) + '\067' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + '\x32', 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b110111) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101 + 0o57) + chr(50), 0b1000), ehT0Px3KOsy9(chr(873 - 825) + '\157' + chr(0b10110 + 0o34) + chr(0b110101) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(50) + chr(48) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + '\060' + chr(49), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\064' + chr(898 - 845), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(267 - 219) + chr(0b1011111 + 0o20) + chr(0b111 + 0o56) + chr(0b101001 + 0o7), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x91'), chr(0b1011100 + 0o10) + chr(0b1010 + 0o133) + chr(655 - 556) + chr(7502 - 7391) + '\144' + '\x65')('\x75' + chr(116) + chr(0b110000 + 0o66) + '\x2d' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def YadG0MtpawrR(_CF03Rifpmdh): tCXizGVUk0M_ = None if lot1PSoAwYhj(_CF03Rifpmdh, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\xa03v\xc3'), '\144' + chr(101) + '\143' + chr(111) + chr(100) + chr(0b1001001 + 0o34))('\165' + chr(116) + chr(0b1100110) + '\x2d' + chr(0b1100 + 0o54))): tCXizGVUk0M_ = _CF03Rifpmdh.dtype elif bAgBF7jXI53B(_CF03Rifpmdh): _CF03Rifpmdh = WqUC3KWvYVup.asarray(_CF03Rifpmdh) tCXizGVUk0M_ = _CF03Rifpmdh.dtype return tCXizGVUk0M_
pandas-dev/pandas
pandas/core/dtypes/cast.py
maybe_upcast
def maybe_upcast(values, fill_value=np.nan, dtype=None, copy=False): """ provide explicit type promotion and coercion Parameters ---------- values : the ndarray that we want to maybe upcast fill_value : what we want to fill with dtype : if None, then use the dtype of the values, else coerce to this type copy : if True always make a copy even if no upcast is required """ if is_extension_type(values): if copy: values = values.copy() else: if dtype is None: dtype = values.dtype new_dtype, fill_value = maybe_promote(dtype, fill_value) if new_dtype != values.dtype: values = values.astype(new_dtype) elif copy: values = values.copy() return values, fill_value
python
def maybe_upcast(values, fill_value=np.nan, dtype=None, copy=False): """ provide explicit type promotion and coercion Parameters ---------- values : the ndarray that we want to maybe upcast fill_value : what we want to fill with dtype : if None, then use the dtype of the values, else coerce to this type copy : if True always make a copy even if no upcast is required """ if is_extension_type(values): if copy: values = values.copy() else: if dtype is None: dtype = values.dtype new_dtype, fill_value = maybe_promote(dtype, fill_value) if new_dtype != values.dtype: values = values.astype(new_dtype) elif copy: values = values.copy() return values, fill_value
[ "def", "maybe_upcast", "(", "values", ",", "fill_value", "=", "np", ".", "nan", ",", "dtype", "=", "None", ",", "copy", "=", "False", ")", ":", "if", "is_extension_type", "(", "values", ")", ":", "if", "copy", ":", "values", "=", "values", ".", "copy", "(", ")", "else", ":", "if", "dtype", "is", "None", ":", "dtype", "=", "values", ".", "dtype", "new_dtype", ",", "fill_value", "=", "maybe_promote", "(", "dtype", ",", "fill_value", ")", "if", "new_dtype", "!=", "values", ".", "dtype", ":", "values", "=", "values", ".", "astype", "(", "new_dtype", ")", "elif", "copy", ":", "values", "=", "values", ".", "copy", "(", ")", "return", "values", ",", "fill_value" ]
provide explicit type promotion and coercion Parameters ---------- values : the ndarray that we want to maybe upcast fill_value : what we want to fill with dtype : if None, then use the dtype of the values, else coerce to this type copy : if True always make a copy even if no upcast is required
[ "provide", "explicit", "type", "promotion", "and", "coercion" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L519-L542
train
provide explicit type promotion and coercion of the values to the type of the object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBH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,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + '\x32' + '\063' + chr(71 - 18), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(49) + chr(2508 - 2457), 0o10), ehT0Px3KOsy9(chr(619 - 571) + chr(0b1101111) + '\062' + '\x30' + chr(51), 21182 - 21174), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(0b110110) + '\x32', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b110000) + chr(299 - 244), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2360 - 2311) + '\064' + chr(1742 - 1692), 39505 - 39497), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(657 - 605) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(587 - 539) + chr(111) + '\x33' + '\x33' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(1402 - 1354) + chr(0b1101111) + chr(0b111 + 0o54) + chr(766 - 713) + chr(766 - 711), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(0b100101 + 0o15) + '\060' + chr(0b101000 + 0o16), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11011 + 0o124) + chr(51) + chr(410 - 360) + chr(0b100100 + 0o21), 63582 - 63574), ehT0Px3KOsy9('\x30' + chr(0b1100000 + 0o17) + chr(50) + '\x36' + '\063', 0o10), ehT0Px3KOsy9(chr(1458 - 1410) + chr(111) + chr(0b110011) + '\x32' + chr(328 - 275), 8), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(55) + chr(2181 - 2132), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110100) + chr(0b11000 + 0o32), 38019 - 38011), ehT0Px3KOsy9(chr(981 - 933) + chr(194 - 83) + chr(1894 - 1845) + chr(0b110110) + chr(353 - 302), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b11010 + 0o35) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + chr(597 - 547) + chr(0b10101 + 0o33) + chr(0b1110 + 0o42), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001001 + 0o46) + chr(49) + '\x34' + '\066', 14597 - 14589), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b100111 + 0o20) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + '\061' + chr(0b110011) + chr(0b1101 + 0o43), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(2455 - 2404) + chr(1150 - 1100) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + '\x32' + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\x30' + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(8379 - 8268) + chr(0b110011) + '\065' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\067' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b10111 + 0o130) + chr(1683 - 1634) + '\060' + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b1111 + 0o47) + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x37' + '\065', 8), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(111) + chr(1526 - 1476) + chr(0b110011) + chr(0b100111 + 0o11), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + '\x31' + '\066', 8), ehT0Px3KOsy9(chr(0b110000) + chr(5663 - 5552) + chr(51) + chr(1835 - 1785) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(144 - 33) + '\061' + chr(0b101100 + 0o6) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(7739 - 7628) + '\063' + chr(1318 - 1264) + '\x31', 0o10), ehT0Px3KOsy9(chr(1837 - 1789) + '\x6f' + chr(50) + chr(0b110100) + chr(0b100101 + 0o16), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + chr(0b1100 + 0o47) + '\065' + chr(116 - 67), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(387 - 339) + chr(111) + '\x33' + chr(49) + chr(0b10010 + 0o40), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(112 - 1) + chr(0b110101) + chr(0b10 + 0o56), 63409 - 63401)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3'), chr(0b10111 + 0o115) + chr(0b111100 + 0o51) + '\143' + chr(111) + chr(5886 - 5786) + '\145')(chr(0b1110101) + chr(0b11100 + 0o130) + chr(0b1100110) + chr(1385 - 1340) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Pt7jFRXjbP7u(SPnCNu54H1db, RlLNSsrUm3zD=xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3*\xed'), '\144' + chr(101) + chr(0b1011001 + 0o12) + chr(0b1101111) + chr(100) + '\x65')(chr(117) + '\x74' + '\x66' + '\055' + chr(2276 - 2220))), jSV9IKnemH7K=None, igThHS4jwVsa=ehT0Px3KOsy9('\060' + '\x6f' + chr(1932 - 1884), 0b1000)): if oW69L6z1WahW(SPnCNu54H1db): if igThHS4jwVsa: SPnCNu54H1db = SPnCNu54H1db.igThHS4jwVsa() else: if jSV9IKnemH7K is None: jSV9IKnemH7K = SPnCNu54H1db.dtype (H6Aqpf9qhdEs, RlLNSsrUm3zD) = ikHVdLFrBU6G(jSV9IKnemH7K, RlLNSsrUm3zD) if H6Aqpf9qhdEs != xafqLlk3kkUe(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9?\xfa~\x17'), '\144' + chr(0b10000 + 0o125) + '\x63' + '\157' + '\x64' + '\145')(chr(0b1110101) + chr(9931 - 9815) + chr(102) + chr(0b101101) + '\x38')): SPnCNu54H1db = SPnCNu54H1db.astype(H6Aqpf9qhdEs) elif igThHS4jwVsa: SPnCNu54H1db = SPnCNu54H1db.igThHS4jwVsa() return (SPnCNu54H1db, RlLNSsrUm3zD)
pandas-dev/pandas
pandas/core/dtypes/cast.py
invalidate_string_dtypes
def invalidate_string_dtypes(dtype_set): """Change string like dtypes to object for ``DataFrame.select_dtypes()``. """ non_string_dtypes = dtype_set - {np.dtype('S').type, np.dtype('<U').type} if non_string_dtypes != dtype_set: raise TypeError("string dtypes are not allowed, use 'object' instead")
python
def invalidate_string_dtypes(dtype_set): """Change string like dtypes to object for ``DataFrame.select_dtypes()``. """ non_string_dtypes = dtype_set - {np.dtype('S').type, np.dtype('<U').type} if non_string_dtypes != dtype_set: raise TypeError("string dtypes are not allowed, use 'object' instead")
[ "def", "invalidate_string_dtypes", "(", "dtype_set", ")", ":", "non_string_dtypes", "=", "dtype_set", "-", "{", "np", ".", "dtype", "(", "'S'", ")", ".", "type", ",", "np", ".", "dtype", "(", "'<U'", ")", ".", "type", "}", "if", "non_string_dtypes", "!=", "dtype_set", ":", "raise", "TypeError", "(", "\"string dtypes are not allowed, use 'object' instead\"", ")" ]
Change string like dtypes to object for ``DataFrame.select_dtypes()``.
[ "Change", "string", "like", "dtypes", "to", "object", "for", "DataFrame", ".", "select_dtypes", "()", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L556-L562
train
Change string like dtypes to object for .
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQ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CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(120 - 72) + '\x6f' + chr(0b11000 + 0o32) + chr(50) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1423 - 1373) + chr(902 - 849) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(646 - 598) + '\157' + chr(593 - 543) + chr(2294 - 2240) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + chr(5702 - 5591) + chr(49) + chr(970 - 922) + chr(0b10010 + 0o36), 10188 - 10180), ehT0Px3KOsy9('\060' + chr(0b11 + 0o154) + chr(1077 - 1027) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1000100 + 0o53) + chr(50) + chr(79 - 27) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + '\066' + chr(226 - 174), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(0b101100 + 0o7) + chr(48), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11 + 0o56) + chr(53) + '\x31', 0o10), ehT0Px3KOsy9(chr(1424 - 1376) + chr(0b1000011 + 0o54) + chr(0b10 + 0o60) + chr(0b110110) + '\062', 8), ehT0Px3KOsy9('\060' + chr(7342 - 7231) + '\063' + '\x35' + '\x34', 0o10), ehT0Px3KOsy9(chr(978 - 930) + '\157' + chr(0b110001) + chr(0b11110 + 0o24) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(9559 - 9448) + '\061' + chr(0b110111) + chr(1614 - 1562), 38165 - 38157), ehT0Px3KOsy9(chr(1258 - 1210) + chr(1097 - 986) + chr(0b110010) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + '\x31' + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\x33' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(786 - 738) + chr(0b1101111) + '\063' + chr(0b110001) + chr(0b10100 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100001 + 0o20) + '\065' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000 + 0o147) + chr(0b110110) + chr(0b11100 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(10497 - 10386) + chr(683 - 628) + chr(0b10101 + 0o34), 32810 - 32802), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(6100 - 5989) + chr(137 - 86) + chr(0b100111 + 0o14) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b111 + 0o150) + chr(1205 - 1154) + chr(769 - 716) + chr(486 - 436), 21122 - 21114), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b100 + 0o56), 15188 - 15180), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(0b110101) + chr(214 - 165), ord("\x08")), ehT0Px3KOsy9(chr(2275 - 2227) + chr(0b100101 + 0o112) + '\x33' + '\x35' + chr(0b10111 + 0o34), 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b11110 + 0o121) + chr(1865 - 1812) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(1140 - 1087) + chr(343 - 291), 8), ehT0Px3KOsy9('\x30' + chr(1109 - 998) + chr(0b100100 + 0o17) + chr(54) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100001 + 0o116) + chr(1612 - 1561) + chr(0b110101) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(0b1010 + 0o55), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011111 + 0o20) + chr(0b110011) + '\x31' + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + '\x32' + chr(0b101110 + 0o7) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5607 - 5496) + '\062' + chr(0b110000) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b110110 + 0o71) + '\061' + '\x30' + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b110010) + '\067', 26061 - 26053), ehT0Px3KOsy9(chr(48) + chr(2881 - 2770) + '\061' + chr(0b110011) + chr(2431 - 2377), 55722 - 55714), ehT0Px3KOsy9('\060' + '\x6f' + '\x34' + chr(342 - 290), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110100) + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(0b10010 + 0o37) + chr(0b101100 + 0o4), 8), ehT0Px3KOsy9('\060' + chr(0b1101111 + 0o0) + chr(50) + chr(200 - 147), 25725 - 25717)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1141 - 1093) + chr(0b101100 + 0o103) + chr(0b110101) + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe'), chr(0b1100100) + '\145' + '\x63' + chr(0b111001 + 0o66) + chr(0b10011 + 0o121) + chr(7610 - 7509))(chr(117) + chr(0b1010100 + 0o40) + chr(0b1100110) + chr(0b101101) + chr(0b11111 + 0o31)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def S0ouKFlIlp1k(nU32U6T1LFmT): WMafKQmwI86c = nU32U6T1LFmT - {WqUC3KWvYVup.dtype(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3'), '\144' + chr(0b1100101) + chr(0b11010 + 0o111) + chr(0b111100 + 0o63) + chr(100) + chr(0b1100101))(chr(7365 - 7248) + chr(0b1110100) + '\x66' + chr(45) + chr(0b10011 + 0o45))).type, WqUC3KWvYVup.dtype(xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\xf9'), '\x64' + chr(0b1100101) + chr(99) + '\x6f' + chr(100) + chr(101))(chr(0b1110101) + chr(9457 - 9341) + chr(0b1100110) + chr(45) + chr(0b111000))).type} if WMafKQmwI86c != nU32U6T1LFmT: raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3\xd8\xc0)y\xc0\x94\xbc\x1d\xcb\x9c7\x0f2\xed)\xadK]V\xae\xca{\xc5\x87@\x9b\x95\x8c+\xee\xd8\xf0"\xf7yKG\xa2p\xf3\xd8\x95`~\xc9\xc7\xac\x0c\xd3\x88'), chr(0b1100100) + chr(101) + '\143' + '\x6f' + '\144' + chr(101))('\165' + chr(0b1 + 0o163) + '\x66' + chr(0b101101) + chr(0b11 + 0o65)))
pandas-dev/pandas
pandas/core/dtypes/cast.py
coerce_indexer_dtype
def coerce_indexer_dtype(indexer, categories): """ coerce the indexer input array to the smallest dtype possible """ length = len(categories) if length < _int8_max: return ensure_int8(indexer) elif length < _int16_max: return ensure_int16(indexer) elif length < _int32_max: return ensure_int32(indexer) return ensure_int64(indexer)
python
def coerce_indexer_dtype(indexer, categories): """ coerce the indexer input array to the smallest dtype possible """ length = len(categories) if length < _int8_max: return ensure_int8(indexer) elif length < _int16_max: return ensure_int16(indexer) elif length < _int32_max: return ensure_int32(indexer) return ensure_int64(indexer)
[ "def", "coerce_indexer_dtype", "(", "indexer", ",", "categories", ")", ":", "length", "=", "len", "(", "categories", ")", "if", "length", "<", "_int8_max", ":", "return", "ensure_int8", "(", "indexer", ")", "elif", "length", "<", "_int16_max", ":", "return", "ensure_int16", "(", "indexer", ")", "elif", "length", "<", "_int32_max", ":", "return", "ensure_int32", "(", "indexer", ")", "return", "ensure_int64", "(", "indexer", ")" ]
coerce the indexer input array to the smallest dtype possible
[ "coerce", "the", "indexer", "input", "array", "to", "the", "smallest", "dtype", "possible" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L565-L574
train
coerce the indexer input array to the smallest dtype possible
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,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NiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + chr(0b110010) + chr(0b110100), 63013 - 63005), ehT0Px3KOsy9(chr(1618 - 1570) + chr(7556 - 7445) + chr(1876 - 1823) + chr(0b1011 + 0o47), 46150 - 46142), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(470 - 421) + chr(0b10011 + 0o36), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(1197 - 1144) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b110000) + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(52) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(1026 - 977) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8454 - 8343) + chr(0b110001) + '\060' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(792 - 742) + '\x36' + chr(53), 42138 - 42130), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(895 - 844) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + '\066' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(336 - 288) + '\157' + chr(49) + chr(1621 - 1572) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b100110 + 0o20) + '\x35', 8), ehT0Px3KOsy9(chr(48) + chr(0b11000 + 0o127) + chr(0b110110) + chr(0b100 + 0o56), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(73 - 18) + chr(2122 - 2072), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(0b110111) + chr(0b110110), 48797 - 48789), ehT0Px3KOsy9(chr(1251 - 1203) + '\157' + chr(0b111 + 0o52) + '\x35' + chr(0b10110 + 0o40), 26002 - 25994), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(1371 - 1322) + chr(2634 - 2579), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + chr(0b100001 + 0o25) + chr(582 - 528), ord("\x08")), ehT0Px3KOsy9(chr(829 - 781) + chr(111) + '\063' + '\064' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10 + 0o57) + chr(0b110110) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1101111) + '\066' + '\065', 47422 - 47414), ehT0Px3KOsy9('\x30' + chr(6048 - 5937) + chr(0b110001) + chr(0b101011 + 0o11) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(54) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(2673 - 2562) + '\062' + '\063' + chr(0b101101 + 0o4), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + '\060' + chr(55), 54423 - 54415), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1001101 + 0o42) + '\064' + chr(0b11001 + 0o27), 8242 - 8234), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + chr(0b100111 + 0o20) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + '\062' + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + chr(0b11010 + 0o30) + chr(0b11011 + 0o32) + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(52), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110110) + '\x34', 0o10), ehT0Px3KOsy9(chr(441 - 393) + '\x6f' + '\x32' + chr(1455 - 1406) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(54) + chr(1429 - 1380), 38943 - 38935), ehT0Px3KOsy9(chr(48) + chr(0b11 + 0o154) + chr(0b101011 + 0o6) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(2421 - 2371) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(2420 - 2365), 2549 - 2541), ehT0Px3KOsy9(chr(1689 - 1641) + '\157' + '\x32' + '\065' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + chr(51) + chr(1549 - 1500) + '\x34', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b111011 + 0o64) + chr(0b110011 + 0o2) + chr(0b11111 + 0o21), 13775 - 13767)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b':'), '\144' + chr(101) + '\x63' + chr(0b1101111) + '\x64' + '\x65')(chr(117) + chr(0b1100111 + 0o15) + chr(0b1100110) + chr(1700 - 1655) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def IhoUBFeIAvnv(BvJfssszZMhp, mZZDAT49UzAb): CHAOgk5VCHH_ = c2A0yzQpDQB3(mZZDAT49UzAb) if CHAOgk5VCHH_ < QpPu2DLO1hgY: return GbUdSRd1aN9u(BvJfssszZMhp) elif CHAOgk5VCHH_ < ms5WZ2Hu3FO7: return LLtIFxoEAXeb(BvJfssszZMhp) elif CHAOgk5VCHH_ < zWd8ApOTJGRH: return IkYWtcjOGBEn(BvJfssszZMhp) return AZPeOKsfRpRQ(BvJfssszZMhp)
pandas-dev/pandas
pandas/core/dtypes/cast.py
coerce_to_dtypes
def coerce_to_dtypes(result, dtypes): """ given a dtypes and a result set, coerce the result elements to the dtypes """ if len(result) != len(dtypes): raise AssertionError("_coerce_to_dtypes requires equal len arrays") def conv(r, dtype): try: if isna(r): pass elif dtype == _NS_DTYPE: r = tslibs.Timestamp(r) elif dtype == _TD_DTYPE: r = tslibs.Timedelta(r) elif dtype == np.bool_: # messy. non 0/1 integers do not get converted. if is_integer(r) and r not in [0, 1]: return int(r) r = bool(r) elif dtype.kind == 'f': r = float(r) elif dtype.kind == 'i': r = int(r) except Exception: pass return r return [conv(r, dtype) for r, dtype in zip(result, dtypes)]
python
def coerce_to_dtypes(result, dtypes): """ given a dtypes and a result set, coerce the result elements to the dtypes """ if len(result) != len(dtypes): raise AssertionError("_coerce_to_dtypes requires equal len arrays") def conv(r, dtype): try: if isna(r): pass elif dtype == _NS_DTYPE: r = tslibs.Timestamp(r) elif dtype == _TD_DTYPE: r = tslibs.Timedelta(r) elif dtype == np.bool_: # messy. non 0/1 integers do not get converted. if is_integer(r) and r not in [0, 1]: return int(r) r = bool(r) elif dtype.kind == 'f': r = float(r) elif dtype.kind == 'i': r = int(r) except Exception: pass return r return [conv(r, dtype) for r, dtype in zip(result, dtypes)]
[ "def", "coerce_to_dtypes", "(", "result", ",", "dtypes", ")", ":", "if", "len", "(", "result", ")", "!=", "len", "(", "dtypes", ")", ":", "raise", "AssertionError", "(", "\"_coerce_to_dtypes requires equal len arrays\"", ")", "def", "conv", "(", "r", ",", "dtype", ")", ":", "try", ":", "if", "isna", "(", "r", ")", ":", "pass", "elif", "dtype", "==", "_NS_DTYPE", ":", "r", "=", "tslibs", ".", "Timestamp", "(", "r", ")", "elif", "dtype", "==", "_TD_DTYPE", ":", "r", "=", "tslibs", ".", "Timedelta", "(", "r", ")", "elif", "dtype", "==", "np", ".", "bool_", ":", "# messy. non 0/1 integers do not get converted.", "if", "is_integer", "(", "r", ")", "and", "r", "not", "in", "[", "0", ",", "1", "]", ":", "return", "int", "(", "r", ")", "r", "=", "bool", "(", "r", ")", "elif", "dtype", ".", "kind", "==", "'f'", ":", "r", "=", "float", "(", "r", ")", "elif", "dtype", ".", "kind", "==", "'i'", ":", "r", "=", "int", "(", "r", ")", "except", "Exception", ":", "pass", "return", "r", "return", "[", "conv", "(", "r", ",", "dtype", ")", "for", "r", ",", "dtype", "in", "zip", "(", "result", ",", "dtypes", ")", "]" ]
given a dtypes and a result set, coerce the result elements to the dtypes
[ "given", "a", "dtypes", "and", "a", "result", "set", "coerce", "the", "result", "elements", "to", "the", "dtypes" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L577-L607
train
Coerce the result elements to the dtypes and a result set.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYic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TYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11001 + 0o30) + '\065' + chr(0b100000 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(464 - 415) + chr(610 - 561), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\062' + chr(2236 - 2185), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1000 - 951) + chr(51) + chr(0b101010 + 0o7), 39346 - 39338), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(8728 - 8617) + '\061' + chr(51) + '\061', 8), ehT0Px3KOsy9(chr(190 - 142) + chr(3702 - 3591) + chr(0b110001) + chr(0b110011) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(817 - 767) + '\x32', 0o10), ehT0Px3KOsy9(chr(992 - 944) + '\x6f' + chr(641 - 591) + chr(0b100010 + 0o16) + chr(107 - 53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(10497 - 10386) + '\063' + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101101 + 0o2) + '\061' + '\065' + chr(0b11111 + 0o24), 60662 - 60654), ehT0Px3KOsy9('\x30' + chr(7547 - 7436) + chr(55) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(53) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10124 - 10013) + chr(293 - 239) + '\x34', 0o10), ehT0Px3KOsy9(chr(2242 - 2194) + chr(111) + chr(1773 - 1724) + chr(0b10101 + 0o34) + chr(0b101010 + 0o12), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b0 + 0o61) + chr(0b110101) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1 + 0o156) + chr(51) + chr(2706 - 2652), 0b1000), ehT0Px3KOsy9(chr(832 - 784) + '\157' + chr(0b101111 + 0o10) + chr(0b0 + 0o61), 44386 - 44378), ehT0Px3KOsy9(chr(390 - 342) + chr(0b1011100 + 0o23) + chr(316 - 267) + chr(747 - 696) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1 + 0o156) + chr(1970 - 1919) + '\060' + chr(0b100111 + 0o20), 49495 - 49487), ehT0Px3KOsy9(chr(0b110000) + chr(4279 - 4168) + chr(2231 - 2180) + '\x33' + chr(0b100011 + 0o23), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + '\063' + '\x30' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1100101 + 0o12) + '\x31' + chr(2093 - 2042) + '\062', 730 - 722), ehT0Px3KOsy9(chr(399 - 351) + chr(0b1101111) + '\x31' + chr(48) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b111010 + 0o65) + '\x31' + chr(0b110100 + 0o1) + chr(54), 18228 - 18220), ehT0Px3KOsy9('\060' + '\157' + chr(0b1 + 0o61) + chr(55) + chr(0b11001 + 0o30), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\063' + '\x32', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + '\x31' + chr(54), 5047 - 5039), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + chr(1331 - 1281) + '\x36' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(1913 - 1865) + '\157' + chr(450 - 399) + chr(52) + '\x37', 27313 - 27305), ehT0Px3KOsy9('\060' + chr(0b10000 + 0o137) + chr(0b10101 + 0o34) + chr(0b110000) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b100001 + 0o25) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + '\064' + chr(55), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11111 + 0o23) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1000111 + 0o50) + '\062' + chr(55) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(12295 - 12184) + '\x31' + chr(0b1110 + 0o46) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + '\x32' + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(0b101111 + 0o1) + chr(0b101010 + 0o11), 4396 - 4388), ehT0Px3KOsy9(chr(0b110000) + chr(5363 - 5252) + '\063' + '\x32' + chr(219 - 167), 0o10), ehT0Px3KOsy9(chr(1065 - 1017) + chr(111) + chr(926 - 877) + '\x34' + chr(749 - 694), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(9320 - 9209) + chr(0b110101) + '\x30', 40013 - 40005)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'G'), '\144' + chr(6572 - 6471) + '\143' + '\157' + '\x64' + chr(0b1100101))('\165' + chr(0b1110100) + '\146' + chr(0b10110 + 0o27) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def cBAjaDRXl5EL(ShZmEKfTkAOZ, povqwBfbr44M): if c2A0yzQpDQB3(ShZmEKfTkAOZ) != c2A0yzQpDQB3(povqwBfbr44M): raise vcEHXBQXuDuh(xafqLlk3kkUe(SXOLrMavuUCe(b'6j\xfc<+;7\xd9h\x04as\xdaM<\x08m\x19/\xa2\xaf\xb035\x0b\xcaz+\xc5\x92#\xdb\xc7~\xde\n\xb4\xa2\xa6\x15\x08p\xe0'), chr(2318 - 2218) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(0b100011 + 0o101) + chr(0b1100101))(chr(0b1110101) + chr(4504 - 4388) + chr(0b1100110) + '\055' + '\070')) def m1sWr00SVpVY(JWG5qApaeJkp, jSV9IKnemH7K): try: if yBUx5qcFiTz6(JWG5qApaeJkp): pass elif jSV9IKnemH7K == NTDhEo0ZZwai: JWG5qApaeJkp = oBknBeXuTNVm.Timestamp(JWG5qApaeJkp) elif jSV9IKnemH7K == AMHqSK4wRc2k: JWG5qApaeJkp = oBknBeXuTNVm.Timedelta(JWG5qApaeJkp) elif jSV9IKnemH7K == xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0bf\xfc5\x06'), chr(0b1100100) + '\x65' + chr(99) + chr(0b10001 + 0o136) + '\144' + chr(0b11000 + 0o115))(chr(10405 - 10288) + chr(116) + chr(4325 - 4223) + chr(0b101101) + chr(0b111000))): if _Et3xS6KnOuP(JWG5qApaeJkp) and JWG5qApaeJkp not in [ehT0Px3KOsy9('\x30' + '\157' + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001 + 0o0), 51086 - 51078)]: return ehT0Px3KOsy9(JWG5qApaeJkp) JWG5qApaeJkp = WbBjf8Y7v9VN(JWG5qApaeJkp) elif xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\x02`\xfd='), chr(7296 - 7196) + chr(2918 - 2817) + chr(99) + '\x6f' + chr(0b111111 + 0o45) + '\145')(chr(7287 - 7170) + chr(11677 - 11561) + '\146' + '\055' + chr(1694 - 1638))) == xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f'), chr(100) + chr(8668 - 8567) + '\x63' + chr(0b111 + 0o150) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b1001101 + 0o47) + chr(0b111000 + 0o56) + chr(45) + '\070'): JWG5qApaeJkp = kkSX4ccExqw4(JWG5qApaeJkp) elif xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\x02`\xfd='), '\144' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(8227 - 8126))(chr(117) + chr(116) + '\x66' + '\x2d' + chr(2098 - 2042))) == xafqLlk3kkUe(SXOLrMavuUCe(b'\x00'), '\x64' + '\145' + chr(0b1100011) + '\x6f' + '\144' + chr(8193 - 8092))('\165' + chr(9304 - 9188) + chr(4006 - 3904) + chr(45) + chr(0b111000)): JWG5qApaeJkp = ehT0Px3KOsy9(JWG5qApaeJkp) except jLmadlzMdunT: pass return JWG5qApaeJkp return [m1sWr00SVpVY(JWG5qApaeJkp, jSV9IKnemH7K) for (JWG5qApaeJkp, jSV9IKnemH7K) in pZ0NK2y6HRbn(ShZmEKfTkAOZ, povqwBfbr44M)]
pandas-dev/pandas
pandas/core/dtypes/cast.py
astype_nansafe
def astype_nansafe(arr, dtype, copy=True, skipna=False): """ Cast the elements of an array to a given dtype a nan-safe manner. Parameters ---------- arr : ndarray dtype : np.dtype copy : bool, default True If False, a view will be attempted but may fail, if e.g. the item sizes don't align. skipna: bool, default False Whether or not we should skip NaN when casting as a string-type. Raises ------ ValueError The dtype was a datetime64/timedelta64 dtype, but it had no unit. """ # dispatch on extension dtype if needed if is_extension_array_dtype(dtype): return dtype.construct_array_type()._from_sequence( arr, dtype=dtype, copy=copy) if not isinstance(dtype, np.dtype): dtype = pandas_dtype(dtype) if issubclass(dtype.type, str): return lib.astype_str(arr.ravel(), skipna=skipna).reshape(arr.shape) elif is_datetime64_dtype(arr): if is_object_dtype(dtype): return tslib.ints_to_pydatetime(arr.view(np.int64)) elif dtype == np.int64: return arr.view(dtype) # allow frequency conversions if dtype.kind == 'M': return arr.astype(dtype) raise TypeError("cannot astype a datetimelike from [{from_dtype}] " "to [{to_dtype}]".format(from_dtype=arr.dtype, to_dtype=dtype)) elif is_timedelta64_dtype(arr): if is_object_dtype(dtype): return tslibs.ints_to_pytimedelta(arr.view(np.int64)) elif dtype == np.int64: return arr.view(dtype) if dtype not in [_INT64_DTYPE, _TD_DTYPE]: # allow frequency conversions # we return a float here! if dtype.kind == 'm': mask = isna(arr) result = arr.astype(dtype).astype(np.float64) result[mask] = np.nan return result elif dtype == _TD_DTYPE: return arr.astype(_TD_DTYPE, copy=copy) raise TypeError("cannot astype a timedelta from [{from_dtype}] " "to [{to_dtype}]".format(from_dtype=arr.dtype, to_dtype=dtype)) elif (np.issubdtype(arr.dtype, np.floating) and np.issubdtype(dtype, np.integer)): if not np.isfinite(arr).all(): raise ValueError('Cannot convert non-finite values (NA or inf) to ' 'integer') elif is_object_dtype(arr): # work around NumPy brokenness, #1987 if np.issubdtype(dtype.type, np.integer): return lib.astype_intsafe(arr.ravel(), dtype).reshape(arr.shape) # if we have a datetime/timedelta array of objects # then coerce to a proper dtype and recall astype_nansafe elif is_datetime64_dtype(dtype): from pandas import to_datetime return astype_nansafe(to_datetime(arr).values, dtype, copy=copy) elif is_timedelta64_dtype(dtype): from pandas import to_timedelta return astype_nansafe(to_timedelta(arr).values, dtype, copy=copy) if dtype.name in ("datetime64", "timedelta64"): msg = ("The '{dtype}' dtype has no unit. " "Please pass in '{dtype}[ns]' instead.") raise ValueError(msg.format(dtype=dtype.name)) if copy or is_object_dtype(arr) or is_object_dtype(dtype): # Explicit copy, or required since NumPy can't view from / to object. return arr.astype(dtype, copy=True) return arr.view(dtype)
python
def astype_nansafe(arr, dtype, copy=True, skipna=False): """ Cast the elements of an array to a given dtype a nan-safe manner. Parameters ---------- arr : ndarray dtype : np.dtype copy : bool, default True If False, a view will be attempted but may fail, if e.g. the item sizes don't align. skipna: bool, default False Whether or not we should skip NaN when casting as a string-type. Raises ------ ValueError The dtype was a datetime64/timedelta64 dtype, but it had no unit. """ # dispatch on extension dtype if needed if is_extension_array_dtype(dtype): return dtype.construct_array_type()._from_sequence( arr, dtype=dtype, copy=copy) if not isinstance(dtype, np.dtype): dtype = pandas_dtype(dtype) if issubclass(dtype.type, str): return lib.astype_str(arr.ravel(), skipna=skipna).reshape(arr.shape) elif is_datetime64_dtype(arr): if is_object_dtype(dtype): return tslib.ints_to_pydatetime(arr.view(np.int64)) elif dtype == np.int64: return arr.view(dtype) # allow frequency conversions if dtype.kind == 'M': return arr.astype(dtype) raise TypeError("cannot astype a datetimelike from [{from_dtype}] " "to [{to_dtype}]".format(from_dtype=arr.dtype, to_dtype=dtype)) elif is_timedelta64_dtype(arr): if is_object_dtype(dtype): return tslibs.ints_to_pytimedelta(arr.view(np.int64)) elif dtype == np.int64: return arr.view(dtype) if dtype not in [_INT64_DTYPE, _TD_DTYPE]: # allow frequency conversions # we return a float here! if dtype.kind == 'm': mask = isna(arr) result = arr.astype(dtype).astype(np.float64) result[mask] = np.nan return result elif dtype == _TD_DTYPE: return arr.astype(_TD_DTYPE, copy=copy) raise TypeError("cannot astype a timedelta from [{from_dtype}] " "to [{to_dtype}]".format(from_dtype=arr.dtype, to_dtype=dtype)) elif (np.issubdtype(arr.dtype, np.floating) and np.issubdtype(dtype, np.integer)): if not np.isfinite(arr).all(): raise ValueError('Cannot convert non-finite values (NA or inf) to ' 'integer') elif is_object_dtype(arr): # work around NumPy brokenness, #1987 if np.issubdtype(dtype.type, np.integer): return lib.astype_intsafe(arr.ravel(), dtype).reshape(arr.shape) # if we have a datetime/timedelta array of objects # then coerce to a proper dtype and recall astype_nansafe elif is_datetime64_dtype(dtype): from pandas import to_datetime return astype_nansafe(to_datetime(arr).values, dtype, copy=copy) elif is_timedelta64_dtype(dtype): from pandas import to_timedelta return astype_nansafe(to_timedelta(arr).values, dtype, copy=copy) if dtype.name in ("datetime64", "timedelta64"): msg = ("The '{dtype}' dtype has no unit. " "Please pass in '{dtype}[ns]' instead.") raise ValueError(msg.format(dtype=dtype.name)) if copy or is_object_dtype(arr) or is_object_dtype(dtype): # Explicit copy, or required since NumPy can't view from / to object. return arr.astype(dtype, copy=True) return arr.view(dtype)
[ "def", "astype_nansafe", "(", "arr", ",", "dtype", ",", "copy", "=", "True", ",", "skipna", "=", "False", ")", ":", "# dispatch on extension dtype if needed", "if", "is_extension_array_dtype", "(", "dtype", ")", ":", "return", "dtype", ".", "construct_array_type", "(", ")", ".", "_from_sequence", "(", "arr", ",", "dtype", "=", "dtype", ",", "copy", "=", "copy", ")", "if", "not", "isinstance", "(", "dtype", ",", "np", ".", "dtype", ")", ":", "dtype", "=", "pandas_dtype", "(", "dtype", ")", "if", "issubclass", "(", "dtype", ".", "type", ",", "str", ")", ":", "return", "lib", ".", "astype_str", "(", "arr", ".", "ravel", "(", ")", ",", "skipna", "=", "skipna", ")", ".", "reshape", "(", "arr", ".", "shape", ")", "elif", "is_datetime64_dtype", "(", "arr", ")", ":", "if", "is_object_dtype", "(", "dtype", ")", ":", "return", "tslib", ".", "ints_to_pydatetime", "(", "arr", ".", "view", "(", "np", ".", "int64", ")", ")", "elif", "dtype", "==", "np", ".", "int64", ":", "return", "arr", ".", "view", "(", "dtype", ")", "# allow frequency conversions", "if", "dtype", ".", "kind", "==", "'M'", ":", "return", "arr", ".", "astype", "(", "dtype", ")", "raise", "TypeError", "(", "\"cannot astype a datetimelike from [{from_dtype}] \"", "\"to [{to_dtype}]\"", ".", "format", "(", "from_dtype", "=", "arr", ".", "dtype", ",", "to_dtype", "=", "dtype", ")", ")", "elif", "is_timedelta64_dtype", "(", "arr", ")", ":", "if", "is_object_dtype", "(", "dtype", ")", ":", "return", "tslibs", ".", "ints_to_pytimedelta", "(", "arr", ".", "view", "(", "np", ".", "int64", ")", ")", "elif", "dtype", "==", "np", ".", "int64", ":", "return", "arr", ".", "view", "(", "dtype", ")", "if", "dtype", "not", "in", "[", "_INT64_DTYPE", ",", "_TD_DTYPE", "]", ":", "# allow frequency conversions", "# we return a float here!", "if", "dtype", ".", "kind", "==", "'m'", ":", "mask", "=", "isna", "(", "arr", ")", "result", "=", "arr", ".", "astype", "(", "dtype", ")", ".", "astype", "(", "np", ".", "float64", ")", "result", "[", "mask", "]", "=", "np", ".", "nan", "return", "result", "elif", "dtype", "==", "_TD_DTYPE", ":", "return", "arr", ".", "astype", "(", "_TD_DTYPE", ",", "copy", "=", "copy", ")", "raise", "TypeError", "(", "\"cannot astype a timedelta from [{from_dtype}] \"", "\"to [{to_dtype}]\"", ".", "format", "(", "from_dtype", "=", "arr", ".", "dtype", ",", "to_dtype", "=", "dtype", ")", ")", "elif", "(", "np", ".", "issubdtype", "(", "arr", ".", "dtype", ",", "np", ".", "floating", ")", "and", "np", ".", "issubdtype", "(", "dtype", ",", "np", ".", "integer", ")", ")", ":", "if", "not", "np", ".", "isfinite", "(", "arr", ")", ".", "all", "(", ")", ":", "raise", "ValueError", "(", "'Cannot convert non-finite values (NA or inf) to '", "'integer'", ")", "elif", "is_object_dtype", "(", "arr", ")", ":", "# work around NumPy brokenness, #1987", "if", "np", ".", "issubdtype", "(", "dtype", ".", "type", ",", "np", ".", "integer", ")", ":", "return", "lib", ".", "astype_intsafe", "(", "arr", ".", "ravel", "(", ")", ",", "dtype", ")", ".", "reshape", "(", "arr", ".", "shape", ")", "# if we have a datetime/timedelta array of objects", "# then coerce to a proper dtype and recall astype_nansafe", "elif", "is_datetime64_dtype", "(", "dtype", ")", ":", "from", "pandas", "import", "to_datetime", "return", "astype_nansafe", "(", "to_datetime", "(", "arr", ")", ".", "values", ",", "dtype", ",", "copy", "=", "copy", ")", "elif", "is_timedelta64_dtype", "(", "dtype", ")", ":", "from", "pandas", "import", "to_timedelta", "return", "astype_nansafe", "(", "to_timedelta", "(", "arr", ")", ".", "values", ",", "dtype", ",", "copy", "=", "copy", ")", "if", "dtype", ".", "name", "in", "(", "\"datetime64\"", ",", "\"timedelta64\"", ")", ":", "msg", "=", "(", "\"The '{dtype}' dtype has no unit. \"", "\"Please pass in '{dtype}[ns]' instead.\"", ")", "raise", "ValueError", "(", "msg", ".", "format", "(", "dtype", "=", "dtype", ".", "name", ")", ")", "if", "copy", "or", "is_object_dtype", "(", "arr", ")", "or", "is_object_dtype", "(", "dtype", ")", ":", "# Explicit copy, or required since NumPy can't view from / to object.", "return", "arr", ".", "astype", "(", "dtype", ",", "copy", "=", "True", ")", "return", "arr", ".", "view", "(", "dtype", ")" ]
Cast the elements of an array to a given dtype a nan-safe manner. Parameters ---------- arr : ndarray dtype : np.dtype copy : bool, default True If False, a view will be attempted but may fail, if e.g. the item sizes don't align. skipna: bool, default False Whether or not we should skip NaN when casting as a string-type. Raises ------ ValueError The dtype was a datetime64/timedelta64 dtype, but it had no unit.
[ "Cast", "the", "elements", "of", "an", "array", "to", "a", "given", "dtype", "a", "nan", "-", "safe", "manner", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L610-L710
train
Cast the elements of an array to a given dtype a nan - safe manner.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp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LC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100011 + 0o16) + chr(52) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1058 - 1009) + chr(1814 - 1762) + '\066', 30009 - 30001), ehT0Px3KOsy9('\x30' + '\157' + chr(54) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(5245 - 5134) + '\x31' + chr(0b101000 + 0o11) + chr(0b10000 + 0o40), 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1000 + 0o147) + chr(647 - 597) + '\x32' + chr(0b110010 + 0o0), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1110 + 0o45) + chr(1941 - 1892) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b100111 + 0o110) + '\061' + chr(0b11110 + 0o30) + chr(314 - 262), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b110010 + 0o1) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100000 + 0o117) + chr(50) + '\x31' + chr(381 - 333), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\x35' + chr(399 - 347), ord("\x08")), ehT0Px3KOsy9(chr(1080 - 1032) + chr(700 - 589) + chr(0b110001) + '\x32' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100111 + 0o12) + '\064' + '\x36', 8), ehT0Px3KOsy9(chr(1508 - 1460) + '\157' + chr(0b110010) + '\x35' + '\x30', 0o10), ehT0Px3KOsy9(chr(2120 - 2072) + chr(0b1101111) + chr(55), 53570 - 53562), ehT0Px3KOsy9(chr(290 - 242) + chr(111) + chr(1985 - 1934) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(4010 - 3899) + chr(50) + chr(0b110011 + 0o0) + chr(0b11001 + 0o33), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000011 + 0o54) + '\x32' + chr(52), 44901 - 44893), ehT0Px3KOsy9(chr(360 - 312) + '\157' + chr(0b100110 + 0o14) + chr(0b10000 + 0o40), 63576 - 63568), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10100 + 0o35) + chr(723 - 668) + chr(0b100111 + 0o11), 2580 - 2572), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\x37' + chr(0b1100 + 0o50), 0o10), ehT0Px3KOsy9(chr(261 - 213) + chr(111) + chr(0b1000 + 0o52) + chr(0b110110) + '\x32', 38670 - 38662), ehT0Px3KOsy9(chr(1039 - 991) + chr(0b1100100 + 0o13) + chr(2347 - 2295) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(2348 - 2298) + '\062' + chr(50), 8), ehT0Px3KOsy9('\x30' + chr(11291 - 11180) + chr(0b110001) + chr(2146 - 2095) + '\x33', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(49) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + '\x33' + chr(0b100100 + 0o22) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(111) + chr(0b101110 + 0o5) + chr(54) + chr(2396 - 2344), 21050 - 21042), ehT0Px3KOsy9('\x30' + chr(0b110110 + 0o71) + '\x31' + '\066' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110100) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b100001 + 0o22) + '\x37' + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b101 + 0o57) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(161 - 111) + chr(48) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(9921 - 9810) + '\x36' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\x31' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\x34' + chr(0b110110), 8), ehT0Px3KOsy9(chr(1696 - 1648) + '\x6f' + '\062' + chr(0b101011 + 0o7) + chr(0b110010), 8), ehT0Px3KOsy9('\x30' + chr(9215 - 9104) + '\062' + chr(0b11011 + 0o31) + chr(1506 - 1454), 12551 - 12543), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b0 + 0o63) + chr(50) + chr(160 - 111), ord("\x08")), ehT0Px3KOsy9(chr(1329 - 1281) + chr(8279 - 8168) + chr(49) + '\060' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(0b110011) + chr(1938 - 1886), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10 + 0o63) + chr(0b0 + 0o60), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'N'), '\x64' + chr(101) + '\x63' + chr(0b100011 + 0o114) + '\144' + '\145')('\x75' + '\164' + chr(6429 - 6327) + chr(1083 - 1038) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ohhH0MLTXIg1(ZxkNvNvuRNy5, jSV9IKnemH7K, igThHS4jwVsa=ehT0Px3KOsy9(chr(980 - 932) + '\157' + '\061', 10218 - 10210), YLCdgpr_ZbeP=ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(269 - 221), 0o10)): if BeeaaSlTfmO2(jSV9IKnemH7K): return xafqLlk3kkUe(jSV9IKnemH7K.construct_array_type(), xafqLlk3kkUe(SXOLrMavuUCe(b"?\x00@'\xff\x91\x07\xf9\xf9\xd92\x08\xcbb"), chr(100) + chr(0b11110 + 0o107) + '\143' + '\157' + '\x64' + chr(101))(chr(0b1011001 + 0o34) + chr(116) + chr(0b1100110) + chr(0b101010 + 0o3) + '\x38'))(ZxkNvNvuRNy5, dtype=jSV9IKnemH7K, copy=igThHS4jwVsa) if not PlSM16l2KDPD(jSV9IKnemH7K, xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\x12K8\xf7'), chr(100) + '\x65' + '\143' + chr(0b1101111) + '\144' + chr(0b111100 + 0o51))(chr(0b1100000 + 0o25) + chr(0b1110100) + chr(102) + '\x2d' + '\x38'))): jSV9IKnemH7K = ztkhtLN5RyzB(jSV9IKnemH7K) if J6u1YyThfhgG(xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\x1fB-'), chr(0b1100100) + chr(0b101101 + 0o70) + chr(2335 - 2236) + chr(0b1011111 + 0o20) + chr(0b1100010 + 0o2) + '\x65')('\x75' + '\164' + chr(102) + chr(0b101101) + chr(0b111000))), M8_cKLkHVB2V): return xafqLlk3kkUe(JiWVXlj3BjzT.astype_str(ZxkNvNvuRNy5.ravel(), skipna=YLCdgpr_ZbeP), xafqLlk3kkUe(SXOLrMavuUCe(b'\x12\x03A \xf3\xbe\x11'), chr(0b101101 + 0o67) + chr(8931 - 8830) + chr(6642 - 6543) + '\157' + chr(1385 - 1285) + chr(101))('\165' + chr(116) + chr(0b1000111 + 0o37) + '\055' + chr(0b101001 + 0o17)))(xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x13\x0eS8\xf7'), chr(8439 - 8339) + chr(101) + chr(0b1001111 + 0o24) + chr(0b1101111) + '\144' + chr(4456 - 4355))('\165' + chr(0b1110100) + chr(0b101100 + 0o72) + '\055' + chr(0b1001 + 0o57)))) elif o97MkxKQGNoK(ZxkNvNvuRNy5): if NGkWsclKfnpq(jSV9IKnemH7K): return xafqLlk3kkUe(vNWoJjphZK5I, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x08F;\xcd\xba\x1b\xc3\xf8\xd53\x07\xdcbj\xf5yu'), '\x64' + chr(101) + chr(0b1100011) + chr(772 - 661) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(116) + '\146' + '\x2d' + '\070'))(xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\x0fW?'), chr(0b10000 + 0o124) + chr(0b1000000 + 0o45) + '\x63' + chr(6408 - 6297) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(0b101011 + 0o2) + chr(0b111000)))(xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x08F~\xa6'), '\x64' + '\145' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(6712 - 6595) + chr(0b11100 + 0o130) + chr(5811 - 5709) + chr(0b101101) + chr(56))))) elif jSV9IKnemH7K == xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x08F~\xa6'), '\144' + chr(0b101101 + 0o70) + chr(99) + '\157' + '\144' + '\x65')('\x75' + chr(0b1000 + 0o154) + chr(102) + chr(1514 - 1469) + chr(0b111000))): return xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\x0fW?'), '\x64' + chr(0b1100101) + '\143' + chr(4806 - 4695) + chr(0b1100100) + '\145')(chr(0b110010 + 0o103) + chr(5145 - 5029) + chr(0b1100001 + 0o5) + '\055' + chr(56)))(jSV9IKnemH7K) if xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0b\x0f\\,'), '\144' + '\x65' + chr(99) + chr(0b1101111) + chr(846 - 746) + chr(9669 - 9568))('\165' + chr(2172 - 2056) + chr(761 - 659) + chr(0b101101) + '\x38')) == xafqLlk3kkUe(SXOLrMavuUCe(b'-'), chr(100) + chr(0b1100101) + chr(99) + chr(9361 - 9250) + chr(0b1110 + 0o126) + chr(490 - 389))(chr(0b1001101 + 0o50) + chr(0b1110100) + chr(1793 - 1691) + chr(1758 - 1713) + '\x38'): return xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x01\x15F1\xe2\xab'), '\x64' + '\145' + chr(8933 - 8834) + chr(271 - 160) + '\x64' + '\x65')('\165' + chr(3408 - 3292) + chr(0b1111 + 0o127) + chr(0b101101) + chr(0b11101 + 0o33)))(jSV9IKnemH7K) raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\x03\x07\\&\xfd\xbaT\xfd\xfb\xd8.\x16\xcd'\x7f\xbcpq\x0c\xd9\xc6O\xff>\xe1\x99\x9f\x12\x05\x9f\xd3\xeb^\xab=\xe9\xc2\xa3-\xf1?\x02F1\xe2\xab\t\xc1\xa8\xd88F\xf3|j\xf3Kt\x0c\xc5\xc2C\xef\x06"), chr(0b11001 + 0o113) + chr(4743 - 4642) + '\143' + chr(111) + chr(7407 - 7307) + chr(7998 - 7897))(chr(0b1110101) + chr(116) + chr(102) + '\x2d' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x06\t@%\xf3\xba'), chr(9222 - 9122) + '\145' + chr(99) + chr(3265 - 3154) + chr(0b1100100) + chr(0b1011110 + 0o7))('\x75' + chr(116) + chr(0b100001 + 0o105) + '\x2d' + chr(0b100101 + 0o23)))(from_dtype=xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\x12K8\xf7'), '\144' + '\145' + chr(99) + '\157' + chr(100) + chr(0b1000000 + 0o45))('\165' + chr(116) + chr(9760 - 9658) + chr(1704 - 1659) + '\070')), to_dtype=jSV9IKnemH7K)) elif n1ufouZS6xrY(ZxkNvNvuRNy5): if NGkWsclKfnpq(jSV9IKnemH7K): return xafqLlk3kkUe(oBknBeXuTNVm, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x08F;\xcd\xba\x1b\xc3\xf8\xd5#\x0f\xc5bz\xf9xd\x19'), chr(6219 - 6119) + '\x65' + '\x63' + chr(0b1101111) + chr(7215 - 7115) + '\145')(chr(0b11010 + 0o133) + chr(4768 - 4652) + chr(0b1001101 + 0o31) + chr(45) + chr(716 - 660)))(xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\x0fW?'), chr(0b100 + 0o140) + '\145' + chr(99) + '\157' + '\x64' + chr(0b1000011 + 0o42))(chr(117) + chr(0b111111 + 0o65) + chr(102) + '\x2d' + '\x38'))(xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x08F~\xa6'), chr(0b1100100) + chr(101) + '\x63' + chr(111) + '\144' + '\x65')(chr(3429 - 3312) + chr(0b100100 + 0o120) + chr(102) + '\055' + chr(0b111000))))) elif jSV9IKnemH7K == xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x08F~\xa6'), chr(7487 - 7387) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b100111 + 0o75) + chr(0b1100101))(chr(117) + chr(0b1011101 + 0o27) + chr(0b110 + 0o140) + chr(493 - 448) + chr(2572 - 2516))): return xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\x0fW?'), chr(8464 - 8364) + chr(0b1100101) + chr(0b101100 + 0o67) + chr(0b1101111) + chr(100) + chr(5078 - 4977))(chr(12915 - 12798) + chr(116) + chr(0b100111 + 0o77) + '\x2d' + '\x38'))(jSV9IKnemH7K) if jSV9IKnemH7K not in [lYRy66BjmPF6, AMHqSK4wRc2k]: if xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0b\x0f\\,'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b111001 + 0o66) + chr(0b101010 + 0o72) + chr(0b100100 + 0o101))('\165' + '\164' + chr(4516 - 4414) + chr(45) + '\070')) == xafqLlk3kkUe(SXOLrMavuUCe(b'\r'), chr(100) + chr(6329 - 6228) + chr(0b1100011) + chr(111) + '\x64' + '\145')(chr(117) + chr(116) + chr(0b1100110) + chr(45) + '\070'): Iz1jSgUKZDvt = yBUx5qcFiTz6(ZxkNvNvuRNy5) ShZmEKfTkAOZ = ZxkNvNvuRNy5.astype(jSV9IKnemH7K).astype(WqUC3KWvYVup.float64) ShZmEKfTkAOZ[Iz1jSgUKZDvt] = WqUC3KWvYVup.nan return ShZmEKfTkAOZ elif jSV9IKnemH7K == AMHqSK4wRc2k: return xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x01\x15F1\xe2\xab'), chr(100) + '\x65' + chr(0b1001010 + 0o31) + chr(8903 - 8792) + chr(0b1011010 + 0o12) + '\145')(chr(0b110010 + 0o103) + chr(0b1110100) + chr(102) + '\055' + chr(56)))(AMHqSK4wRc2k, copy=igThHS4jwVsa) raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\x03\x07\\&\xfd\xbaT\xfd\xfb\xd8.\x16\xcd'\x7f\xbc`y\x15\xd9\xd6C\xfe/\xec\xd0\x92\x05J\x94\x81\xdfH\xed\x14\xfd\xc9\x8e&\xe8\x19\x16W5\xcf\xee\x00\xf3\xa8\xf7,\x12\xc7Xz\xe8m`\x1d\xc1\xef"), chr(0b1100100) + chr(9216 - 9115) + chr(99) + chr(3844 - 3733) + chr(0b100111 + 0o75) + chr(3593 - 3492))(chr(12924 - 12807) + chr(0b1100111 + 0o15) + chr(9233 - 9131) + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x06\t@%\xf3\xba'), '\x64' + chr(0b1100101) + '\143' + '\x6f' + '\144' + chr(0b10101 + 0o120))(chr(0b1010101 + 0o40) + '\x74' + '\146' + chr(45) + '\070'))(from_dtype=xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\x12K8\xf7'), chr(0b1100100) + '\x65' + chr(0b101 + 0o136) + chr(8907 - 8796) + chr(0b1000001 + 0o43) + chr(0b1010100 + 0o21))(chr(0b1100 + 0o151) + '\164' + chr(0b10001 + 0o125) + chr(45) + chr(56))), to_dtype=jSV9IKnemH7K)) elif xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x15A=\xf0\xaa\x00\xe5\xf8\xc9'), '\x64' + chr(731 - 630) + chr(99) + chr(0b1000100 + 0o53) + '\x64' + chr(0b1100101))(chr(0b11111 + 0o126) + chr(116) + chr(0b1100110) + chr(45) + chr(0b111000)))(xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\x12K8\xf7'), '\144' + chr(0b1100101) + '\x63' + '\157' + chr(0b1100100) + '\x65')('\x75' + chr(0b1011110 + 0o26) + chr(5771 - 5669) + chr(1146 - 1101) + '\070')), xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x06\n])\xe6\xa7\x1a\xfb'), chr(4658 - 4558) + chr(1699 - 1598) + '\143' + '\157' + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b100101 + 0o10) + '\x38'))) and xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x15A=\xf0\xaa\x00\xe5\xf8\xc9'), chr(0b1011110 + 0o6) + chr(101) + chr(99) + chr(0b1101111) + '\x64' + chr(6853 - 6752))('\x75' + chr(0b101111 + 0o105) + chr(4285 - 4183) + '\055' + chr(0b111000)))(jSV9IKnemH7K, xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x08F-\xf5\xab\x06'), chr(100) + '\145' + chr(0b1100011) + '\157' + '\144' + chr(0b11011 + 0o112))(chr(9585 - 9468) + '\x74' + '\146' + '\x2d' + chr(2062 - 2006)))): if not xafqLlk3kkUe(WqUC3KWvYVup.isfinite(ZxkNvNvuRNy5), xafqLlk3kkUe(SXOLrMavuUCe(b'$\n\x06p\xfc\xa4E\xee\xea\xc5eU'), '\x64' + chr(101) + '\143' + chr(111) + chr(0b101010 + 0o72) + chr(0b1100101))('\x75' + chr(1207 - 1091) + '\146' + chr(0b101101) + chr(56)))(): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'#\x07\\&\xfd\xbaT\xff\xe7\xc2!\x03\xdas>\xf2{~U\xda\xdbH\xfb/\xe8\xd0\x82\x16I\x8c\xc4\xf7\x13\xa3(\xd3\x84\xbe0\xbc\t\x08Ta\xb2\xba\x1b\xbc\xe1\xc2#\x03\xcfbl'), chr(0b110010 + 0o62) + '\x65' + '\x63' + '\157' + chr(0b1100100) + chr(0b10 + 0o143))(chr(0b1101001 + 0o14) + chr(116) + chr(5263 - 5161) + chr(632 - 587) + chr(787 - 731))) elif NGkWsclKfnpq(ZxkNvNvuRNy5): if xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x15A=\xf0\xaa\x00\xe5\xf8\xc9'), chr(2048 - 1948) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(0b1110101) + '\x74' + chr(0b1010 + 0o134) + '\055' + '\x38'))(xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\x1fB-'), '\144' + '\145' + '\x63' + chr(111) + chr(0b1100100) + chr(101))('\165' + '\x74' + chr(102) + '\055' + chr(2000 - 1944))), xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x08F-\xf5\xab\x06'), chr(0b1001100 + 0o30) + '\x65' + '\x63' + '\157' + chr(100) + '\x65')(chr(3971 - 3854) + '\164' + chr(102) + chr(0b101101) + chr(65 - 9)))): return xafqLlk3kkUe(JiWVXlj3BjzT.astype_intsafe(ZxkNvNvuRNy5.ravel(), jSV9IKnemH7K), xafqLlk3kkUe(SXOLrMavuUCe(b'\x12\x03A \xf3\xbe\x11'), '\144' + '\145' + chr(3194 - 3095) + '\x6f' + chr(100) + chr(7130 - 7029))(chr(117) + '\164' + chr(0b111101 + 0o51) + chr(45) + chr(0b111000)))(xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x13\x0eS8\xf7'), chr(100) + '\x65' + chr(0b1100011) + chr(0b1100011 + 0o14) + chr(100) + chr(101))('\x75' + '\164' + '\x66' + '\x2d' + chr(0b111000)))) elif o97MkxKQGNoK(jSV9IKnemH7K): (IF08dLE993_s,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x10\x07\\,\xf3\xbd'), chr(0b100 + 0o140) + '\x65' + '\x63' + '\157' + chr(0b1001 + 0o133) + chr(0b111001 + 0o54))(chr(0b1011010 + 0o33) + '\164' + '\146' + chr(45) + chr(0b110111 + 0o1)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\tm,\xf3\xba\x11\xe8\xe1\xc12'), '\144' + chr(0b1001000 + 0o35) + chr(6950 - 6851) + chr(111) + chr(0b1000100 + 0o40) + chr(8474 - 8373))('\x75' + chr(0b1110100) + chr(6909 - 6807) + '\055' + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\tm,\xf3\xba\x11\xe8\xe1\xc12'), chr(0b1001010 + 0o32) + chr(0b10001 + 0o124) + '\143' + '\x6f' + chr(7146 - 7046) + chr(0b1100 + 0o131))('\165' + chr(0b1110100) + chr(0b110111 + 0o57) + chr(0b101000 + 0o5) + chr(56))),) return ohhH0MLTXIg1(xafqLlk3kkUe(IF08dLE993_s(ZxkNvNvuRNy5), xafqLlk3kkUe(SXOLrMavuUCe(b'36\\\x0b\xdc\xbbA\xa8\xc0\x9d3\x04'), chr(100) + chr(0b1100101) + chr(99) + '\x6f' + '\144' + chr(0b1100101))(chr(0b0 + 0o165) + chr(116) + chr(0b1100110) + chr(0b11010 + 0o23) + chr(56))), jSV9IKnemH7K, copy=igThHS4jwVsa) elif n1ufouZS6xrY(jSV9IKnemH7K): (o52vswvoQUMc,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x10\x07\\,\xf3\xbd'), '\144' + '\x65' + chr(0b1100011) + chr(0b1001110 + 0o41) + chr(7336 - 7236) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(3144 - 3042) + '\x2d' + chr(0b1101 + 0o53)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\tm<\xfb\xa3\x11\xf8\xed\xc0#\x07'), '\144' + chr(101) + '\143' + chr(10243 - 10132) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(0b101 + 0o50) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\tm<\xfb\xa3\x11\xf8\xed\xc0#\x07'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(111) + '\x64' + chr(101))('\x75' + chr(0b1100100 + 0o20) + chr(200 - 98) + chr(0b1 + 0o54) + chr(624 - 568))),) return ohhH0MLTXIg1(xafqLlk3kkUe(o52vswvoQUMc(ZxkNvNvuRNy5), xafqLlk3kkUe(SXOLrMavuUCe(b'36\\\x0b\xdc\xbbA\xa8\xc0\x9d3\x04'), chr(0b1100100) + '\145' + chr(5887 - 5788) + chr(0b1101100 + 0o3) + '\144' + chr(101))('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(0b0 + 0o70))), jSV9IKnemH7K, copy=igThHS4jwVsa) if xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'!/D\x02\xc0\xb48\xf8\xcc\xca0 '), chr(0b11 + 0o141) + chr(101) + '\x63' + chr(0b1101000 + 0o7) + chr(0b10000 + 0o124) + '\x65')('\165' + chr(0b10000 + 0o144) + chr(0b111000 + 0o56) + chr(45) + chr(0b1011 + 0o55))) in (xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\x07F-\xe6\xa7\x19\xf9\xbe\x98'), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + chr(0b100101 + 0o77) + '\145')('\165' + '\x74' + '\146' + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\x0f_-\xf6\xab\x18\xe8\xe9\x9ac'), '\144' + '\145' + chr(0b1100011) + chr(0b100100 + 0o113) + '\x64' + '\x65')(chr(0b1110101) + chr(116) + '\146' + chr(462 - 417) + chr(0b111000))): jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b"4\x0eWh\xb5\xb5\x10\xe8\xf1\xdc2\x1b\x8f'z\xe8m`\x1d\x9c\xdaG\xe1{\xe3\x9f\xd4\x02K\x90\xd5\xaa\x13\xdb\n\xf7\xc5\xa2'\xbc\x10\x07A;\xb2\xa7\x1a\xbc\xaf\xd73\x12\xd1w{\xe1O~\x0b\xe1\x95\x06\xfb5\xfe\x84\x91\x16A\xd7"), '\x64' + chr(101) + '\x63' + chr(111) + chr(0b111 + 0o135) + chr(6924 - 6823))(chr(4297 - 4180) + '\164' + chr(0b1100110) + chr(725 - 680) + chr(56)) raise q1QCh3W88sgk(xafqLlk3kkUe(jtbovtaIYjRB, xafqLlk3kkUe(SXOLrMavuUCe(b'\x06\t@%\xf3\xba'), '\144' + chr(0b1001011 + 0o32) + chr(0b1100011) + chr(3425 - 3314) + '\x64' + '\x65')(chr(0b1001101 + 0o50) + chr(116) + chr(0b110101 + 0o61) + '\x2d' + '\x38'))(dtype=xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'!/D\x02\xc0\xb48\xf8\xcc\xca0 '), chr(2243 - 2143) + chr(0b1100101) + chr(706 - 607) + '\157' + chr(0b1100100) + chr(6244 - 6143))(chr(6911 - 6794) + '\x74' + chr(10112 - 10010) + chr(45) + chr(715 - 659))))) if igThHS4jwVsa or NGkWsclKfnpq(ZxkNvNvuRNy5) or NGkWsclKfnpq(jSV9IKnemH7K): return xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x01\x15F1\xe2\xab'), '\x64' + chr(7103 - 7002) + chr(99) + chr(9245 - 9134) + chr(9448 - 9348) + '\145')(chr(117) + '\x74' + chr(102) + chr(45) + chr(3045 - 2989)))(jSV9IKnemH7K, copy=ehT0Px3KOsy9(chr(1826 - 1778) + chr(11366 - 11255) + chr(49), 8)) return xafqLlk3kkUe(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\x0fW?'), '\x64' + chr(563 - 462) + chr(5320 - 5221) + chr(0b1101111) + '\144' + '\x65')(chr(117) + chr(0b1110100) + chr(0b110100 + 0o62) + chr(45) + '\x38'))(jSV9IKnemH7K)
pandas-dev/pandas
pandas/core/dtypes/cast.py
maybe_convert_objects
def maybe_convert_objects(values, convert_dates=True, convert_numeric=True, convert_timedeltas=True, copy=True): """ if we have an object dtype, try to coerce dates and/or numbers """ # if we have passed in a list or scalar if isinstance(values, (list, tuple)): values = np.array(values, dtype=np.object_) if not hasattr(values, 'dtype'): values = np.array([values], dtype=np.object_) # convert dates if convert_dates and values.dtype == np.object_: # we take an aggressive stance and convert to datetime64[ns] if convert_dates == 'coerce': new_values = maybe_cast_to_datetime( values, 'M8[ns]', errors='coerce') # if we are all nans then leave me alone if not isna(new_values).all(): values = new_values else: values = lib.maybe_convert_objects(values, convert_datetime=convert_dates) # convert timedeltas if convert_timedeltas and values.dtype == np.object_: if convert_timedeltas == 'coerce': from pandas.core.tools.timedeltas import to_timedelta new_values = to_timedelta(values, errors='coerce') # if we are all nans then leave me alone if not isna(new_values).all(): values = new_values else: values = lib.maybe_convert_objects( values, convert_timedelta=convert_timedeltas) # convert to numeric if values.dtype == np.object_: if convert_numeric: try: new_values = lib.maybe_convert_numeric(values, set(), coerce_numeric=True) # if we are all nans then leave me alone if not isna(new_values).all(): values = new_values except Exception: pass else: # soft-conversion values = lib.maybe_convert_objects(values) values = values.copy() if copy else values return values
python
def maybe_convert_objects(values, convert_dates=True, convert_numeric=True, convert_timedeltas=True, copy=True): """ if we have an object dtype, try to coerce dates and/or numbers """ # if we have passed in a list or scalar if isinstance(values, (list, tuple)): values = np.array(values, dtype=np.object_) if not hasattr(values, 'dtype'): values = np.array([values], dtype=np.object_) # convert dates if convert_dates and values.dtype == np.object_: # we take an aggressive stance and convert to datetime64[ns] if convert_dates == 'coerce': new_values = maybe_cast_to_datetime( values, 'M8[ns]', errors='coerce') # if we are all nans then leave me alone if not isna(new_values).all(): values = new_values else: values = lib.maybe_convert_objects(values, convert_datetime=convert_dates) # convert timedeltas if convert_timedeltas and values.dtype == np.object_: if convert_timedeltas == 'coerce': from pandas.core.tools.timedeltas import to_timedelta new_values = to_timedelta(values, errors='coerce') # if we are all nans then leave me alone if not isna(new_values).all(): values = new_values else: values = lib.maybe_convert_objects( values, convert_timedelta=convert_timedeltas) # convert to numeric if values.dtype == np.object_: if convert_numeric: try: new_values = lib.maybe_convert_numeric(values, set(), coerce_numeric=True) # if we are all nans then leave me alone if not isna(new_values).all(): values = new_values except Exception: pass else: # soft-conversion values = lib.maybe_convert_objects(values) values = values.copy() if copy else values return values
[ "def", "maybe_convert_objects", "(", "values", ",", "convert_dates", "=", "True", ",", "convert_numeric", "=", "True", ",", "convert_timedeltas", "=", "True", ",", "copy", "=", "True", ")", ":", "# if we have passed in a list or scalar", "if", "isinstance", "(", "values", ",", "(", "list", ",", "tuple", ")", ")", ":", "values", "=", "np", ".", "array", "(", "values", ",", "dtype", "=", "np", ".", "object_", ")", "if", "not", "hasattr", "(", "values", ",", "'dtype'", ")", ":", "values", "=", "np", ".", "array", "(", "[", "values", "]", ",", "dtype", "=", "np", ".", "object_", ")", "# convert dates", "if", "convert_dates", "and", "values", ".", "dtype", "==", "np", ".", "object_", ":", "# we take an aggressive stance and convert to datetime64[ns]", "if", "convert_dates", "==", "'coerce'", ":", "new_values", "=", "maybe_cast_to_datetime", "(", "values", ",", "'M8[ns]'", ",", "errors", "=", "'coerce'", ")", "# if we are all nans then leave me alone", "if", "not", "isna", "(", "new_values", ")", ".", "all", "(", ")", ":", "values", "=", "new_values", "else", ":", "values", "=", "lib", ".", "maybe_convert_objects", "(", "values", ",", "convert_datetime", "=", "convert_dates", ")", "# convert timedeltas", "if", "convert_timedeltas", "and", "values", ".", "dtype", "==", "np", ".", "object_", ":", "if", "convert_timedeltas", "==", "'coerce'", ":", "from", "pandas", ".", "core", ".", "tools", ".", "timedeltas", "import", "to_timedelta", "new_values", "=", "to_timedelta", "(", "values", ",", "errors", "=", "'coerce'", ")", "# if we are all nans then leave me alone", "if", "not", "isna", "(", "new_values", ")", ".", "all", "(", ")", ":", "values", "=", "new_values", "else", ":", "values", "=", "lib", ".", "maybe_convert_objects", "(", "values", ",", "convert_timedelta", "=", "convert_timedeltas", ")", "# convert to numeric", "if", "values", ".", "dtype", "==", "np", ".", "object_", ":", "if", "convert_numeric", ":", "try", ":", "new_values", "=", "lib", ".", "maybe_convert_numeric", "(", "values", ",", "set", "(", ")", ",", "coerce_numeric", "=", "True", ")", "# if we are all nans then leave me alone", "if", "not", "isna", "(", "new_values", ")", ".", "all", "(", ")", ":", "values", "=", "new_values", "except", "Exception", ":", "pass", "else", ":", "# soft-conversion", "values", "=", "lib", ".", "maybe_convert_objects", "(", "values", ")", "values", "=", "values", ".", "copy", "(", ")", "if", "copy", "else", "values", "return", "values" ]
if we have an object dtype, try to coerce dates and/or numbers
[ "if", "we", "have", "an", "object", "dtype", "try", "to", "coerce", "dates", "and", "/", "or", "numbers" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L713-L773
train
Try to coerce dates and numbers to the correct types.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9q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OH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1426 - 1378) + chr(111) + '\x37', 9288 - 9280), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(0b110111 + 0o70) + chr(0b110001) + chr(0b110100) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + '\063' + chr(0b100001 + 0o20), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b100 + 0o60) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(2137 - 2089) + chr(0b1101111) + '\x34' + chr(0b101100 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11011 + 0o26) + chr(0b110001) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b101110 + 0o5) + '\060', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(7480 - 7369) + chr(0b10110 + 0o37) + '\066', 64223 - 64215), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\063' + chr(2093 - 2038), 0o10), ehT0Px3KOsy9(chr(48) + chr(8338 - 8227) + chr(0b11011 + 0o26) + chr(0b101111 + 0o10) + chr(1335 - 1284), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b101111 + 0o100) + chr(0b110011) + '\x32' + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1000010 + 0o55) + chr(167 - 117) + '\065' + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101101 + 0o102) + chr(0b110011) + chr(55) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\062' + chr(148 - 98), 3508 - 3500), ehT0Px3KOsy9(chr(2021 - 1973) + chr(0b1011010 + 0o25) + chr(2112 - 2063) + chr(2254 - 2204) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(1008 - 960) + '\x6f' + '\065' + chr(0b10101 + 0o33), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6497 - 6386) + chr(50) + '\060', 0b1000), ehT0Px3KOsy9(chr(1095 - 1047) + chr(0b110001 + 0o76) + chr(1244 - 1195) + chr(0b110101) + '\x30', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(51) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6009 - 5898) + chr(0b11001 + 0o30) + '\064' + '\x31', 18097 - 18089), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1917 - 1868) + chr(0b100000 + 0o24) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + chr(1685 - 1636) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + '\x34' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10011 + 0o134) + chr(2292 - 2243) + '\x31' + chr(0b101 + 0o56), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\067' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\157' + chr(50) + chr(0b110000) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111110 + 0o61) + '\x33' + '\063', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\062', 0o10), ehT0Px3KOsy9(chr(1411 - 1363) + chr(10754 - 10643) + '\x31' + chr(1486 - 1432) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b110110) + chr(1644 - 1589), 0b1000), ehT0Px3KOsy9(chr(387 - 339) + chr(6765 - 6654) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1010110 + 0o31) + chr(51) + chr(158 - 107) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1000 + 0o147) + '\x31' + '\060' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1017 - 969) + '\x6f' + chr(0b101101 + 0o12) + chr(870 - 819), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1010101 + 0o32) + chr(0b11 + 0o60) + '\x36' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11100 + 0o123) + '\x33' + chr(0b110101) + chr(693 - 639), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1826 - 1777) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + chr(4355 - 4244) + chr(53) + chr(948 - 895), 0o10), ehT0Px3KOsy9(chr(134 - 86) + chr(0b110001 + 0o76) + chr(0b11011 + 0o30) + chr(0b111 + 0o51) + chr(54), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(2598 - 2487) + chr(0b110101) + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b')'), chr(0b10110 + 0o116) + chr(8626 - 8525) + '\x63' + '\x6f' + chr(0b1010000 + 0o24) + chr(0b1100101))(chr(12225 - 12108) + '\x74' + chr(3244 - 3142) + chr(45) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def LmdyYdHcjYjV(SPnCNu54H1db, JcOfGmhCIjpm=ehT0Px3KOsy9(chr(48) + chr(733 - 622) + '\061', ord("\x08")), WN1Hv0UPGMWY=ehT0Px3KOsy9('\x30' + '\157' + chr(1168 - 1119), 8), G9I7StJQU4i7=ehT0Px3KOsy9('\060' + '\157' + chr(49), 8), igThHS4jwVsa=ehT0Px3KOsy9(chr(0b110000) + chr(1032 - 921) + '\061', 8)): if PlSM16l2KDPD(SPnCNu54H1db, (YyaZ4tpXu4lf, KNyTy8rYcwji)): SPnCNu54H1db = WqUC3KWvYVup.array(SPnCNu54H1db, dtype=WqUC3KWvYVup.object_) if not lot1PSoAwYhj(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'cg\x1fi\x82'), chr(0b1100100) + chr(6254 - 6153) + '\143' + chr(111) + '\144' + chr(101))('\x75' + chr(0b1110100) + '\146' + '\055' + '\x38')): SPnCNu54H1db = WqUC3KWvYVup.array([SPnCNu54H1db], dtype=WqUC3KWvYVup.object_) if JcOfGmhCIjpm and xafqLlk3kkUe(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'cg\x1fi\x82'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(0b101011 + 0o71) + chr(0b1001111 + 0o26))(chr(117) + '\164' + '\x66' + chr(0b101101) + '\x38')) == xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'hq\x0c|\x84U\x14'), '\x64' + chr(0b10111 + 0o116) + chr(0b1100011) + '\x6f' + chr(100) + chr(101))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(0b101101) + '\x38')): if JcOfGmhCIjpm == xafqLlk3kkUe(SXOLrMavuUCe(b'd|\x03k\x84D'), chr(100) + '\145' + chr(0b1001011 + 0o30) + chr(0b110 + 0o151) + '\144' + chr(101))(chr(0b1010000 + 0o45) + chr(0b1110100) + '\146' + chr(1815 - 1770) + chr(2574 - 2518)): kXymhoFJ12ZA = OyAUwM2pEbUC(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'J+=w\x94|'), '\x64' + chr(0b1100101) + chr(0b101001 + 0o72) + chr(4050 - 3939) + '\x64' + '\x65')('\165' + chr(116) + chr(102) + chr(1092 - 1047) + '\070'), errors=xafqLlk3kkUe(SXOLrMavuUCe(b'd|\x03k\x84D'), '\x64' + chr(0b1100101) + chr(0b1001100 + 0o27) + '\157' + '\144' + chr(0b1100101))('\165' + chr(11450 - 11334) + '\x66' + chr(45) + chr(0b100010 + 0o26))) if not xafqLlk3kkUe(yBUx5qcFiTz6(kXymhoFJ12ZA), xafqLlk3kkUe(SXOLrMavuUCe(b'C\x7fR!\x89Kz*L\xf6I\xe5'), '\144' + chr(7195 - 7094) + '\x63' + chr(0b1001110 + 0o41) + chr(100) + '\x65')('\x75' + chr(0b1110100) + chr(0b11011 + 0o113) + chr(0b101101) + '\x38'))(): SPnCNu54H1db = kXymhoFJ12ZA else: SPnCNu54H1db = JiWVXlj3BjzT.maybe_convert_objects(SPnCNu54H1db, convert_datetime=JcOfGmhCIjpm) if G9I7StJQU4i7 and xafqLlk3kkUe(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'cg\x1fi\x82'), chr(2694 - 2594) + chr(0b11101 + 0o110) + '\143' + chr(0b1101111) + chr(0b10100 + 0o120) + chr(0b1100101))(chr(0b1001101 + 0o50) + chr(116) + chr(102) + chr(0b10111 + 0o26) + chr(0b111000))) == xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'hq\x0c|\x84U\x14'), chr(0b1100100) + '\x65' + chr(0b1011111 + 0o4) + chr(111) + chr(0b101101 + 0o67) + chr(0b1100101))('\x75' + chr(0b100000 + 0o124) + chr(0b1100110) + chr(0b101101) + chr(0b111000))): if G9I7StJQU4i7 == xafqLlk3kkUe(SXOLrMavuUCe(b'd|\x03k\x84D'), '\x64' + chr(0b101100 + 0o71) + chr(6405 - 6306) + chr(0b1101111) + chr(6345 - 6245) + chr(0b101111 + 0o66))(chr(0b1010000 + 0o45) + '\x74' + '\x66' + chr(508 - 463) + chr(2466 - 2410)): (o52vswvoQUMc,) = (xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b"wr\x08}\x86Re;A\xed\x1e\xf8\xde\x93\xbd8[>\x1c7\x0c\x00k\xc1'N\xe7h"), '\144' + '\145' + chr(0b101000 + 0o73) + chr(6613 - 6502) + '\144' + chr(101))(chr(117) + chr(3523 - 3407) + chr(102) + '\055' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b's|9m\x8eL.<K\xf3\x0f\xb7'), chr(100) + '\x65' + '\x63' + chr(9481 - 9370) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b1001100 + 0o50) + chr(0b1100110) + '\x2d' + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'd|\x14|'), chr(100) + chr(3326 - 3225) + chr(0b1001000 + 0o33) + chr(9174 - 9063) + '\x64' + '\x65')(chr(9837 - 9720) + '\164' + '\x66' + chr(0b1010 + 0o43) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b's|\tu\x94'), chr(0b1100100) + chr(0b1100101) + chr(6161 - 6062) + chr(0b1101111) + chr(0b1100100) + chr(6025 - 5924))(chr(0b101000 + 0o115) + chr(116) + chr(0b1100110) + '\055' + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b"sz\x0b|\x83D',O\xec"), chr(0b1011000 + 0o14) + '\x65' + chr(5331 - 5232) + chr(1422 - 1311) + chr(0b1100100) + chr(3801 - 3700))(chr(3416 - 3299) + chr(0b1110100) + '\146' + chr(45) + chr(781 - 725))), xafqLlk3kkUe(SXOLrMavuUCe(b's|9m\x8eL.<K\xf3\x0f\xb7'), chr(0b100101 + 0o77) + chr(0b1100101) + chr(99) + chr(111) + chr(0b100 + 0o140) + chr(0b100000 + 0o105))('\x75' + chr(154 - 38) + '\x66' + '\x2d' + chr(56))),) kXymhoFJ12ZA = o52vswvoQUMc(SPnCNu54H1db, errors=xafqLlk3kkUe(SXOLrMavuUCe(b'd|\x03k\x84D'), chr(0b100101 + 0o77) + '\x65' + chr(4327 - 4228) + chr(0b111011 + 0o64) + '\144' + chr(101))('\165' + '\x74' + chr(0b1100010 + 0o4) + chr(0b101101) + chr(202 - 146))) if not xafqLlk3kkUe(yBUx5qcFiTz6(kXymhoFJ12ZA), xafqLlk3kkUe(SXOLrMavuUCe(b'C\x7fR!\x89Kz*L\xf6I\xe5'), '\144' + chr(0b1100101) + '\143' + chr(10980 - 10869) + '\x64' + chr(0b110 + 0o137))(chr(5529 - 5412) + '\164' + chr(0b100110 + 0o100) + '\055' + '\x38'))(): SPnCNu54H1db = kXymhoFJ12ZA else: SPnCNu54H1db = JiWVXlj3BjzT.maybe_convert_objects(SPnCNu54H1db, convert_timedelta=G9I7StJQU4i7) if xafqLlk3kkUe(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'cg\x1fi\x82'), chr(7819 - 7719) + chr(9106 - 9005) + '\143' + chr(5185 - 5074) + chr(0b1100100) + chr(0b1000010 + 0o43))(chr(5891 - 5774) + chr(116) + '\146' + chr(679 - 634) + '\x38')) == xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'hq\x0c|\x84U\x14'), chr(0b1001010 + 0o32) + '\x65' + chr(0b1001100 + 0o27) + chr(268 - 157) + '\x64' + '\x65')(chr(9393 - 9276) + chr(6724 - 6608) + chr(7911 - 7809) + chr(405 - 360) + chr(56))): if WN1Hv0UPGMWY: try: kXymhoFJ12ZA = JiWVXlj3BjzT.maybe_convert_numeric(SPnCNu54H1db, MVEN8G6CxlvR(), coerce_numeric=ehT0Px3KOsy9('\060' + chr(111) + '\x31', 8)) if not xafqLlk3kkUe(yBUx5qcFiTz6(kXymhoFJ12ZA), xafqLlk3kkUe(SXOLrMavuUCe(b'C\x7fR!\x89Kz*L\xf6I\xe5'), chr(0b1100100) + chr(0b1100101) + chr(0b1000001 + 0o42) + chr(0b1011010 + 0o25) + chr(8167 - 8067) + chr(101))(chr(0b111101 + 0o70) + chr(0b1010100 + 0o40) + '\x66' + chr(45) + chr(56)))(): SPnCNu54H1db = kXymhoFJ12ZA except jLmadlzMdunT: pass else: SPnCNu54H1db = JiWVXlj3BjzT.maybe_convert_objects(SPnCNu54H1db) SPnCNu54H1db = SPnCNu54H1db.igThHS4jwVsa() if igThHS4jwVsa else SPnCNu54H1db return SPnCNu54H1db
pandas-dev/pandas
pandas/core/dtypes/cast.py
soft_convert_objects
def soft_convert_objects(values, datetime=True, numeric=True, timedelta=True, coerce=False, copy=True): """ if we have an object dtype, try to coerce dates and/or numbers """ conversion_count = sum((datetime, numeric, timedelta)) if conversion_count == 0: raise ValueError('At least one of datetime, numeric or timedelta must ' 'be True.') elif conversion_count > 1 and coerce: raise ValueError("Only one of 'datetime', 'numeric' or " "'timedelta' can be True when when coerce=True.") if isinstance(values, (list, tuple)): # List or scalar values = np.array(values, dtype=np.object_) elif not hasattr(values, 'dtype'): values = np.array([values], dtype=np.object_) elif not is_object_dtype(values.dtype): # If not object, do not attempt conversion values = values.copy() if copy else values return values # If 1 flag is coerce, ensure 2 others are False if coerce: # Immediate return if coerce if datetime: from pandas import to_datetime return to_datetime(values, errors='coerce').to_numpy() elif timedelta: from pandas import to_timedelta return to_timedelta(values, errors='coerce').to_numpy() elif numeric: from pandas import to_numeric return to_numeric(values, errors='coerce') # Soft conversions if datetime: # GH 20380, when datetime is beyond year 2262, hence outside # bound of nanosecond-resolution 64-bit integers. try: values = lib.maybe_convert_objects(values, convert_datetime=datetime) except OutOfBoundsDatetime: pass if timedelta and is_object_dtype(values.dtype): # Object check to ensure only run if previous did not convert values = lib.maybe_convert_objects(values, convert_timedelta=timedelta) if numeric and is_object_dtype(values.dtype): try: converted = lib.maybe_convert_numeric(values, set(), coerce_numeric=True) # If all NaNs, then do not-alter values = converted if not isna(converted).all() else values values = values.copy() if copy else values except Exception: pass return values
python
def soft_convert_objects(values, datetime=True, numeric=True, timedelta=True, coerce=False, copy=True): """ if we have an object dtype, try to coerce dates and/or numbers """ conversion_count = sum((datetime, numeric, timedelta)) if conversion_count == 0: raise ValueError('At least one of datetime, numeric or timedelta must ' 'be True.') elif conversion_count > 1 and coerce: raise ValueError("Only one of 'datetime', 'numeric' or " "'timedelta' can be True when when coerce=True.") if isinstance(values, (list, tuple)): # List or scalar values = np.array(values, dtype=np.object_) elif not hasattr(values, 'dtype'): values = np.array([values], dtype=np.object_) elif not is_object_dtype(values.dtype): # If not object, do not attempt conversion values = values.copy() if copy else values return values # If 1 flag is coerce, ensure 2 others are False if coerce: # Immediate return if coerce if datetime: from pandas import to_datetime return to_datetime(values, errors='coerce').to_numpy() elif timedelta: from pandas import to_timedelta return to_timedelta(values, errors='coerce').to_numpy() elif numeric: from pandas import to_numeric return to_numeric(values, errors='coerce') # Soft conversions if datetime: # GH 20380, when datetime is beyond year 2262, hence outside # bound of nanosecond-resolution 64-bit integers. try: values = lib.maybe_convert_objects(values, convert_datetime=datetime) except OutOfBoundsDatetime: pass if timedelta and is_object_dtype(values.dtype): # Object check to ensure only run if previous did not convert values = lib.maybe_convert_objects(values, convert_timedelta=timedelta) if numeric and is_object_dtype(values.dtype): try: converted = lib.maybe_convert_numeric(values, set(), coerce_numeric=True) # If all NaNs, then do not-alter values = converted if not isna(converted).all() else values values = values.copy() if copy else values except Exception: pass return values
[ "def", "soft_convert_objects", "(", "values", ",", "datetime", "=", "True", ",", "numeric", "=", "True", ",", "timedelta", "=", "True", ",", "coerce", "=", "False", ",", "copy", "=", "True", ")", ":", "conversion_count", "=", "sum", "(", "(", "datetime", ",", "numeric", ",", "timedelta", ")", ")", "if", "conversion_count", "==", "0", ":", "raise", "ValueError", "(", "'At least one of datetime, numeric or timedelta must '", "'be True.'", ")", "elif", "conversion_count", ">", "1", "and", "coerce", ":", "raise", "ValueError", "(", "\"Only one of 'datetime', 'numeric' or \"", "\"'timedelta' can be True when when coerce=True.\"", ")", "if", "isinstance", "(", "values", ",", "(", "list", ",", "tuple", ")", ")", ":", "# List or scalar", "values", "=", "np", ".", "array", "(", "values", ",", "dtype", "=", "np", ".", "object_", ")", "elif", "not", "hasattr", "(", "values", ",", "'dtype'", ")", ":", "values", "=", "np", ".", "array", "(", "[", "values", "]", ",", "dtype", "=", "np", ".", "object_", ")", "elif", "not", "is_object_dtype", "(", "values", ".", "dtype", ")", ":", "# If not object, do not attempt conversion", "values", "=", "values", ".", "copy", "(", ")", "if", "copy", "else", "values", "return", "values", "# If 1 flag is coerce, ensure 2 others are False", "if", "coerce", ":", "# Immediate return if coerce", "if", "datetime", ":", "from", "pandas", "import", "to_datetime", "return", "to_datetime", "(", "values", ",", "errors", "=", "'coerce'", ")", ".", "to_numpy", "(", ")", "elif", "timedelta", ":", "from", "pandas", "import", "to_timedelta", "return", "to_timedelta", "(", "values", ",", "errors", "=", "'coerce'", ")", ".", "to_numpy", "(", ")", "elif", "numeric", ":", "from", "pandas", "import", "to_numeric", "return", "to_numeric", "(", "values", ",", "errors", "=", "'coerce'", ")", "# Soft conversions", "if", "datetime", ":", "# GH 20380, when datetime is beyond year 2262, hence outside", "# bound of nanosecond-resolution 64-bit integers.", "try", ":", "values", "=", "lib", ".", "maybe_convert_objects", "(", "values", ",", "convert_datetime", "=", "datetime", ")", "except", "OutOfBoundsDatetime", ":", "pass", "if", "timedelta", "and", "is_object_dtype", "(", "values", ".", "dtype", ")", ":", "# Object check to ensure only run if previous did not convert", "values", "=", "lib", ".", "maybe_convert_objects", "(", "values", ",", "convert_timedelta", "=", "timedelta", ")", "if", "numeric", "and", "is_object_dtype", "(", "values", ".", "dtype", ")", ":", "try", ":", "converted", "=", "lib", ".", "maybe_convert_numeric", "(", "values", ",", "set", "(", ")", ",", "coerce_numeric", "=", "True", ")", "# If all NaNs, then do not-alter", "values", "=", "converted", "if", "not", "isna", "(", "converted", ")", ".", "all", "(", ")", "else", "values", "values", "=", "values", ".", "copy", "(", ")", "if", "copy", "else", "values", "except", "Exception", ":", "pass", "return", "values" ]
if we have an object dtype, try to coerce dates and/or numbers
[ "if", "we", "have", "an", "object", "dtype", "try", "to", "coerce", "dates", "and", "/", "or", "numbers" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L776-L835
train
Convert a list of objects into a single object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ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I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(5876 - 5765) + '\x32' + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(9465 - 9354) + chr(2497 - 2446) + chr(0b110011) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(11153 - 11042) + chr(1337 - 1286) + chr(0b1111 + 0o50) + chr(0b110 + 0o61), 34789 - 34781), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1013 - 963) + chr(0b100010 + 0o20) + '\x36', 41908 - 41900), ehT0Px3KOsy9(chr(1840 - 1792) + chr(8321 - 8210) + chr(2201 - 2150) + chr(0b110111) + chr(0b100010 + 0o25), 8), ehT0Px3KOsy9(chr(97 - 49) + chr(9738 - 9627) + chr(1654 - 1604) + chr(2175 - 2120), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1845 - 1794) + chr(2101 - 2051) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100001 + 0o22) + chr(112 - 57) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + chr(0b101101 + 0o7) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000111 + 0o50) + chr(0b101101 + 0o5) + chr(0b110110) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(2185 - 2137) + chr(0b1101111) + '\x33' + '\x36' + chr(49), 11353 - 11345), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + chr(882 - 831) + chr(1414 - 1361) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + '\063' + '\x36' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11000 + 0o34) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1010 + 0o47) + '\x35' + chr(0b110011), 37239 - 37231), ehT0Px3KOsy9('\060' + chr(111) + chr(2191 - 2136) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(1299 - 1251) + chr(1424 - 1313) + '\063' + chr(0b11101 + 0o32) + chr(2923 - 2868), 8), ehT0Px3KOsy9(chr(890 - 842) + '\x6f' + chr(2359 - 2307) + chr(2140 - 2089), 8), ehT0Px3KOsy9(chr(48) + chr(6583 - 6472) + '\062' + chr(2322 - 2267) + chr(0b10011 + 0o44), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(50) + chr(0b10 + 0o60), 28257 - 28249), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b100011 + 0o15) + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(1620 - 1572) + chr(975 - 927), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\x32' + chr(556 - 505), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(988 - 938) + chr(0b110111) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(2278 - 2230) + chr(7797 - 7686) + '\061' + chr(48) + chr(637 - 583), ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1100100 + 0o13) + '\063' + '\x32' + chr(0b110101), 37865 - 37857), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b110011) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100010 + 0o20) + chr(54) + chr(567 - 516), 4103 - 4095), ehT0Px3KOsy9(chr(938 - 890) + '\x6f' + '\062' + '\066' + chr(0b10110 + 0o36), 20015 - 20007), ehT0Px3KOsy9(chr(1822 - 1774) + chr(111) + chr(0b110001) + chr(506 - 455) + chr(2842 - 2788), 43792 - 43784), ehT0Px3KOsy9('\x30' + chr(4261 - 4150) + chr(1166 - 1115) + chr(55) + '\067', 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\066' + '\x35', 17962 - 17954), ehT0Px3KOsy9(chr(1102 - 1054) + chr(111) + chr(0b101110 + 0o5) + chr(53) + chr(49), 0o10), ehT0Px3KOsy9(chr(1122 - 1074) + '\157' + '\x33' + chr(2390 - 2337) + chr(0b110100), 8), ehT0Px3KOsy9(chr(2057 - 2009) + '\157' + chr(0b100011 + 0o20) + chr(51) + '\x33', 51492 - 51484), ehT0Px3KOsy9('\060' + chr(111) + chr(1853 - 1804) + '\x33' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1936 - 1888) + '\x6f' + chr(51) + chr(144 - 96) + chr(0b10000 + 0o41), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b101101 + 0o10), ord("\x08")), ehT0Px3KOsy9(chr(2074 - 2026) + '\x6f' + chr(0b110001) + chr(0b110011 + 0o2), 8), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(55) + chr(52), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(53) + '\060', 52929 - 52921)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'='), chr(9929 - 9829) + '\145' + chr(99) + chr(0b10 + 0o155) + chr(9897 - 9797) + chr(0b10 + 0o143))(chr(0b1000011 + 0o62) + chr(0b1101000 + 0o14) + chr(0b1100110) + chr(0b101101) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def YE6aYwH5E6Rt(SPnCNu54H1db, zKdiQFzuryNR=ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(2019 - 1970), 0o10), carEtu1CAKcf=ehT0Px3KOsy9('\x30' + '\157' + '\x31', 8), UYrFWngYaD_b=ehT0Px3KOsy9('\060' + chr(0b1010000 + 0o37) + chr(966 - 917), 8), t5Z6okQoi2Br=ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100001 + 0o17), 12415 - 12407), igThHS4jwVsa=ehT0Px3KOsy9('\x30' + chr(0b11001 + 0o126) + chr(0b110001), 8)): vlyBGWpiRMbp = xkxBmo49x2An((zKdiQFzuryNR, carEtu1CAKcf, UYrFWngYaD_b)) if vlyBGWpiRMbp == ehT0Px3KOsy9('\060' + chr(9069 - 8958) + '\x30', 8): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'R\xad\xdf\xfa\x9av\xa7\x8e\x04\xda\x9f\x89\xd6L\r\x19\x9bB\xcb\xb7\xf2)>\xdfj\xf5\xf7\xc6\xd9;\x8d\\\x8a\xcc\xb4.\xe1yd\x11v\xbd\x9a\xfa\x8bv\xf4\x97Q\xc6\x85\xcc\x94FKm\x8dV\xda\xfc'), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + '\144' + chr(7295 - 7194))(chr(0b1110101) + '\164' + chr(4993 - 4891) + chr(45) + chr(56))) elif vlyBGWpiRMbp > ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + chr(508 - 459), 8) and t5Z6okQoi2Br: raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\\\xb7\x93\xef\xdfx\xba\x9f\x04\xda\x97\xcc\xd1G\nM\x9aW\xd6\xbf\xe3g\x7f\x9aa\xbb\xec\xde\xd1,\x96V\xce\xcc\xb4.\xe1*y\x15~\xbc\x9b\xf3\x93c\xb5\xdd\x04\xd6\x90\x82\xd6A\x0e\x19\xabQ\xca\xb7\xa67;\xdf(\xf5\xee\xdb\xd10\xdfV\x86\x89\xa9?\xa40Y\x0ef\xbc\xd1'), chr(100) + chr(0b1100101) + '\143' + '\x6f' + '\x64' + chr(0b10110 + 0o117))(chr(117) + chr(12234 - 12118) + chr(8849 - 8747) + '\x2d' + chr(56))) if PlSM16l2KDPD(SPnCNu54H1db, (YyaZ4tpXu4lf, KNyTy8rYcwji)): SPnCNu54H1db = WqUC3KWvYVup.array(SPnCNu54H1db, dtype=WqUC3KWvYVup.object_) elif not lot1PSoAwYhj(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'w\xad\x86\xe6\x9a'), chr(0b100101 + 0o77) + chr(5145 - 5044) + chr(0b1010010 + 0o21) + chr(9132 - 9021) + chr(0b1100100) + '\145')(chr(3633 - 3516) + chr(0b1110100) + '\146' + chr(45) + chr(0b110110 + 0o2))): SPnCNu54H1db = WqUC3KWvYVup.array([SPnCNu54H1db], dtype=WqUC3KWvYVup.object_) elif not NGkWsclKfnpq(xafqLlk3kkUe(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'w\xad\x86\xe6\x9a'), chr(100) + '\x65' + chr(0b1010001 + 0o22) + '\x6f' + chr(0b1000110 + 0o36) + chr(0b1010011 + 0o22))(chr(0b101 + 0o160) + chr(2677 - 2561) + chr(102) + chr(1296 - 1251) + '\x38'))): SPnCNu54H1db = SPnCNu54H1db.igThHS4jwVsa() if igThHS4jwVsa else SPnCNu54H1db return SPnCNu54H1db if t5Z6okQoi2Br: if zKdiQFzuryNR: (IF08dLE993_s,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'c\xb8\x91\xf2\x9ed'), chr(100) + chr(7701 - 7600) + '\x63' + '\157' + chr(100) + chr(101))('\165' + '\164' + chr(102) + '\x2d' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'g\xb6\xa0\xf2\x9ec\xb1\x8eM\xd8\x94'), '\144' + '\145' + '\x63' + chr(8536 - 8425) + '\144' + '\x65')(chr(0b1110101) + chr(0b101001 + 0o113) + chr(2136 - 2034) + chr(0b101101) + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'g\xb6\xa0\xf2\x9ec\xb1\x8eM\xd8\x94'), chr(0b1011011 + 0o11) + chr(0b110010 + 0o63) + chr(0b1100011) + '\157' + chr(100) + chr(0b111001 + 0o54))('\x75' + chr(116) + chr(5389 - 5287) + chr(45) + chr(0b111000))),) return xafqLlk3kkUe(IF08dLE993_s(SPnCNu54H1db, errors=xafqLlk3kkUe(SXOLrMavuUCe(b'p\xb6\x9a\xe4\x9cr'), '\144' + chr(0b1001111 + 0o26) + chr(0b1100011) + chr(0b1101111) + chr(100) + '\x65')('\x75' + chr(116) + chr(0b1100110) + '\055' + chr(0b111 + 0o61))), xafqLlk3kkUe(SXOLrMavuUCe(b'g\xb6\xa0\xf8\x8az\xa4\x83'), chr(9890 - 9790) + chr(2814 - 2713) + '\143' + '\157' + '\144' + chr(101))(chr(0b10111 + 0o136) + '\x74' + '\146' + '\x2d' + chr(0b100000 + 0o30)))() elif UYrFWngYaD_b: (o52vswvoQUMc,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'c\xb8\x91\xf2\x9ed'), chr(100) + '\x65' + chr(99) + chr(4931 - 4820) + chr(1189 - 1089) + chr(0b1100101))(chr(0b1110101) + chr(1753 - 1637) + chr(0b1101 + 0o131) + '\055' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'g\xb6\xa0\xe2\x96z\xb1\x9eA\xd9\x85\x8d'), chr(100) + '\145' + '\x63' + chr(111) + '\144' + '\x65')(chr(7784 - 7667) + '\x74' + chr(0b1100110) + chr(45) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'g\xb6\xa0\xe2\x96z\xb1\x9eA\xd9\x85\x8d'), chr(6862 - 6762) + '\x65' + '\143' + chr(0b1011111 + 0o20) + chr(0b1100100) + chr(101))(chr(8280 - 8163) + '\164' + '\x66' + chr(0b10000 + 0o35) + '\070')),) return xafqLlk3kkUe(o52vswvoQUMc(SPnCNu54H1db, errors=xafqLlk3kkUe(SXOLrMavuUCe(b'p\xb6\x9a\xe4\x9cr'), chr(100) + chr(0b1010101 + 0o20) + chr(0b1000011 + 0o40) + chr(0b1101111) + '\x64' + '\x65')(chr(8546 - 8429) + chr(0b101001 + 0o113) + chr(9053 - 8951) + chr(0b10100 + 0o31) + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'g\xb6\xa0\xf8\x8az\xa4\x83'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(0b111001 + 0o66) + chr(100) + '\145')(chr(0b101111 + 0o106) + chr(0b110011 + 0o101) + chr(0b1010010 + 0o24) + chr(1490 - 1445) + chr(0b111000)))() elif carEtu1CAKcf: (D3UiWg6YVSO0,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'c\xb8\x91\xf2\x9ed'), chr(0b1110 + 0o126) + chr(6287 - 6186) + chr(99) + '\157' + chr(100) + chr(101))(chr(11716 - 11599) + '\164' + chr(5556 - 5454) + chr(962 - 917) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'g\xb6\xa0\xf8\x8az\xb1\x88M\xd6'), '\144' + '\145' + chr(0b110111 + 0o54) + chr(4796 - 4685) + chr(0b1100100) + chr(0b100000 + 0o105))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b101101 + 0o0) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'g\xb6\xa0\xf8\x8az\xb1\x88M\xd6'), chr(8629 - 8529) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(0b1001001 + 0o33) + chr(0b1100101))(chr(0b1110100 + 0o1) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(420 - 364))),) return D3UiWg6YVSO0(SPnCNu54H1db, errors=xafqLlk3kkUe(SXOLrMavuUCe(b'p\xb6\x9a\xe4\x9cr'), '\x64' + chr(0b1100101) + chr(6016 - 5917) + '\x6f' + chr(4363 - 4263) + chr(8393 - 8292))('\x75' + chr(0b1110100) + '\x66' + '\x2d' + '\x38')) if zKdiQFzuryNR: try: SPnCNu54H1db = JiWVXlj3BjzT.maybe_convert_objects(SPnCNu54H1db, convert_datetime=zKdiQFzuryNR) except ihnyQ_QFyBaj: pass if UYrFWngYaD_b and NGkWsclKfnpq(xafqLlk3kkUe(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'w\xad\x86\xe6\x9a'), chr(0b110101 + 0o57) + '\x65' + chr(0b111 + 0o134) + chr(409 - 298) + '\144' + '\x65')(chr(0b1010000 + 0o45) + chr(0b1110100) + chr(0b111101 + 0o51) + chr(940 - 895) + chr(56)))): SPnCNu54H1db = JiWVXlj3BjzT.maybe_convert_objects(SPnCNu54H1db, convert_timedelta=UYrFWngYaD_b) if carEtu1CAKcf and NGkWsclKfnpq(xafqLlk3kkUe(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'w\xad\x86\xe6\x9a'), chr(0b11100 + 0o110) + chr(0b1100101) + chr(99) + '\157' + '\144' + chr(5043 - 4942))('\x75' + '\x74' + chr(0b1100110) + chr(0b101011 + 0o2) + '\070'))): try: ekolk5wRLA_R = JiWVXlj3BjzT.maybe_convert_numeric(SPnCNu54H1db, MVEN8G6CxlvR(), coerce_numeric=ehT0Px3KOsy9(chr(357 - 309) + chr(0b1101111) + chr(0b11100 + 0o25), 8)) SPnCNu54H1db = ekolk5wRLA_R if not yBUx5qcFiTz6(ekolk5wRLA_R).Dl48nj1rbi23() else SPnCNu54H1db SPnCNu54H1db = SPnCNu54H1db.igThHS4jwVsa() if igThHS4jwVsa else SPnCNu54H1db except jLmadlzMdunT: pass return SPnCNu54H1db
pandas-dev/pandas
pandas/core/dtypes/cast.py
maybe_infer_to_datetimelike
def maybe_infer_to_datetimelike(value, convert_dates=False): """ we might have a array (or single object) that is datetime like, and no dtype is passed don't change the value unless we find a datetime/timedelta set this is pretty strict in that a datetime/timedelta is REQUIRED in addition to possible nulls/string likes Parameters ---------- value : np.array / Series / Index / list-like convert_dates : boolean, default False if True try really hard to convert dates (such as datetime.date), other leave inferred dtype 'date' alone """ # TODO: why not timedelta? if isinstance(value, (ABCDatetimeIndex, ABCPeriodIndex, ABCDatetimeArray, ABCPeriodArray)): return value elif isinstance(value, ABCSeries): if isinstance(value._values, ABCDatetimeIndex): return value._values v = value if not is_list_like(v): v = [v] v = np.array(v, copy=False) # we only care about object dtypes if not is_object_dtype(v): return value shape = v.shape if not v.ndim == 1: v = v.ravel() if not len(v): return value def try_datetime(v): # safe coerce to datetime64 try: # GH19671 v = tslib.array_to_datetime(v, require_iso8601=True, errors='raise')[0] except ValueError: # we might have a sequence of the same-datetimes with tz's # if so coerce to a DatetimeIndex; if they are not the same, # then these stay as object dtype, xref GH19671 try: from pandas._libs.tslibs import conversion from pandas import DatetimeIndex values, tz = conversion.datetime_to_datetime64(v) return DatetimeIndex(values).tz_localize( 'UTC').tz_convert(tz=tz) except (ValueError, TypeError): pass except Exception: pass return v.reshape(shape) def try_timedelta(v): # safe coerce to timedelta64 # will try first with a string & object conversion from pandas import to_timedelta try: return to_timedelta(v)._ndarray_values.reshape(shape) except Exception: return v.reshape(shape) inferred_type = lib.infer_datetimelike_array(ensure_object(v)) if inferred_type == 'date' and convert_dates: value = try_datetime(v) elif inferred_type == 'datetime': value = try_datetime(v) elif inferred_type == 'timedelta': value = try_timedelta(v) elif inferred_type == 'nat': # if all NaT, return as datetime if isna(v).all(): value = try_datetime(v) else: # We have at least a NaT and a string # try timedelta first to avoid spurious datetime conversions # e.g. '00:00:01' is a timedelta but technically is also a datetime value = try_timedelta(v) if lib.infer_dtype(value, skipna=False) in ['mixed']: # cannot skip missing values, as NaT implies that the string # is actually a datetime value = try_datetime(v) return value
python
def maybe_infer_to_datetimelike(value, convert_dates=False): """ we might have a array (or single object) that is datetime like, and no dtype is passed don't change the value unless we find a datetime/timedelta set this is pretty strict in that a datetime/timedelta is REQUIRED in addition to possible nulls/string likes Parameters ---------- value : np.array / Series / Index / list-like convert_dates : boolean, default False if True try really hard to convert dates (such as datetime.date), other leave inferred dtype 'date' alone """ # TODO: why not timedelta? if isinstance(value, (ABCDatetimeIndex, ABCPeriodIndex, ABCDatetimeArray, ABCPeriodArray)): return value elif isinstance(value, ABCSeries): if isinstance(value._values, ABCDatetimeIndex): return value._values v = value if not is_list_like(v): v = [v] v = np.array(v, copy=False) # we only care about object dtypes if not is_object_dtype(v): return value shape = v.shape if not v.ndim == 1: v = v.ravel() if not len(v): return value def try_datetime(v): # safe coerce to datetime64 try: # GH19671 v = tslib.array_to_datetime(v, require_iso8601=True, errors='raise')[0] except ValueError: # we might have a sequence of the same-datetimes with tz's # if so coerce to a DatetimeIndex; if they are not the same, # then these stay as object dtype, xref GH19671 try: from pandas._libs.tslibs import conversion from pandas import DatetimeIndex values, tz = conversion.datetime_to_datetime64(v) return DatetimeIndex(values).tz_localize( 'UTC').tz_convert(tz=tz) except (ValueError, TypeError): pass except Exception: pass return v.reshape(shape) def try_timedelta(v): # safe coerce to timedelta64 # will try first with a string & object conversion from pandas import to_timedelta try: return to_timedelta(v)._ndarray_values.reshape(shape) except Exception: return v.reshape(shape) inferred_type = lib.infer_datetimelike_array(ensure_object(v)) if inferred_type == 'date' and convert_dates: value = try_datetime(v) elif inferred_type == 'datetime': value = try_datetime(v) elif inferred_type == 'timedelta': value = try_timedelta(v) elif inferred_type == 'nat': # if all NaT, return as datetime if isna(v).all(): value = try_datetime(v) else: # We have at least a NaT and a string # try timedelta first to avoid spurious datetime conversions # e.g. '00:00:01' is a timedelta but technically is also a datetime value = try_timedelta(v) if lib.infer_dtype(value, skipna=False) in ['mixed']: # cannot skip missing values, as NaT implies that the string # is actually a datetime value = try_datetime(v) return value
[ "def", "maybe_infer_to_datetimelike", "(", "value", ",", "convert_dates", "=", "False", ")", ":", "# TODO: why not timedelta?", "if", "isinstance", "(", "value", ",", "(", "ABCDatetimeIndex", ",", "ABCPeriodIndex", ",", "ABCDatetimeArray", ",", "ABCPeriodArray", ")", ")", ":", "return", "value", "elif", "isinstance", "(", "value", ",", "ABCSeries", ")", ":", "if", "isinstance", "(", "value", ".", "_values", ",", "ABCDatetimeIndex", ")", ":", "return", "value", ".", "_values", "v", "=", "value", "if", "not", "is_list_like", "(", "v", ")", ":", "v", "=", "[", "v", "]", "v", "=", "np", ".", "array", "(", "v", ",", "copy", "=", "False", ")", "# we only care about object dtypes", "if", "not", "is_object_dtype", "(", "v", ")", ":", "return", "value", "shape", "=", "v", ".", "shape", "if", "not", "v", ".", "ndim", "==", "1", ":", "v", "=", "v", ".", "ravel", "(", ")", "if", "not", "len", "(", "v", ")", ":", "return", "value", "def", "try_datetime", "(", "v", ")", ":", "# safe coerce to datetime64", "try", ":", "# GH19671", "v", "=", "tslib", ".", "array_to_datetime", "(", "v", ",", "require_iso8601", "=", "True", ",", "errors", "=", "'raise'", ")", "[", "0", "]", "except", "ValueError", ":", "# we might have a sequence of the same-datetimes with tz's", "# if so coerce to a DatetimeIndex; if they are not the same,", "# then these stay as object dtype, xref GH19671", "try", ":", "from", "pandas", ".", "_libs", ".", "tslibs", "import", "conversion", "from", "pandas", "import", "DatetimeIndex", "values", ",", "tz", "=", "conversion", ".", "datetime_to_datetime64", "(", "v", ")", "return", "DatetimeIndex", "(", "values", ")", ".", "tz_localize", "(", "'UTC'", ")", ".", "tz_convert", "(", "tz", "=", "tz", ")", "except", "(", "ValueError", ",", "TypeError", ")", ":", "pass", "except", "Exception", ":", "pass", "return", "v", ".", "reshape", "(", "shape", ")", "def", "try_timedelta", "(", "v", ")", ":", "# safe coerce to timedelta64", "# will try first with a string & object conversion", "from", "pandas", "import", "to_timedelta", "try", ":", "return", "to_timedelta", "(", "v", ")", ".", "_ndarray_values", ".", "reshape", "(", "shape", ")", "except", "Exception", ":", "return", "v", ".", "reshape", "(", "shape", ")", "inferred_type", "=", "lib", ".", "infer_datetimelike_array", "(", "ensure_object", "(", "v", ")", ")", "if", "inferred_type", "==", "'date'", "and", "convert_dates", ":", "value", "=", "try_datetime", "(", "v", ")", "elif", "inferred_type", "==", "'datetime'", ":", "value", "=", "try_datetime", "(", "v", ")", "elif", "inferred_type", "==", "'timedelta'", ":", "value", "=", "try_timedelta", "(", "v", ")", "elif", "inferred_type", "==", "'nat'", ":", "# if all NaT, return as datetime", "if", "isna", "(", "v", ")", ".", "all", "(", ")", ":", "value", "=", "try_datetime", "(", "v", ")", "else", ":", "# We have at least a NaT and a string", "# try timedelta first to avoid spurious datetime conversions", "# e.g. '00:00:01' is a timedelta but technically is also a datetime", "value", "=", "try_timedelta", "(", "v", ")", "if", "lib", ".", "infer_dtype", "(", "value", ",", "skipna", "=", "False", ")", "in", "[", "'mixed'", "]", ":", "# cannot skip missing values, as NaT implies that the string", "# is actually a datetime", "value", "=", "try_datetime", "(", "v", ")", "return", "value" ]
we might have a array (or single object) that is datetime like, and no dtype is passed don't change the value unless we find a datetime/timedelta set this is pretty strict in that a datetime/timedelta is REQUIRED in addition to possible nulls/string likes Parameters ---------- value : np.array / Series / Index / list-like convert_dates : boolean, default False if True try really hard to convert dates (such as datetime.date), other leave inferred dtype 'date' alone
[ "we", "might", "have", "a", "array", "(", "or", "single", "object", ")", "that", "is", "datetime", "like", "and", "no", "dtype", "is", "passed", "don", "t", "change", "the", "value", "unless", "we", "find", "a", "datetime", "/", "timedelta", "set" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L852-L956
train
Try to infer the value of a node from a datetime - like object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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ionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(2684 - 2629) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(267 - 219) + chr(0b1101111) + chr(1456 - 1407) + chr(0b110000) + chr(1628 - 1575), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1101111) + chr(54) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1110 + 0o44) + '\064', 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + chr(0b100010 + 0o20) + chr(51) + chr(49), 5036 - 5028), ehT0Px3KOsy9(chr(1390 - 1342) + chr(0b1101010 + 0o5) + '\063' + chr(2318 - 2266) + chr(0b110101 + 0o0), 0b1000), ehT0Px3KOsy9('\060' + chr(0b101 + 0o152) + '\x31' + '\063' + chr(53), 57920 - 57912), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2073 - 2022) + '\x31' + chr(2151 - 2101), 24558 - 24550), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\157' + '\065' + chr(0b110100), 30112 - 30104), ehT0Px3KOsy9('\060' + chr(11385 - 11274) + chr(98 - 47) + '\062' + chr(2342 - 2292), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1000 + 0o53) + '\x30' + chr(717 - 664), 33992 - 33984), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\067' + chr(0b10011 + 0o44), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\065' + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(1149 - 1038) + '\x32' + chr(49) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(52) + chr(51), 0o10), ehT0Px3KOsy9(chr(1629 - 1581) + chr(111) + chr(49) + chr(0b110110) + chr(1259 - 1208), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011011 + 0o24) + chr(0b110010) + chr(0b110010 + 0o3) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + chr(50) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\x36' + chr(0b110111), 59202 - 59194), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100 + 0o57) + chr(54) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110110) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + chr(5508 - 5397) + chr(0b110010), 63659 - 63651), ehT0Px3KOsy9(chr(740 - 692) + chr(0b1001101 + 0o42) + '\062' + chr(51) + chr(80 - 27), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001011 + 0o44) + chr(49) + chr(50) + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + chr(10807 - 10696) + chr(0b100 + 0o56) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(1391 - 1343) + chr(0b1000 + 0o147) + chr(0b100011 + 0o16) + chr(2057 - 2009) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4937 - 4826) + '\067' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(0b10111 + 0o33), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + chr(2259 - 2210) + chr(54) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b110010) + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111 + 0o0) + chr(51) + chr(0b110000) + chr(2025 - 1975), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101 + 0o142) + chr(623 - 572) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x35' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(931 - 881) + chr(0b10100 + 0o34) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110111) + '\063', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b111111 + 0o60) + chr(50) + chr(681 - 628) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4871 - 4760) + chr(0b110001) + chr(126 - 74) + chr(0b11100 + 0o33), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(1707 - 1652) + chr(810 - 761), 0b1000), ehT0Px3KOsy9(chr(1207 - 1159) + '\x6f' + chr(50) + chr(0b100000 + 0o20) + chr(50), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1657 - 1609) + chr(0b1010011 + 0o34) + '\065' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2'), chr(0b1100100) + chr(101) + chr(9520 - 9421) + '\157' + '\144' + chr(0b1100101))(chr(117) + '\x74' + chr(0b1100110) + chr(45) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Y5DUCg1pxiDF(QmmgWUB13VCJ, JcOfGmhCIjpm=ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\060', 0b1000)): if PlSM16l2KDPD(QmmgWUB13VCJ, (YZ5LDy5fOv72, FsR2PdYNld4H, LDvXXFwOdOvg, uO8SSrhjUClc)): return QmmgWUB13VCJ elif PlSM16l2KDPD(QmmgWUB13VCJ, essMXh4s9f1w): if PlSM16l2KDPD(xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa33Ux\xec\x80.'), chr(0b1100100) + chr(101) + '\143' + chr(0b1101111) + chr(100) + chr(0b101110 + 0o67))(chr(0b1110101) + chr(0b1001111 + 0o45) + '\x66' + chr(45) + '\070')), YZ5LDy5fOv72): return xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa33Ux\xec\x80.'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(4210 - 4110) + '\x65')(chr(7169 - 7052) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(2956 - 2900))) cMbll0QYhULo = QmmgWUB13VCJ if not bAgBF7jXI53B(cMbll0QYhULo): cMbll0QYhULo = [cMbll0QYhULo] cMbll0QYhULo = WqUC3KWvYVup.array(cMbll0QYhULo, copy=ehT0Px3KOsy9(chr(1661 - 1613) + '\x6f' + chr(0b110000), 8)) if not NGkWsclKfnpq(cMbll0QYhULo): return QmmgWUB13VCJ nauYfLglTpcb = cMbll0QYhULo.shape if not xafqLlk3kkUe(cMbll0QYhULo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b*Yd\xd1\xa74\x9e_\xb4\x8f+'), '\x64' + chr(101) + chr(99) + chr(0b101 + 0o152) + chr(7101 - 7001) + chr(7179 - 7078))(chr(0b1110101) + '\x74' + chr(6076 - 5974) + chr(0b101101) + chr(0b101110 + 0o12))) == ehT0Px3KOsy9('\060' + chr(111) + chr(49), 0o10): cMbll0QYhULo = cMbll0QYhULo._z3oWn7GMFaN() if not c2A0yzQpDQB3(cMbll0QYhULo): return QmmgWUB13VCJ def w4WTk3Se4JPB(cMbll0QYhULo): try: cMbll0QYhULo = vNWoJjphZK5I.array_to_datetime(cMbll0QYhULo, require_iso8601=ehT0Px3KOsy9(chr(570 - 522) + '\157' + chr(49), 8), errors=xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e$]g\xfc'), '\x64' + '\145' + chr(0b101011 + 0o70) + chr(0b111 + 0o150) + chr(0b1100100) + chr(4093 - 3992))(chr(6779 - 6662) + chr(0b1010000 + 0o44) + '\146' + chr(0b101101) + chr(2266 - 2210)))[ehT0Px3KOsy9('\x30' + '\x6f' + '\x30', 8)] except q1QCh3W88sgk: try: (AcMhkl5wRCN5,) = (xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c$Zp\xf8\x96s\x95@\xbb\xa7\x0c\xc4\xfb\x90\x1f\xc6p\xc4'), chr(100) + chr(7185 - 7084) + '\143' + chr(111) + '\x64' + chr(8065 - 7964))('\165' + chr(4285 - 4169) + '\x66' + '\055' + chr(0b100011 + 0o25)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f*Zb\xfc\x97.\xa3C\xbc'), chr(901 - 801) + chr(101) + chr(1557 - 1458) + chr(111) + chr(2980 - 2880) + '\x65')('\x75' + chr(0b111000 + 0o74) + '\x66' + chr(0b1 + 0o54) + chr(2808 - 2752))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3)]v\xea'), chr(0b111101 + 0o47) + chr(0b1000110 + 0o37) + '\143' + '\x6f' + '\x64' + chr(0b1100101))(chr(0b110011 + 0o102) + chr(0b100011 + 0o121) + chr(2932 - 2830) + chr(0b100111 + 0o6) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x886X}\xfb\x96'), chr(0b110010 + 0o62) + chr(9857 - 9756) + '\143' + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(5967 - 5850) + chr(116) + chr(0b1001 + 0o135) + '\055' + chr(0b11100 + 0o34))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f*Zb\xfc\x97.\xa3C\xbc'), chr(0b1100100) + chr(101) + chr(8860 - 8761) + chr(6801 - 6690) + chr(0b111001 + 0o53) + chr(0b1100101))(chr(0b1110101) + chr(0b1110 + 0o146) + chr(5033 - 4931) + chr(0b101101) + '\070')),) (BH788a2q6sDc,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c$Zp\xf8\x96'), chr(6421 - 6321) + '\145' + chr(0b1100000 + 0o3) + chr(0b1000000 + 0o57) + chr(100) + chr(2089 - 1988))(chr(0b101111 + 0o106) + '\x74' + chr(7065 - 6963) + chr(557 - 512) + chr(0b101101 + 0o13)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8$@q\xed\x8c0\xafe\xbc\xa1\x1a\x92'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b1000010 + 0o55) + chr(0b1010001 + 0o23) + chr(101))(chr(0b110111 + 0o76) + '\x74' + chr(0b1001 + 0o135) + chr(45) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8$@q\xed\x8c0\xafe\xbc\xa1\x1a\x92'), chr(0b1100100) + chr(0b1100101) + chr(3491 - 3392) + '\x6f' + '\x64' + chr(5577 - 5476))('\165' + chr(0b1110100) + '\x66' + chr(0b100100 + 0o11) + chr(1235 - 1179))),) (SPnCNu54H1db, NnbsN0QovryF) = AcMhkl5wRCN5.datetime_to_datetime64(cMbll0QYhULo) return xafqLlk3kkUe(BH788a2q6sDc(SPnCNu54H1db).tz_localize(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9\x11w'), '\144' + '\145' + chr(99) + chr(0b1001011 + 0o44) + '\x64' + chr(101))('\x75' + chr(0b1110100) + chr(102) + chr(0b101000 + 0o5) + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x88?kw\xf6\x8b+\xaf^\xa6'), chr(5298 - 5198) + chr(0b1100101) + chr(99) + chr(111) + chr(9402 - 9302) + '\145')('\165' + chr(0b1010111 + 0o35) + '\146' + chr(0b10 + 0o53) + chr(0b100110 + 0o22)))(tz=NnbsN0QovryF) except (q1QCh3W88sgk, sznFqDbNBHlx): pass except jLmadlzMdunT: pass return xafqLlk3kkUe(cMbll0QYhULo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e G|\xf8\x958'), chr(100) + chr(0b1100011 + 0o2) + chr(99) + chr(8748 - 8637) + chr(100) + chr(0b110010 + 0o63))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b101101) + '\070'))(nauYfLglTpcb) def XcshGRLQLp2A(cMbll0QYhULo): (o52vswvoQUMc,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c$Zp\xf8\x96'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1000010 + 0o55) + chr(0b110000 + 0o64) + chr(101))(chr(117) + '\164' + chr(0b1100110) + '\x2d' + chr(0b1100 + 0o54)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x88*k`\xf0\x888\xaeI\xbe\xb1\x1e'), chr(367 - 267) + '\145' + chr(99) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(408 - 292) + chr(0b101111 + 0o67) + chr(0b1000 + 0o45) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x88*k`\xf0\x888\xaeI\xbe\xb1\x1e'), chr(3519 - 3419) + '\145' + '\x63' + chr(0b10100 + 0o133) + '\x64' + '\145')('\x75' + chr(0b1110001 + 0o3) + chr(0b1100110) + chr(0b101011 + 0o2) + '\070')),) try: return xafqLlk3kkUe(o52vswvoQUMc(cMbll0QYhULo)._ndarray_values, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e G|\xf8\x958'), '\x64' + chr(101) + '\x63' + chr(0b1101101 + 0o2) + chr(4029 - 3929) + chr(101))(chr(0b1110101) + '\x74' + chr(7496 - 7394) + '\x2d' + '\x38'))(nauYfLglTpcb) except jLmadlzMdunT: return xafqLlk3kkUe(cMbll0QYhULo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e G|\xf8\x958'), '\144' + chr(0b1100101) + '\143' + '\x6f' + chr(224 - 124) + '\145')('\x75' + chr(116) + chr(0b1100110) + chr(0b101101 + 0o0) + '\x38'))(nauYfLglTpcb) MpvDwsWO5WMk = JiWVXlj3BjzT.infer_datetimelike_array(vd4vF5cOhwLp(cMbll0QYhULo)) if MpvDwsWO5WMk == xafqLlk3kkUe(SXOLrMavuUCe(b'\x98$@q'), chr(3856 - 3756) + '\145' + chr(99) + chr(0b1101111) + '\x64' + '\x65')('\x75' + '\x74' + chr(102) + '\055' + chr(56)) and JcOfGmhCIjpm: QmmgWUB13VCJ = w4WTk3Se4JPB(cMbll0QYhULo) elif MpvDwsWO5WMk == xafqLlk3kkUe(SXOLrMavuUCe(b'\x98$@q\xed\x8c0\xaf'), chr(0b1100100) + '\x65' + '\143' + chr(0b1000 + 0o147) + chr(100) + chr(4780 - 4679))(chr(117) + chr(2391 - 2275) + '\146' + '\x2d' + chr(0b11001 + 0o37)): QmmgWUB13VCJ = w4WTk3Se4JPB(cMbll0QYhULo) elif MpvDwsWO5WMk == xafqLlk3kkUe(SXOLrMavuUCe(b'\x88,Yq\xfd\x801\xbeM'), '\144' + '\x65' + chr(2279 - 2180) + chr(562 - 451) + chr(4797 - 4697) + chr(101))('\165' + '\x74' + chr(0b1000000 + 0o46) + '\x2d' + chr(0b111000)): QmmgWUB13VCJ = XcshGRLQLp2A(cMbll0QYhULo) elif MpvDwsWO5WMk == xafqLlk3kkUe(SXOLrMavuUCe(b'\x92$@'), chr(0b101101 + 0o67) + chr(1815 - 1714) + '\143' + chr(111) + chr(0b1100100) + chr(101))(chr(117) + chr(0b111011 + 0o71) + chr(0b1100110) + chr(0b1001 + 0o44) + chr(0b111000)): if xafqLlk3kkUe(yBUx5qcFiTz6(cMbll0QYhULo), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8)\x00,\xf7\x8fl\xb8N\xbb\xf7L'), chr(0b1100100) + chr(1029 - 928) + chr(99) + '\157' + '\144' + chr(101))('\165' + chr(116) + '\x66' + chr(67 - 22) + chr(56)))(): QmmgWUB13VCJ = w4WTk3Se4JPB(cMbll0QYhULo) else: QmmgWUB13VCJ = XcshGRLQLp2A(cMbll0QYhULo) if xafqLlk3kkUe(JiWVXlj3BjzT, xafqLlk3kkUe(SXOLrMavuUCe(b'\x95+Rq\xeb\xba9\xbeU\xa2\xa0'), chr(100) + chr(5481 - 5380) + '\x63' + chr(111) + '\x64' + '\145')(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\055' + '\070'))(QmmgWUB13VCJ, skipna=ehT0Px3KOsy9(chr(0b0 + 0o60) + '\157' + chr(48), 8)) in [xafqLlk3kkUe(SXOLrMavuUCe(b'\x91,Lq\xfd'), chr(0b111010 + 0o52) + chr(1522 - 1421) + chr(0b101110 + 0o65) + '\x6f' + chr(0b110 + 0o136) + chr(0b1011000 + 0o15))(chr(0b111000 + 0o75) + '\164' + '\x66' + '\x2d' + '\x38')]: QmmgWUB13VCJ = w4WTk3Se4JPB(cMbll0QYhULo) return QmmgWUB13VCJ
pandas-dev/pandas
pandas/core/dtypes/cast.py
maybe_cast_to_datetime
def maybe_cast_to_datetime(value, dtype, errors='raise'): """ try to cast the array/value to a datetimelike dtype, converting float nan to iNaT """ from pandas.core.tools.timedeltas import to_timedelta from pandas.core.tools.datetimes import to_datetime if dtype is not None: if isinstance(dtype, str): dtype = np.dtype(dtype) is_datetime64 = is_datetime64_dtype(dtype) is_datetime64tz = is_datetime64tz_dtype(dtype) is_timedelta64 = is_timedelta64_dtype(dtype) if is_datetime64 or is_datetime64tz or is_timedelta64: # Force the dtype if needed. msg = ("The '{dtype}' dtype has no unit. " "Please pass in '{dtype}[ns]' instead.") if is_datetime64 and not is_dtype_equal(dtype, _NS_DTYPE): if dtype.name in ('datetime64', 'datetime64[ns]'): if dtype.name == 'datetime64': raise ValueError(msg.format(dtype=dtype.name)) dtype = _NS_DTYPE else: raise TypeError("cannot convert datetimelike to " "dtype [{dtype}]".format(dtype=dtype)) elif is_datetime64tz: # our NaT doesn't support tz's # this will coerce to DatetimeIndex with # a matching dtype below if is_scalar(value) and isna(value): value = [value] elif is_timedelta64 and not is_dtype_equal(dtype, _TD_DTYPE): if dtype.name in ('timedelta64', 'timedelta64[ns]'): if dtype.name == 'timedelta64': raise ValueError(msg.format(dtype=dtype.name)) dtype = _TD_DTYPE else: raise TypeError("cannot convert timedeltalike to " "dtype [{dtype}]".format(dtype=dtype)) if is_scalar(value): if value == iNaT or isna(value): value = iNaT else: value = np.array(value, copy=False) # have a scalar array-like (e.g. NaT) if value.ndim == 0: value = iNaT # we have an array of datetime or timedeltas & nulls elif np.prod(value.shape) or not is_dtype_equal(value.dtype, dtype): try: if is_datetime64: value = to_datetime(value, errors=errors) # GH 25843: Remove tz information since the dtype # didn't specify one if value.tz is not None: value = value.tz_localize(None) value = value._values elif is_datetime64tz: # The string check can be removed once issue #13712 # is solved. String data that is passed with a # datetime64tz is assumed to be naive which should # be localized to the timezone. is_dt_string = is_string_dtype(value) value = to_datetime(value, errors=errors).array if is_dt_string: # Strings here are naive, so directly localize value = value.tz_localize(dtype.tz) else: # Numeric values are UTC at this point, # so localize and convert value = (value.tz_localize('UTC') .tz_convert(dtype.tz)) elif is_timedelta64: value = to_timedelta(value, errors=errors)._values except (AttributeError, ValueError, TypeError): pass # coerce datetimelike to object elif is_datetime64_dtype(value) and not is_datetime64_dtype(dtype): if is_object_dtype(dtype): if value.dtype != _NS_DTYPE: value = value.astype(_NS_DTYPE) ints = np.asarray(value).view('i8') return tslib.ints_to_pydatetime(ints) # we have a non-castable dtype that was passed raise TypeError('Cannot cast datetime64 to {dtype}' .format(dtype=dtype)) else: is_array = isinstance(value, np.ndarray) # catch a datetime/timedelta that is not of ns variety # and no coercion specified if is_array and value.dtype.kind in ['M', 'm']: dtype = value.dtype if dtype.kind == 'M' and dtype != _NS_DTYPE: value = value.astype(_NS_DTYPE) elif dtype.kind == 'm' and dtype != _TD_DTYPE: value = to_timedelta(value) # only do this if we have an array and the dtype of the array is not # setup already we are not an integer/object, so don't bother with this # conversion elif not (is_array and not (issubclass(value.dtype.type, np.integer) or value.dtype == np.object_)): value = maybe_infer_to_datetimelike(value) return value
python
def maybe_cast_to_datetime(value, dtype, errors='raise'): """ try to cast the array/value to a datetimelike dtype, converting float nan to iNaT """ from pandas.core.tools.timedeltas import to_timedelta from pandas.core.tools.datetimes import to_datetime if dtype is not None: if isinstance(dtype, str): dtype = np.dtype(dtype) is_datetime64 = is_datetime64_dtype(dtype) is_datetime64tz = is_datetime64tz_dtype(dtype) is_timedelta64 = is_timedelta64_dtype(dtype) if is_datetime64 or is_datetime64tz or is_timedelta64: # Force the dtype if needed. msg = ("The '{dtype}' dtype has no unit. " "Please pass in '{dtype}[ns]' instead.") if is_datetime64 and not is_dtype_equal(dtype, _NS_DTYPE): if dtype.name in ('datetime64', 'datetime64[ns]'): if dtype.name == 'datetime64': raise ValueError(msg.format(dtype=dtype.name)) dtype = _NS_DTYPE else: raise TypeError("cannot convert datetimelike to " "dtype [{dtype}]".format(dtype=dtype)) elif is_datetime64tz: # our NaT doesn't support tz's # this will coerce to DatetimeIndex with # a matching dtype below if is_scalar(value) and isna(value): value = [value] elif is_timedelta64 and not is_dtype_equal(dtype, _TD_DTYPE): if dtype.name in ('timedelta64', 'timedelta64[ns]'): if dtype.name == 'timedelta64': raise ValueError(msg.format(dtype=dtype.name)) dtype = _TD_DTYPE else: raise TypeError("cannot convert timedeltalike to " "dtype [{dtype}]".format(dtype=dtype)) if is_scalar(value): if value == iNaT or isna(value): value = iNaT else: value = np.array(value, copy=False) # have a scalar array-like (e.g. NaT) if value.ndim == 0: value = iNaT # we have an array of datetime or timedeltas & nulls elif np.prod(value.shape) or not is_dtype_equal(value.dtype, dtype): try: if is_datetime64: value = to_datetime(value, errors=errors) # GH 25843: Remove tz information since the dtype # didn't specify one if value.tz is not None: value = value.tz_localize(None) value = value._values elif is_datetime64tz: # The string check can be removed once issue #13712 # is solved. String data that is passed with a # datetime64tz is assumed to be naive which should # be localized to the timezone. is_dt_string = is_string_dtype(value) value = to_datetime(value, errors=errors).array if is_dt_string: # Strings here are naive, so directly localize value = value.tz_localize(dtype.tz) else: # Numeric values are UTC at this point, # so localize and convert value = (value.tz_localize('UTC') .tz_convert(dtype.tz)) elif is_timedelta64: value = to_timedelta(value, errors=errors)._values except (AttributeError, ValueError, TypeError): pass # coerce datetimelike to object elif is_datetime64_dtype(value) and not is_datetime64_dtype(dtype): if is_object_dtype(dtype): if value.dtype != _NS_DTYPE: value = value.astype(_NS_DTYPE) ints = np.asarray(value).view('i8') return tslib.ints_to_pydatetime(ints) # we have a non-castable dtype that was passed raise TypeError('Cannot cast datetime64 to {dtype}' .format(dtype=dtype)) else: is_array = isinstance(value, np.ndarray) # catch a datetime/timedelta that is not of ns variety # and no coercion specified if is_array and value.dtype.kind in ['M', 'm']: dtype = value.dtype if dtype.kind == 'M' and dtype != _NS_DTYPE: value = value.astype(_NS_DTYPE) elif dtype.kind == 'm' and dtype != _TD_DTYPE: value = to_timedelta(value) # only do this if we have an array and the dtype of the array is not # setup already we are not an integer/object, so don't bother with this # conversion elif not (is_array and not (issubclass(value.dtype.type, np.integer) or value.dtype == np.object_)): value = maybe_infer_to_datetimelike(value) return value
[ "def", "maybe_cast_to_datetime", "(", "value", ",", "dtype", ",", "errors", "=", "'raise'", ")", ":", "from", "pandas", ".", "core", ".", "tools", ".", "timedeltas", "import", "to_timedelta", "from", "pandas", ".", "core", ".", "tools", ".", "datetimes", "import", "to_datetime", "if", "dtype", "is", "not", "None", ":", "if", "isinstance", "(", "dtype", ",", "str", ")", ":", "dtype", "=", "np", ".", "dtype", "(", "dtype", ")", "is_datetime64", "=", "is_datetime64_dtype", "(", "dtype", ")", "is_datetime64tz", "=", "is_datetime64tz_dtype", "(", "dtype", ")", "is_timedelta64", "=", "is_timedelta64_dtype", "(", "dtype", ")", "if", "is_datetime64", "or", "is_datetime64tz", "or", "is_timedelta64", ":", "# Force the dtype if needed.", "msg", "=", "(", "\"The '{dtype}' dtype has no unit. \"", "\"Please pass in '{dtype}[ns]' instead.\"", ")", "if", "is_datetime64", "and", "not", "is_dtype_equal", "(", "dtype", ",", "_NS_DTYPE", ")", ":", "if", "dtype", ".", "name", "in", "(", "'datetime64'", ",", "'datetime64[ns]'", ")", ":", "if", "dtype", ".", "name", "==", "'datetime64'", ":", "raise", "ValueError", "(", "msg", ".", "format", "(", "dtype", "=", "dtype", ".", "name", ")", ")", "dtype", "=", "_NS_DTYPE", "else", ":", "raise", "TypeError", "(", "\"cannot convert datetimelike to \"", "\"dtype [{dtype}]\"", ".", "format", "(", "dtype", "=", "dtype", ")", ")", "elif", "is_datetime64tz", ":", "# our NaT doesn't support tz's", "# this will coerce to DatetimeIndex with", "# a matching dtype below", "if", "is_scalar", "(", "value", ")", "and", "isna", "(", "value", ")", ":", "value", "=", "[", "value", "]", "elif", "is_timedelta64", "and", "not", "is_dtype_equal", "(", "dtype", ",", "_TD_DTYPE", ")", ":", "if", "dtype", ".", "name", "in", "(", "'timedelta64'", ",", "'timedelta64[ns]'", ")", ":", "if", "dtype", ".", "name", "==", "'timedelta64'", ":", "raise", "ValueError", "(", "msg", ".", "format", "(", "dtype", "=", "dtype", ".", "name", ")", ")", "dtype", "=", "_TD_DTYPE", "else", ":", "raise", "TypeError", "(", "\"cannot convert timedeltalike to \"", "\"dtype [{dtype}]\"", ".", "format", "(", "dtype", "=", "dtype", ")", ")", "if", "is_scalar", "(", "value", ")", ":", "if", "value", "==", "iNaT", "or", "isna", "(", "value", ")", ":", "value", "=", "iNaT", "else", ":", "value", "=", "np", ".", "array", "(", "value", ",", "copy", "=", "False", ")", "# have a scalar array-like (e.g. NaT)", "if", "value", ".", "ndim", "==", "0", ":", "value", "=", "iNaT", "# we have an array of datetime or timedeltas & nulls", "elif", "np", ".", "prod", "(", "value", ".", "shape", ")", "or", "not", "is_dtype_equal", "(", "value", ".", "dtype", ",", "dtype", ")", ":", "try", ":", "if", "is_datetime64", ":", "value", "=", "to_datetime", "(", "value", ",", "errors", "=", "errors", ")", "# GH 25843: Remove tz information since the dtype", "# didn't specify one", "if", "value", ".", "tz", "is", "not", "None", ":", "value", "=", "value", ".", "tz_localize", "(", "None", ")", "value", "=", "value", ".", "_values", "elif", "is_datetime64tz", ":", "# The string check can be removed once issue #13712", "# is solved. String data that is passed with a", "# datetime64tz is assumed to be naive which should", "# be localized to the timezone.", "is_dt_string", "=", "is_string_dtype", "(", "value", ")", "value", "=", "to_datetime", "(", "value", ",", "errors", "=", "errors", ")", ".", "array", "if", "is_dt_string", ":", "# Strings here are naive, so directly localize", "value", "=", "value", ".", "tz_localize", "(", "dtype", ".", "tz", ")", "else", ":", "# Numeric values are UTC at this point,", "# so localize and convert", "value", "=", "(", "value", ".", "tz_localize", "(", "'UTC'", ")", ".", "tz_convert", "(", "dtype", ".", "tz", ")", ")", "elif", "is_timedelta64", ":", "value", "=", "to_timedelta", "(", "value", ",", "errors", "=", "errors", ")", ".", "_values", "except", "(", "AttributeError", ",", "ValueError", ",", "TypeError", ")", ":", "pass", "# coerce datetimelike to object", "elif", "is_datetime64_dtype", "(", "value", ")", "and", "not", "is_datetime64_dtype", "(", "dtype", ")", ":", "if", "is_object_dtype", "(", "dtype", ")", ":", "if", "value", ".", "dtype", "!=", "_NS_DTYPE", ":", "value", "=", "value", ".", "astype", "(", "_NS_DTYPE", ")", "ints", "=", "np", ".", "asarray", "(", "value", ")", ".", "view", "(", "'i8'", ")", "return", "tslib", ".", "ints_to_pydatetime", "(", "ints", ")", "# we have a non-castable dtype that was passed", "raise", "TypeError", "(", "'Cannot cast datetime64 to {dtype}'", ".", "format", "(", "dtype", "=", "dtype", ")", ")", "else", ":", "is_array", "=", "isinstance", "(", "value", ",", "np", ".", "ndarray", ")", "# catch a datetime/timedelta that is not of ns variety", "# and no coercion specified", "if", "is_array", "and", "value", ".", "dtype", ".", "kind", "in", "[", "'M'", ",", "'m'", "]", ":", "dtype", "=", "value", ".", "dtype", "if", "dtype", ".", "kind", "==", "'M'", "and", "dtype", "!=", "_NS_DTYPE", ":", "value", "=", "value", ".", "astype", "(", "_NS_DTYPE", ")", "elif", "dtype", ".", "kind", "==", "'m'", "and", "dtype", "!=", "_TD_DTYPE", ":", "value", "=", "to_timedelta", "(", "value", ")", "# only do this if we have an array and the dtype of the array is not", "# setup already we are not an integer/object, so don't bother with this", "# conversion", "elif", "not", "(", "is_array", "and", "not", "(", "issubclass", "(", "value", ".", "dtype", ".", "type", ",", "np", ".", "integer", ")", "or", "value", ".", "dtype", "==", "np", ".", "object_", ")", ")", ":", "value", "=", "maybe_infer_to_datetimelike", "(", "value", ")", "return", "value" ]
try to cast the array/value to a datetimelike dtype, converting float nan to iNaT
[ "try", "to", "cast", "the", "array", "/", "value", "to", "a", "datetimelike", "dtype", "converting", "float", "nan", "to", "iNaT" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L959-L1080
train
Try to cast the array or value to a datetimelike dtype converting float nan to iNaT
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjv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RMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(10056 - 9945) + chr(86 - 36) + chr(0b10110 + 0o37) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(8496 - 8385) + chr(0b110001) + '\061' + '\x36', 11291 - 11283), ehT0Px3KOsy9('\x30' + chr(111) + chr(53) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(231 - 178) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x37' + chr(0b110010), 30399 - 30391), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(450 - 400) + chr(0b110000 + 0o6) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(2266 - 2218) + chr(0b1101111) + '\x33' + chr(0b11001 + 0o35) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101010 + 0o14) + chr(1492 - 1443), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10111 + 0o37) + '\061', 8), ehT0Px3KOsy9('\x30' + chr(0b110 + 0o151) + chr(49) + '\x33' + chr(0b101010 + 0o6), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(1102 - 1052) + '\x33' + chr(1494 - 1446), 61294 - 61286), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11100 + 0o27) + chr(51) + chr(0b100101 + 0o20), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + '\x32' + '\x34', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000 + 0o147) + chr(0b1000 + 0o52) + '\067' + '\060', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(2812 - 2757) + chr(1170 - 1117), 0b1000), ehT0Px3KOsy9(chr(1328 - 1280) + chr(0b1010000 + 0o37) + chr(0b100100 + 0o15) + '\062' + chr(0b11100 + 0o27), 0o10), ehT0Px3KOsy9(chr(1627 - 1579) + chr(9799 - 9688) + chr(0b110011) + '\060' + chr(0b11110 + 0o23), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111010 + 0o65) + chr(941 - 891) + chr(0b110111) + chr(50), 18006 - 17998), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(1788 - 1739) + chr(0b1001 + 0o50), 0b1000), ehT0Px3KOsy9(chr(221 - 173) + '\x6f' + chr(0b101 + 0o56) + chr(0b100 + 0o60) + chr(0b110110), 28778 - 28770), ehT0Px3KOsy9('\x30' + '\157' + chr(1445 - 1390) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(0b110111) + chr(0b11011 + 0o33), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b11100 + 0o33) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x36' + '\061', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(208 - 158) + '\060', 12810 - 12802), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(51) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + '\060' + chr(512 - 463), 50769 - 50761), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b110110) + chr(1356 - 1301), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\065' + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(50) + '\066', 9024 - 9016), ehT0Px3KOsy9('\x30' + chr(6516 - 6405) + chr(0b11001 + 0o32) + chr(0b1100 + 0o44) + chr(1883 - 1834), 8), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + chr(1383 - 1332) + '\x36' + chr(0b101001 + 0o14), ord("\x08")), ehT0Px3KOsy9(chr(2080 - 2032) + chr(0b1101111) + chr(135 - 85) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(1039 - 928) + '\x35' + chr(52), 40876 - 40868), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(1624 - 1570) + chr(1876 - 1828), 13780 - 13772), ehT0Px3KOsy9(chr(1244 - 1196) + chr(0b110001 + 0o76) + '\063' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + '\x33' + chr(0b100101 + 0o13) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(54) + chr(54), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(53) + '\x30', 1841 - 1833)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x85'), chr(0b110 + 0o136) + chr(6826 - 6725) + '\x63' + '\x6f' + '\144' + chr(101))('\x75' + '\164' + '\x66' + chr(0b101101) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def OyAUwM2pEbUC(QmmgWUB13VCJ, jSV9IKnemH7K, vrC59GzZXTIL=xafqLlk3kkUe(SXOLrMavuUCe(b'\xd9/F\x1d_'), '\x64' + chr(101) + '\143' + chr(0b110110 + 0o71) + chr(0b1100100) + chr(101))('\x75' + chr(116) + chr(102) + chr(0b100100 + 0o11) + '\x38')): (o52vswvoQUMc,) = (xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb/A\n[\xc3\xddR^*|\xb6\xa9{\xd7k\x0e}\xb5\xd3$\x83Z\x9b\xd0E\xf1\xea'), chr(100) + chr(3550 - 3449) + chr(0b1100011) + '\157' + chr(100) + '\x65')(chr(0b1001010 + 0o53) + chr(0b1110100) + '\x66' + chr(45) + chr(0b100110 + 0o22)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf!p\x1aS\xdd\x96UT4m\xf9'), '\x64' + chr(0b111110 + 0o47) + chr(0b11101 + 0o106) + '\157' + '\144' + chr(0b11110 + 0o107))('\x75' + chr(0b1110100) + '\146' + '\x2d' + chr(1112 - 1056))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8!]\x0b'), chr(0b1100100) + chr(0b1100101) + chr(0b11100 + 0o107) + chr(0b1101111) + '\x64' + chr(0b1010110 + 0o17))(chr(3663 - 3546) + chr(0b1100101 + 0o17) + chr(102) + chr(122 - 77) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf!@\x02I'), chr(6300 - 6200) + chr(4237 - 4136) + chr(3056 - 2957) + chr(5143 - 5032) + chr(100) + chr(0b11101 + 0o110))(chr(0b1110101) + '\x74' + chr(605 - 503) + chr(897 - 852) + chr(1961 - 1905))), xafqLlk3kkUe(SXOLrMavuUCe(b"\xdf'B\x0b^\xd5\x9fEP+"), '\144' + '\145' + '\x63' + '\157' + chr(8765 - 8665) + chr(0b1011 + 0o132))('\x75' + chr(116) + '\146' + chr(1707 - 1662) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf!p\x1aS\xdd\x96UT4m\xf9'), chr(0b1011101 + 0o7) + '\145' + chr(0b100111 + 0o74) + chr(9945 - 9834) + chr(0b11 + 0o141) + chr(2134 - 2033))(chr(0b1110101) + chr(116) + '\146' + chr(0b10 + 0o53) + chr(1479 - 1423))),) (IF08dLE993_s,) = (xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb/A\n[\xc3\xddR^*|\xb6\xa9{\xd7k\x0e}\xa5\xdb=\x83J\x97\xd1T\xe3'), '\x64' + chr(0b1100101) + '\143' + '\157' + chr(2541 - 2441) + chr(0b1100101))(chr(3361 - 3244) + '\164' + '\146' + chr(0b101000 + 0o5) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf!p\n[\xc4\x96EX5|'), chr(100) + chr(101) + '\143' + chr(690 - 579) + chr(3332 - 3232) + chr(0b1100101))(chr(117) + '\x74' + '\146' + chr(45) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8!]\x0b'), '\x64' + chr(101) + chr(0b100010 + 0o101) + '\x6f' + '\144' + '\x65')(chr(117) + '\164' + chr(0b1100110) + chr(45) + chr(365 - 309))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf!@\x02I'), '\x64' + chr(0b111001 + 0o54) + chr(0b1100011 + 0o0) + chr(0b1101111) + chr(0b1100100) + chr(9626 - 9525))(chr(11127 - 11010) + chr(0b1010 + 0o152) + chr(102) + chr(0b101010 + 0o3) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf/[\x0bN\xd9\x9eTB'), '\x64' + chr(0b1100101) + '\143' + chr(0b10111 + 0o130) + '\x64' + chr(0b111100 + 0o51))(chr(117) + chr(0b11000 + 0o134) + chr(9885 - 9783) + '\055' + chr(0b1100 + 0o54))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf!p\n[\xc4\x96EX5|'), chr(9569 - 9469) + chr(101) + '\143' + '\x6f' + chr(0b1100100) + chr(0b110101 + 0o60))(chr(0b1010001 + 0o44) + '\x74' + chr(0b1010001 + 0o25) + chr(1217 - 1172) + chr(0b1101 + 0o53))),) if jSV9IKnemH7K is not None: if PlSM16l2KDPD(jSV9IKnemH7K, M8_cKLkHVB2V): jSV9IKnemH7K = WqUC3KWvYVup.dtype(jSV9IKnemH7K) JDpUhSCjUHq0 = o97MkxKQGNoK(jSV9IKnemH7K) wUzwfWIpfaPr = WU585kKowDKQ(jSV9IKnemH7K) Cctv9L_1Ewns = n1ufouZS6xrY(jSV9IKnemH7K) if JDpUhSCjUHq0 or wUzwfWIpfaPr or Cctv9L_1Ewns: jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'\xff&JN\x1d\xcb\x97EH(|\xe5\xfa4\xdcs\x04#\xa4\x9a!\x87M\xde\xd2^\xb0\xec\xef\xde\x9f\xf8\xe1\xa5\x7fI\x11i\xa3\x96\xdb/\\\x1d\x1a\xd9\x9d\x11\x16#}\xec\xa4d\xddz&=\xb2\xe7n\xc6W\x90\xcfE\xf5\xf8\xe5\x99'), '\x64' + '\x65' + '\143' + chr(0b110010 + 0o75) + chr(0b1100100) + '\x65')('\x75' + chr(0b1110100) + '\x66' + '\x2d' + '\x38') if JDpUhSCjUHq0 and (not V1zUTkhQur0z(jSV9IKnemH7K, NTDhEo0ZZwai)): if xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\x07Y$h\xca\xbfUu>~\xde'), chr(7907 - 7807) + '\145' + '\143' + chr(111) + '\x64' + '\145')(chr(0b1110101) + '\x74' + '\x66' + chr(45) + chr(718 - 662))) in (xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf/[\x0bN\xd9\x9eT\x07l'), '\144' + '\145' + '\143' + '\x6f' + chr(8586 - 8486) + '\x65')('\165' + chr(116) + chr(0b111110 + 0o50) + chr(0b101101) + chr(1333 - 1277)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf/[\x0bN\xd9\x9eT\x07lB\xf6\xaeI'), chr(100) + chr(0b1100101) + chr(0b1000111 + 0o34) + chr(111) + chr(100) + '\x65')('\x75' + chr(0b1110100) + '\146' + chr(0b101101) + chr(56))): if xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\x07Y$h\xca\xbfUu>~\xde'), '\144' + chr(7313 - 7212) + '\x63' + chr(1758 - 1647) + chr(0b1100100) + '\145')(chr(10991 - 10874) + chr(116) + '\146' + chr(0b101101) + '\070')) == xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf/[\x0bN\xd9\x9eT\x07l'), '\144' + chr(9024 - 8923) + chr(99) + chr(111) + chr(0b1100100) + chr(101))(chr(0b11011 + 0o132) + chr(116) + chr(0b10100 + 0o122) + chr(0b101000 + 0o5) + '\x38'): raise q1QCh3W88sgk(xafqLlk3kkUe(jtbovtaIYjRB, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd!]\x03[\xc4'), chr(100) + chr(0b100010 + 0o103) + '\143' + chr(0b1101111) + chr(0b1010010 + 0o22) + chr(0b1011 + 0o132))(chr(12770 - 12653) + chr(0b101101 + 0o107) + chr(102) + '\x2d' + chr(56)))(dtype=xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\x07Y$h\xca\xbfUu>~\xde'), chr(0b1010100 + 0o20) + '\x65' + '\x63' + '\157' + '\144' + chr(8898 - 8797))(chr(0b1110101) + '\164' + chr(102) + chr(0b1000 + 0o45) + chr(0b110 + 0o62))))) jSV9IKnemH7K = NTDhEo0ZZwai else: raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\xc8/A\x00U\xc4\xd3R^6o\xfd\xaf`\x98c\x1c'\xa4\xce \x8b[\x92\xd5Z\xf5\xb9\xf5\xd8\xcb\xb2\xb5\x8ccIPA\xbd\xd2\xdf7_\x0bG\xed"), chr(0b1100100) + '\145' + chr(1295 - 1196) + chr(5970 - 5859) + '\144' + chr(10194 - 10093))('\165' + chr(116) + chr(10076 - 9974) + chr(45) + chr(0b100010 + 0o26)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd!]\x03[\xc4'), chr(0b1000111 + 0o35) + '\x65' + chr(99) + chr(111) + chr(3581 - 3481) + chr(0b1100101))(chr(117) + '\164' + '\146' + '\055' + chr(56)))(dtype=jSV9IKnemH7K)) elif wUzwfWIpfaPr: if aORqH388wQku(QmmgWUB13VCJ) and yBUx5qcFiTz6(QmmgWUB13VCJ): QmmgWUB13VCJ = [QmmgWUB13VCJ] elif Cctv9L_1Ewns and (not V1zUTkhQur0z(jSV9IKnemH7K, AMHqSK4wRc2k)): if xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\x07Y$h\xca\xbfUu>~\xde'), chr(3168 - 3068) + chr(101) + '\143' + chr(0b1101111) + '\144' + chr(101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(45) + '\070')) in (xafqLlk3kkUe(SXOLrMavuUCe(b"\xdf'B\x0b^\xd5\x9fEPn-"), chr(9302 - 9202) + chr(101) + chr(3316 - 3217) + chr(0b1101111) + chr(7498 - 7398) + '\x65')(chr(4075 - 3958) + chr(0b111110 + 0o66) + chr(6100 - 5998) + chr(1451 - 1406) + chr(0b100110 + 0o22)), xafqLlk3kkUe(SXOLrMavuUCe(b"\xdf'B\x0b^\xd5\x9fEPn-\xc3\xb3g\xe5"), chr(0b1010101 + 0o17) + chr(0b1000000 + 0o45) + chr(0b1100011) + chr(0b1010110 + 0o31) + chr(0b1100100) + chr(0b1011010 + 0o13))(chr(12981 - 12864) + chr(116) + chr(0b1100110) + chr(45) + chr(1439 - 1383))): if xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\x07Y$h\xca\xbfUu>~\xde'), chr(0b1001001 + 0o33) + chr(0b1100101) + '\x63' + chr(0b111101 + 0o62) + chr(0b1100100) + '\x65')('\x75' + '\164' + chr(6920 - 6818) + chr(530 - 485) + '\070')) == xafqLlk3kkUe(SXOLrMavuUCe(b"\xdf'B\x0b^\xd5\x9fEPn-"), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(111) + '\x64' + '\x65')(chr(117) + '\x74' + chr(0b1100110) + '\055' + chr(1514 - 1458)): raise q1QCh3W88sgk(xafqLlk3kkUe(jtbovtaIYjRB, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd!]\x03[\xc4'), '\144' + '\x65' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(101))('\x75' + chr(0b1100111 + 0o15) + chr(9920 - 9818) + chr(0b101101) + chr(3106 - 3050)))(dtype=xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\x07Y$h\xca\xbfUu>~\xde'), chr(0b10101 + 0o117) + '\145' + chr(99) + chr(0b1011001 + 0o26) + chr(1303 - 1203) + chr(0b1100101))(chr(1422 - 1305) + chr(116) + chr(9082 - 8980) + chr(0b11101 + 0o20) + '\070')))) jSV9IKnemH7K = AMHqSK4wRc2k else: raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8/A\x00U\xc4\xd3R^6o\xfd\xaf`\x98s\x14>\xa4\xde,\x8aJ\x9f\xd0X\xfb\xfc\xa1\xc3\x84\xf6\xa5\x81j\\\x15:\x9d\xcd\xcf:V\x1e_\xcd\xae'), chr(7720 - 7620) + chr(101) + chr(99) + '\x6f' + chr(0b1100100) + '\145')('\165' + chr(11234 - 11118) + '\146' + '\x2d' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd!]\x03[\xc4'), '\x64' + chr(101) + '\x63' + '\157' + chr(100) + chr(5092 - 4991))('\165' + chr(0b1111 + 0o145) + '\146' + chr(45) + chr(0b111000)))(dtype=jSV9IKnemH7K)) if aORqH388wQku(QmmgWUB13VCJ): if QmmgWUB13VCJ == gvW8CI2WhTEx or yBUx5qcFiTz6(QmmgWUB13VCJ): QmmgWUB13VCJ = gvW8CI2WhTEx else: QmmgWUB13VCJ = WqUC3KWvYVup.array(QmmgWUB13VCJ, copy=ehT0Px3KOsy9(chr(1922 - 1874) + '\x6f' + chr(0b10010 + 0o36), ord("\x08"))) if xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcc!B\x1er\xf2\x9aeB>S\xcc'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(111) + '\144' + chr(0b101 + 0o140))(chr(0b1110101) + chr(0b1110100) + chr(325 - 223) + chr(1924 - 1879) + chr(0b111000))) == ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1107 - 1059), 8): QmmgWUB13VCJ = gvW8CI2WhTEx elif xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7\x0cv\x05\r\x89\x9f\x05\x7f3!\xf0'), chr(0b11111 + 0o105) + chr(0b101000 + 0o75) + '\143' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\164' + '\146' + chr(0b101101) + chr(56)))(xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8&N\x1e_'), chr(0b1100100) + '\145' + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(102) + '\x2d' + '\070'))) or not V1zUTkhQur0z(xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf:V\x1e_'), chr(100) + chr(101) + '\x63' + '\x6f' + chr(8934 - 8834) + chr(0b1001011 + 0o32))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(1566 - 1521) + chr(182 - 126))), jSV9IKnemH7K): try: if JDpUhSCjUHq0: QmmgWUB13VCJ = IF08dLE993_s(QmmgWUB13VCJ, errors=vrC59GzZXTIL) if xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf4'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(0b11011 + 0o124) + chr(2949 - 2849) + chr(101))(chr(0b1000 + 0o155) + '\x74' + chr(0b1100110) + chr(0b101101 + 0o0) + chr(56))) is not None: QmmgWUB13VCJ = QmmgWUB13VCJ.tz_localize(None) QmmgWUB13VCJ = QmmgWUB13VCJ._values elif wUzwfWIpfaPr: IsuOn4BC8wtZ = Yg3npXqt7Ipc(QmmgWUB13VCJ) QmmgWUB13VCJ = IF08dLE993_s(QmmgWUB13VCJ, errors=vrC59GzZXTIL).array if IsuOn4BC8wtZ: QmmgWUB13VCJ = QmmgWUB13VCJ.tz_localize(jSV9IKnemH7K.tz) else: QmmgWUB13VCJ = QmmgWUB13VCJ.tz_localize(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfe\x1al'), chr(0b1010010 + 0o22) + chr(101) + chr(0b1100011) + '\157' + chr(0b10000 + 0o124) + chr(101))(chr(0b101110 + 0o107) + '\x74' + chr(102) + chr(0b100101 + 0o10) + '\070')).tz_convert(jSV9IKnemH7K.tz) elif Cctv9L_1Ewns: QmmgWUB13VCJ = o52vswvoQUMc(QmmgWUB13VCJ, errors=vrC59GzZXTIL)._values except (sHOWSIAKtU58, q1QCh3W88sgk, sznFqDbNBHlx): pass elif o97MkxKQGNoK(QmmgWUB13VCJ) and (not o97MkxKQGNoK(jSV9IKnemH7K)): if NGkWsclKfnpq(jSV9IKnemH7K): if xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf:V\x1e_'), chr(8750 - 8650) + chr(3899 - 3798) + '\x63' + chr(8762 - 8651) + '\144' + chr(101))('\165' + chr(4114 - 3998) + chr(102) + chr(45) + chr(0b111000))) != NTDhEo0ZZwai: QmmgWUB13VCJ = QmmgWUB13VCJ.astype(NTDhEo0ZZwai) pw64OfFXw6MO = WqUC3KWvYVup.asarray(QmmgWUB13VCJ).view(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc2v'), '\x64' + '\145' + chr(0b1100011) + '\x6f' + chr(3520 - 3420) + '\x65')(chr(117) + '\x74' + '\146' + chr(411 - 366) + chr(56))) return xafqLlk3kkUe(vNWoJjphZK5I, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc2 [\x1de\xc4\x9cnA!}\xf9\xa9q\xccn\x106'), chr(0b11100 + 0o110) + chr(0b1100101) + chr(99) + '\x6f' + chr(100) + '\145')(chr(0b1000011 + 0o62) + chr(116) + chr(0b1100110) + chr(0b101101) + '\070'))(pw64OfFXw6MO) raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8/A\x00U\xc4\xd3RP+m\xb8\xb9u\xccb\t:\xac\xdf\x7f\xd2\x1e\x8a\xd3\x11\xeb\xfd\xf5\xce\x9b\xb3\xbc'), '\144' + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(2151 - 2051) + '\145')(chr(1359 - 1242) + chr(0b0 + 0o164) + '\146' + chr(1869 - 1824) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd!]\x03[\xc4'), '\144' + chr(0b1100101) + chr(1939 - 1840) + '\157' + '\144' + '\x65')(chr(117) + chr(0b1100110 + 0o16) + chr(3625 - 3523) + chr(0b10110 + 0o27) + '\070'))(dtype=jSV9IKnemH7K)) else: J09NWKy25n6i = PlSM16l2KDPD(QmmgWUB13VCJ, WqUC3KWvYVup.ndarray) if J09NWKy25n6i and xafqLlk3kkUe(QmmgWUB13VCJ.dtype, xafqLlk3kkUe(SXOLrMavuUCe(b"\xc0'A\n"), chr(2151 - 2051) + chr(0b1100101) + '\143' + '\157' + chr(0b111101 + 0o47) + chr(101))(chr(10306 - 10189) + '\x74' + '\x66' + '\055' + '\070')) in [xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6'), chr(0b1100001 + 0o3) + chr(0b111101 + 0o50) + chr(0b101110 + 0o65) + chr(204 - 93) + chr(0b10100 + 0o120) + '\145')(chr(0b1010010 + 0o43) + chr(10528 - 10412) + chr(102) + chr(1014 - 969) + chr(2842 - 2786)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc6'), chr(100) + chr(101) + chr(99) + chr(111) + chr(100) + '\x65')('\165' + chr(116) + '\x66' + '\x2d' + chr(1922 - 1866))]: jSV9IKnemH7K = QmmgWUB13VCJ.dtype if xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b"\xc0'A\n"), chr(0b110100 + 0o60) + '\145' + chr(99) + chr(0b1101111) + chr(100) + '\x65')('\165' + chr(4695 - 4579) + chr(4626 - 4524) + chr(686 - 641) + '\070')) == xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6'), chr(0b1100100) + chr(0b110011 + 0o62) + chr(2786 - 2687) + '\157' + chr(0b1000000 + 0o44) + '\145')(chr(0b1000100 + 0o61) + '\164' + chr(9532 - 9430) + chr(0b101101) + chr(2964 - 2908)) and jSV9IKnemH7K != NTDhEo0ZZwai: QmmgWUB13VCJ = QmmgWUB13VCJ.astype(NTDhEo0ZZwai) elif xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b"\xc0'A\n"), '\x64' + chr(9696 - 9595) + chr(0b1100011) + chr(0b1011010 + 0o25) + chr(100) + chr(101))('\165' + '\164' + '\x66' + chr(0b101101) + chr(56))) == xafqLlk3kkUe(SXOLrMavuUCe(b'\xc6'), chr(0b1100100) + '\x65' + chr(0b100 + 0o137) + chr(111) + chr(916 - 816) + '\145')(chr(117) + chr(0b1110100) + chr(3171 - 3069) + chr(1601 - 1556) + chr(0b111000)) and jSV9IKnemH7K != AMHqSK4wRc2k: QmmgWUB13VCJ = o52vswvoQUMc(QmmgWUB13VCJ) elif not (J09NWKy25n6i and (not (J6u1YyThfhgG(xafqLlk3kkUe(QmmgWUB13VCJ.dtype, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf7_\x0b'), '\x64' + '\x65' + chr(0b1100011) + chr(0b110100 + 0o73) + chr(0b1001111 + 0o25) + chr(101))('\165' + '\x74' + chr(102) + chr(0b11111 + 0o16) + chr(0b100001 + 0o27))), xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc2 [\x0b]\xd5\x81'), '\144' + chr(101) + chr(0b1100011) + chr(9143 - 9032) + chr(0b1100100) + chr(101))(chr(2748 - 2631) + chr(0b1110100) + '\146' + chr(0b101101) + chr(56)))) or xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf:V\x1e_'), '\x64' + chr(101) + chr(0b1100011) + chr(111) + '\x64' + chr(2853 - 2752))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(45) + chr(1988 - 1932))) == xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4,E\x0bY\xc4\xac'), chr(1504 - 1404) + '\145' + chr(99) + '\x6f' + chr(5782 - 5682) + chr(5079 - 4978))(chr(0b1110101) + '\164' + chr(0b1011001 + 0o15) + chr(0b1011 + 0o42) + '\x38'))))): QmmgWUB13VCJ = Y5DUCg1pxiDF(QmmgWUB13VCJ) return QmmgWUB13VCJ
pandas-dev/pandas
pandas/core/dtypes/cast.py
find_common_type
def find_common_type(types): """ Find a common data type among the given dtypes. Parameters ---------- types : list of dtypes Returns ------- pandas extension or numpy dtype See Also -------- numpy.find_common_type """ if len(types) == 0: raise ValueError('no types given') first = types[0] # workaround for find_common_type([np.dtype('datetime64[ns]')] * 2) # => object if all(is_dtype_equal(first, t) for t in types[1:]): return first if any(isinstance(t, (PandasExtensionDtype, ExtensionDtype)) for t in types): return np.object # take lowest unit if all(is_datetime64_dtype(t) for t in types): return np.dtype('datetime64[ns]') if all(is_timedelta64_dtype(t) for t in types): return np.dtype('timedelta64[ns]') # don't mix bool / int or float or complex # this is different from numpy, which casts bool with float/int as int has_bools = any(is_bool_dtype(t) for t in types) if has_bools: for t in types: if is_integer_dtype(t) or is_float_dtype(t) or is_complex_dtype(t): return np.object return np.find_common_type(types, [])
python
def find_common_type(types): """ Find a common data type among the given dtypes. Parameters ---------- types : list of dtypes Returns ------- pandas extension or numpy dtype See Also -------- numpy.find_common_type """ if len(types) == 0: raise ValueError('no types given') first = types[0] # workaround for find_common_type([np.dtype('datetime64[ns]')] * 2) # => object if all(is_dtype_equal(first, t) for t in types[1:]): return first if any(isinstance(t, (PandasExtensionDtype, ExtensionDtype)) for t in types): return np.object # take lowest unit if all(is_datetime64_dtype(t) for t in types): return np.dtype('datetime64[ns]') if all(is_timedelta64_dtype(t) for t in types): return np.dtype('timedelta64[ns]') # don't mix bool / int or float or complex # this is different from numpy, which casts bool with float/int as int has_bools = any(is_bool_dtype(t) for t in types) if has_bools: for t in types: if is_integer_dtype(t) or is_float_dtype(t) or is_complex_dtype(t): return np.object return np.find_common_type(types, [])
[ "def", "find_common_type", "(", "types", ")", ":", "if", "len", "(", "types", ")", "==", "0", ":", "raise", "ValueError", "(", "'no types given'", ")", "first", "=", "types", "[", "0", "]", "# workaround for find_common_type([np.dtype('datetime64[ns]')] * 2)", "# => object", "if", "all", "(", "is_dtype_equal", "(", "first", ",", "t", ")", "for", "t", "in", "types", "[", "1", ":", "]", ")", ":", "return", "first", "if", "any", "(", "isinstance", "(", "t", ",", "(", "PandasExtensionDtype", ",", "ExtensionDtype", ")", ")", "for", "t", "in", "types", ")", ":", "return", "np", ".", "object", "# take lowest unit", "if", "all", "(", "is_datetime64_dtype", "(", "t", ")", "for", "t", "in", "types", ")", ":", "return", "np", ".", "dtype", "(", "'datetime64[ns]'", ")", "if", "all", "(", "is_timedelta64_dtype", "(", "t", ")", "for", "t", "in", "types", ")", ":", "return", "np", ".", "dtype", "(", "'timedelta64[ns]'", ")", "# don't mix bool / int or float or complex", "# this is different from numpy, which casts bool with float/int as int", "has_bools", "=", "any", "(", "is_bool_dtype", "(", "t", ")", "for", "t", "in", "types", ")", "if", "has_bools", ":", "for", "t", "in", "types", ":", "if", "is_integer_dtype", "(", "t", ")", "or", "is_float_dtype", "(", "t", ")", "or", "is_complex_dtype", "(", "t", ")", ":", "return", "np", ".", "object", "return", "np", ".", "find_common_type", "(", "types", ",", "[", "]", ")" ]
Find a common data type among the given dtypes. Parameters ---------- types : list of dtypes Returns ------- pandas extension or numpy dtype See Also -------- numpy.find_common_type
[ "Find", "a", "common", "data", "type", "among", "the", "given", "dtypes", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L1083-L1129
train
Find a common data type among the given dtypes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djy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Nx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1262 - 1213) + '\064' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + chr(0b110001) + '\065' + chr(50), 44239 - 44231), ehT0Px3KOsy9(chr(552 - 504) + '\x6f' + chr(49) + '\064' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(258 - 208) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + chr(2201 - 2152) + chr(0b1110 + 0o43) + chr(51), 0o10), ehT0Px3KOsy9(chr(115 - 67) + chr(111) + '\062' + chr(337 - 284) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b110011) + chr(2275 - 2221), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b10111 + 0o32) + '\063' + chr(500 - 447), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100100 + 0o16) + chr(0b110011) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(10102 - 9991) + chr(0b110010) + chr(49) + chr(2025 - 1975), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + chr(0b11 + 0o64) + chr(1913 - 1864), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100 + 0o153) + chr(51) + chr(0b110001) + chr(1112 - 1057), 58493 - 58485), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(2482 - 2431) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(851 - 803) + chr(0b101101 + 0o102) + '\061' + '\x36' + chr(733 - 678), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(2810 - 2755) + chr(0b110000), 40811 - 40803), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\067' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(2264 - 2210) + chr(0b100110 + 0o16), ord("\x08")), ehT0Px3KOsy9(chr(625 - 577) + chr(0b1 + 0o156) + chr(140 - 89) + chr(0b11100 + 0o24) + chr(0b111 + 0o60), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b111 + 0o56) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\062' + chr(0b11101 + 0o26), 21437 - 21429), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + '\x36' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + chr(0b11110 + 0o23) + '\060' + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b11 + 0o64) + chr(0b110010), 56477 - 56469), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b110011) + chr(0b110 + 0o52), 57847 - 57839), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b111 + 0o57) + chr(0b100 + 0o62), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + chr(0b110011) + chr(48) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10011 + 0o37) + chr(0b110011) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100 + 0o153) + '\x31' + '\062' + chr(0b11110 + 0o26), 51962 - 51954), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(0b11001 + 0o36) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(1282 - 1229) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(2003 - 1955) + chr(111) + chr(2622 - 2570) + chr(2572 - 2521), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100110 + 0o11) + chr(0b1 + 0o60) + chr(0b10111 + 0o36) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b100000 + 0o21) + chr(48), 11646 - 11638), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + '\x31' + '\063', 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101101 + 0o11), 34101 - 34093), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + '\x35', 21334 - 21326), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(51) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(111) + chr(0b110010) + '\x31' + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b110110) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(208 - 160) + chr(8521 - 8410) + chr(52) + '\067', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1001101 + 0o42) + '\x35' + chr(0b100000 + 0o20), 14643 - 14635)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'N'), '\144' + chr(9801 - 9700) + chr(1658 - 1559) + chr(0b111001 + 0o66) + chr(1986 - 1886) + '\145')(chr(0b1011011 + 0o32) + chr(0b1110100) + '\x66' + chr(117 - 72) + chr(2444 - 2388)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def woIVsKzuubjn(yorMPSC245Rr): if c2A0yzQpDQB3(yorMPSC245Rr) == ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\060', 0b1000): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e\x05F`2\xdd\xfb.\xbb\xed\xd0\xb9>\x19'), chr(0b10101 + 0o117) + chr(705 - 604) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(832 - 731))('\x75' + '\x74' + '\146' + chr(45) + chr(0b10001 + 0o47))) It1LJs8swHZQ = yorMPSC245Rr[ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110000), 8)] if Dl48nj1rbi23((V1zUTkhQur0z(It1LJs8swHZQ, YeT3l7JgTbWR) for YeT3l7JgTbWR in yorMPSC245Rr[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101111 + 0o2), 29423 - 29415):])): return It1LJs8swHZQ if UVSi4XW7eBIM((PlSM16l2KDPD(YeT3l7JgTbWR, (XUxth3wPX4GL, K_UiWxHwnoI8)) for YeT3l7JgTbWR in yorMPSC245Rr)): return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\x08\x0cq(\xd9'), chr(5398 - 5298) + '\145' + chr(661 - 562) + chr(5621 - 5510) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(116) + '\x66' + '\x2d' + '\x38')) if Dl48nj1rbi23((o97MkxKQGNoK(YeT3l7JgTbWR) for YeT3l7JgTbWR in yorMPSC245Rr)): return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\x1e\x1fd.'), '\144' + '\145' + '\143' + '\157' + chr(100) + '\x65')(chr(117) + '\164' + chr(102) + chr(0b11110 + 0o17) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\x0b\x12q?\xc4\xf38\xad\xbe\xe2\xa1(*'), chr(6838 - 6738) + '\145' + chr(0b1001001 + 0o32) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b1001110 + 0o47) + chr(116) + chr(0b1100110) + '\055' + chr(0b1011 + 0o55))) if Dl48nj1rbi23((n1ufouZS6xrY(YeT3l7JgTbWR) for YeT3l7JgTbWR in yorMPSC245Rr)): return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\x1e\x1fd.'), chr(7751 - 7651) + '\145' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\165' + chr(116) + chr(0b1100110) + chr(0b101001 + 0o4) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\x03\x0bq/\xc8\xf2)\xfa\xbc\x8d\x945\x04\xa5'), '\x64' + chr(2218 - 2117) + chr(0b111101 + 0o46) + '\157' + chr(0b1000001 + 0o43) + '\x65')('\x75' + chr(116) + chr(0b1001110 + 0o30) + chr(0b101101) + chr(0b111000))) WDTMyY2C5KnK = UVSi4XW7eBIM((DF2fzoInk6aW(YeT3l7JgTbWR) for YeT3l7JgTbWR in yorMPSC245Rr)) if WDTMyY2C5KnK: for YeT3l7JgTbWR in yorMPSC245Rr: if vbqhcY5kX820(YeT3l7JgTbWR) or GID6_fWM6lkY(YeT3l7JgTbWR) or kXFBbcHbhCKD(YeT3l7JgTbWR): return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\x08\x0cq(\xd9'), '\144' + '\145' + chr(2853 - 2754) + chr(0b110101 + 0o72) + chr(0b100110 + 0o76) + chr(101))(chr(117) + '\x74' + chr(0b100011 + 0o103) + chr(1043 - 998) + chr(0b100101 + 0o23))) return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x06\x03\x08p\x14\xce\xf10\xf6\xe5\xd7\x90/\x0e\x88Y'), '\144' + chr(0b1000101 + 0o40) + chr(0b1100011) + chr(0b1101111) + chr(825 - 725) + chr(101))(chr(0b1010100 + 0o41) + '\164' + '\x66' + chr(0b101101) + '\x38'))(yorMPSC245Rr, [])
pandas-dev/pandas
pandas/core/dtypes/cast.py
cast_scalar_to_array
def cast_scalar_to_array(shape, value, dtype=None): """ create np.ndarray of specified shape and dtype, filled with values Parameters ---------- shape : tuple value : scalar value dtype : np.dtype, optional dtype to coerce Returns ------- ndarray of shape, filled with value, of specified / inferred dtype """ if dtype is None: dtype, fill_value = infer_dtype_from_scalar(value) else: fill_value = value values = np.empty(shape, dtype=dtype) values.fill(fill_value) return values
python
def cast_scalar_to_array(shape, value, dtype=None): """ create np.ndarray of specified shape and dtype, filled with values Parameters ---------- shape : tuple value : scalar value dtype : np.dtype, optional dtype to coerce Returns ------- ndarray of shape, filled with value, of specified / inferred dtype """ if dtype is None: dtype, fill_value = infer_dtype_from_scalar(value) else: fill_value = value values = np.empty(shape, dtype=dtype) values.fill(fill_value) return values
[ "def", "cast_scalar_to_array", "(", "shape", ",", "value", ",", "dtype", "=", "None", ")", ":", "if", "dtype", "is", "None", ":", "dtype", ",", "fill_value", "=", "infer_dtype_from_scalar", "(", "value", ")", "else", ":", "fill_value", "=", "value", "values", "=", "np", ".", "empty", "(", "shape", ",", "dtype", "=", "dtype", ")", "values", ".", "fill", "(", "fill_value", ")", "return", "values" ]
create np.ndarray of specified shape and dtype, filled with values Parameters ---------- shape : tuple value : scalar value dtype : np.dtype, optional dtype to coerce Returns ------- ndarray of shape, filled with value, of specified / inferred dtype
[ "create", "np", ".", "ndarray", "of", "specified", "shape", "and", "dtype", "filled", "with", "values" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L1132-L1157
train
Coerce scalar value to array.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0Cg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w8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1100 + 0o143) + '\062' + chr(0b110100) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(54) + chr(0b101100 + 0o11), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(2130 - 2082) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(6012 - 5901) + chr(0b11010 + 0o30) + '\060' + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + '\061' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + '\061' + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + chr(7749 - 7638) + chr(0b110010) + '\062' + '\x35', 14471 - 14463), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1487 - 1436) + chr(0b110010) + chr(0b110101), 32157 - 32149), ehT0Px3KOsy9(chr(48) + chr(2884 - 2773) + chr(2119 - 2068) + '\062' + chr(846 - 791), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + '\067' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9575 - 9464) + '\x34' + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x34' + chr(55), 0b1000), ehT0Px3KOsy9(chr(1245 - 1197) + chr(0b1101111) + chr(0b1001 + 0o50) + chr(728 - 675) + '\063', 46209 - 46201), ehT0Px3KOsy9(chr(0b110000) + chr(0b10111 + 0o130) + chr(50) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(50), 35340 - 35332), ehT0Px3KOsy9('\x30' + chr(0b1010001 + 0o36) + '\062' + '\061' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(2048 - 1998), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2592 - 2541) + chr(0b110001) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(50) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(2211 - 2163) + chr(111) + chr(0b110000 + 0o4) + '\x35', 0b1000), ehT0Px3KOsy9(chr(1219 - 1171) + chr(0b1101111) + '\063' + '\x34' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\067' + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(1234 - 1185) + '\x32' + chr(51 - 1), 0b1000), ehT0Px3KOsy9(chr(1896 - 1848) + chr(2554 - 2443) + chr(462 - 413) + chr(51) + '\063', 5730 - 5722), ehT0Px3KOsy9(chr(1657 - 1609) + chr(0b1101111) + chr(1447 - 1398) + chr(0b1011 + 0o46) + chr(321 - 268), 0b1000), ehT0Px3KOsy9(chr(1309 - 1261) + chr(0b1010110 + 0o31) + chr(0b110011) + '\065' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2785 - 2674) + '\x32' + '\063' + chr(50), 0o10), ehT0Px3KOsy9(chr(2004 - 1956) + '\x6f' + chr(49) + chr(0b1001 + 0o52), 0o10), ehT0Px3KOsy9(chr(1317 - 1269) + chr(0b1101111) + '\x33' + chr(0b111 + 0o55) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + chr(6111 - 6000) + chr(55) + chr(0b110101), 37332 - 37324), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\062' + chr(0b11110 + 0o24), 0b1000), ehT0Px3KOsy9(chr(1864 - 1816) + chr(0b1101111) + chr(0b110010) + chr(54) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(0b110010) + chr(1439 - 1389), 8), ehT0Px3KOsy9(chr(1410 - 1362) + chr(111) + chr(426 - 377) + chr(0b110111) + chr(0b110111), 52075 - 52067), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + '\062' + chr(53) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b110110) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\x30' + chr(0b1010 + 0o54), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1111 + 0o43) + chr(106 - 58) + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b10010 + 0o42) + chr(0b100000 + 0o24), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1491 - 1442) + chr(48) + chr(0b110100), 49723 - 49715)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(604 - 551) + chr(309 - 261), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a'), chr(803 - 703) + chr(7942 - 7841) + chr(99) + chr(0b110011 + 0o74) + chr(4425 - 4325) + chr(101))(chr(10732 - 10615) + chr(0b1010011 + 0o41) + '\x66' + chr(1818 - 1773) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Dy0JbGgncwHz(nauYfLglTpcb, QmmgWUB13VCJ, jSV9IKnemH7K=None): if jSV9IKnemH7K is None: (jSV9IKnemH7K, RlLNSsrUm3zD) = yiULQ6ujWzz0(QmmgWUB13VCJ) else: RlLNSsrUm3zD = QmmgWUB13VCJ SPnCNu54H1db = WqUC3KWvYVup.empty(nauYfLglTpcb, dtype=jSV9IKnemH7K) xafqLlk3kkUe(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc2\\/\xec'), '\x64' + chr(0b1100101) + '\143' + '\x6f' + chr(0b1100100) + chr(0b101011 + 0o72))(chr(8232 - 8115) + '\x74' + '\146' + '\055' + chr(0b111000)))(RlLNSsrUm3zD) return SPnCNu54H1db
pandas-dev/pandas
pandas/core/dtypes/cast.py
construct_1d_arraylike_from_scalar
def construct_1d_arraylike_from_scalar(value, length, dtype): """ create a np.ndarray / pandas type of specified shape and dtype filled with values Parameters ---------- value : scalar value length : int dtype : pandas_dtype / np.dtype Returns ------- np.ndarray / pandas type of length, filled with value """ if is_datetime64tz_dtype(dtype): from pandas import DatetimeIndex subarr = DatetimeIndex([value] * length, dtype=dtype) elif is_categorical_dtype(dtype): from pandas import Categorical subarr = Categorical([value] * length, dtype=dtype) else: if not isinstance(dtype, (np.dtype, type(np.dtype))): dtype = dtype.dtype if length and is_integer_dtype(dtype) and isna(value): # coerce if we have nan for an integer dtype dtype = np.dtype('float64') elif isinstance(dtype, np.dtype) and dtype.kind in ("U", "S"): # we need to coerce to object dtype to avoid # to allow numpy to take our string as a scalar value dtype = object if not isna(value): value = to_str(value) subarr = np.empty(length, dtype=dtype) subarr.fill(value) return subarr
python
def construct_1d_arraylike_from_scalar(value, length, dtype): """ create a np.ndarray / pandas type of specified shape and dtype filled with values Parameters ---------- value : scalar value length : int dtype : pandas_dtype / np.dtype Returns ------- np.ndarray / pandas type of length, filled with value """ if is_datetime64tz_dtype(dtype): from pandas import DatetimeIndex subarr = DatetimeIndex([value] * length, dtype=dtype) elif is_categorical_dtype(dtype): from pandas import Categorical subarr = Categorical([value] * length, dtype=dtype) else: if not isinstance(dtype, (np.dtype, type(np.dtype))): dtype = dtype.dtype if length and is_integer_dtype(dtype) and isna(value): # coerce if we have nan for an integer dtype dtype = np.dtype('float64') elif isinstance(dtype, np.dtype) and dtype.kind in ("U", "S"): # we need to coerce to object dtype to avoid # to allow numpy to take our string as a scalar value dtype = object if not isna(value): value = to_str(value) subarr = np.empty(length, dtype=dtype) subarr.fill(value) return subarr
[ "def", "construct_1d_arraylike_from_scalar", "(", "value", ",", "length", ",", "dtype", ")", ":", "if", "is_datetime64tz_dtype", "(", "dtype", ")", ":", "from", "pandas", "import", "DatetimeIndex", "subarr", "=", "DatetimeIndex", "(", "[", "value", "]", "*", "length", ",", "dtype", "=", "dtype", ")", "elif", "is_categorical_dtype", "(", "dtype", ")", ":", "from", "pandas", "import", "Categorical", "subarr", "=", "Categorical", "(", "[", "value", "]", "*", "length", ",", "dtype", "=", "dtype", ")", "else", ":", "if", "not", "isinstance", "(", "dtype", ",", "(", "np", ".", "dtype", ",", "type", "(", "np", ".", "dtype", ")", ")", ")", ":", "dtype", "=", "dtype", ".", "dtype", "if", "length", "and", "is_integer_dtype", "(", "dtype", ")", "and", "isna", "(", "value", ")", ":", "# coerce if we have nan for an integer dtype", "dtype", "=", "np", ".", "dtype", "(", "'float64'", ")", "elif", "isinstance", "(", "dtype", ",", "np", ".", "dtype", ")", "and", "dtype", ".", "kind", "in", "(", "\"U\"", ",", "\"S\"", ")", ":", "# we need to coerce to object dtype to avoid", "# to allow numpy to take our string as a scalar value", "dtype", "=", "object", "if", "not", "isna", "(", "value", ")", ":", "value", "=", "to_str", "(", "value", ")", "subarr", "=", "np", ".", "empty", "(", "length", ",", "dtype", "=", "dtype", ")", "subarr", ".", "fill", "(", "value", ")", "return", "subarr" ]
create a np.ndarray / pandas type of specified shape and dtype filled with values Parameters ---------- value : scalar value length : int dtype : pandas_dtype / np.dtype Returns ------- np.ndarray / pandas type of length, filled with value
[ "create", "a", "np", ".", "ndarray", "/", "pandas", "type", "of", "specified", "shape", "and", "dtype", "filled", "with", "values" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L1160-L1199
train
constructs a 1d array of specified shape and dtype with values
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu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dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + '\062', 22748 - 22740), ehT0Px3KOsy9('\060' + chr(6745 - 6634) + chr(1034 - 983) + chr(1251 - 1201) + chr(0b11101 + 0o31), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101011 + 0o5), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1055 - 1004) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(1833 - 1785) + chr(492 - 381) + chr(50) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(49) + chr(0b10101 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(53) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100101 + 0o12) + chr(0b110100) + chr(55), 43281 - 43273), ehT0Px3KOsy9('\060' + '\x6f' + chr(456 - 407) + '\x34' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + '\062' + chr(0b10110 + 0o37), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101010 + 0o10) + chr(0b110111) + chr(0b101110 + 0o11), 8449 - 8441), ehT0Px3KOsy9(chr(48) + chr(0b11011 + 0o124) + chr(0b110001) + chr(721 - 669) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(875 - 827) + chr(0b1101111) + chr(0b100110 + 0o14) + '\065' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(0b110111) + chr(892 - 841), 0b1000), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(0b110001) + '\x34' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(51) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10438 - 10327) + chr(0b110001) + chr(699 - 644) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101000 + 0o12) + '\x32' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(1018 - 967) + chr(0b11010 + 0o32) + chr(0b101111 + 0o1), 0b1000), ehT0Px3KOsy9(chr(48) + chr(10439 - 10328) + chr(0b110 + 0o54) + chr(0b101000 + 0o10) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b110111 + 0o70) + chr(1057 - 1007) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(2079 - 2031) + '\x6f' + chr(0b110011) + chr(53) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1688 - 1637) + '\x36' + chr(1265 - 1216), 33609 - 33601), ehT0Px3KOsy9('\060' + chr(0b1101110 + 0o1) + chr(51) + chr(0b110101) + chr(934 - 880), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b0 + 0o157) + chr(1515 - 1464) + chr(0b110111) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000111 + 0o50) + chr(0b110 + 0o55) + '\062' + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000010 + 0o55) + '\x33' + '\067' + chr(0b110001 + 0o1), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1 + 0o156) + chr(0b110011) + chr(48) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + '\x33' + '\x34', 17440 - 17432), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\x6f' + chr(53) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b101010 + 0o105) + '\062' + '\062' + chr(0b11010 + 0o26), 0b1000), ehT0Px3KOsy9(chr(60 - 12) + chr(10566 - 10455) + '\062' + '\x35' + '\067', 16805 - 16797), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(515 - 464) + '\062' + '\063', 8), ehT0Px3KOsy9(chr(841 - 793) + chr(0b101100 + 0o103) + chr(1504 - 1455) + '\060' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(3933 - 3822) + chr(235 - 184) + chr(50) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(55) + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(327 - 277) + chr(0b110001) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110111) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b111010 + 0o65) + chr(51) + chr(0b110011) + '\x31', 22724 - 22716)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(6219 - 6108) + '\x35' + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'$'), '\x64' + chr(0b1100101) + chr(5888 - 5789) + chr(5542 - 5431) + chr(100) + chr(101))(chr(7671 - 7554) + '\x74' + chr(0b1000100 + 0o42) + chr(1252 - 1207) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def bTuibSAyvThM(QmmgWUB13VCJ, CHAOgk5VCHH_, jSV9IKnemH7K): if WU585kKowDKQ(jSV9IKnemH7K): (BH788a2q6sDc,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'z\xb7wd{d'), chr(100) + chr(1332 - 1231) + chr(9314 - 9215) + chr(0b1101111) + '\144' + chr(10180 - 10079))('\x75' + '\164' + chr(102) + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'N\xb7men~\xe3\x08n\x08q\xda\x1a'), chr(0b1100100) + chr(0b1001010 + 0o33) + '\x63' + '\x6f' + chr(0b1100100) + chr(101))('\165' + chr(0b111111 + 0o65) + chr(102) + '\x2d' + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'N\xb7men~\xe3\x08n\x08q\xda\x1a'), chr(0b1100100) + chr(0b1011010 + 0o13) + '\x63' + chr(111) + chr(0b100101 + 0o77) + '\145')('\x75' + chr(0b1110100) + chr(102) + chr(45) + chr(0b111000))),) v90CNIZuLOk4 = BH788a2q6sDc([QmmgWUB13VCJ] * CHAOgk5VCHH_, dtype=jSV9IKnemH7K) elif P9dMe_tcBUdc(jSV9IKnemH7K): (XxOW0_jwnido,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'z\xb7wd{d'), '\x64' + chr(6381 - 6280) + '\x63' + chr(111) + chr(0b1001000 + 0o34) + chr(0b1100101))('\165' + chr(9264 - 9148) + chr(102) + chr(0b1000 + 0o45) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'I\xb7me}x\xfc\x04D\x07y'), chr(2198 - 2098) + chr(1382 - 1281) + '\143' + '\x6f' + chr(0b1100100) + chr(101))('\x75' + chr(7754 - 7638) + chr(102) + chr(0b101101) + chr(2294 - 2238))), xafqLlk3kkUe(SXOLrMavuUCe(b'I\xb7me}x\xfc\x04D\x07y'), chr(0b100000 + 0o104) + chr(0b1100101) + '\x63' + '\157' + '\x64' + chr(0b11110 + 0o107))(chr(0b1001110 + 0o47) + chr(0b1110100) + chr(102) + '\x2d' + chr(56))),) v90CNIZuLOk4 = XxOW0_jwnido([QmmgWUB13VCJ] * CHAOgk5VCHH_, dtype=jSV9IKnemH7K) else: if not PlSM16l2KDPD(jSV9IKnemH7K, (xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'n\xa2`p\x7f'), chr(0b1100100) + chr(9995 - 9894) + chr(99) + chr(0b1010011 + 0o34) + chr(0b1100100) + chr(101))('\x75' + chr(7308 - 7192) + '\146' + chr(45) + '\x38')), wmQmyeWBmUpv(xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'n\xa2`p\x7f'), '\144' + chr(0b11110 + 0o107) + chr(0b110100 + 0o57) + chr(0b1100000 + 0o17) + chr(9980 - 9880) + chr(591 - 490))(chr(0b1110101) + chr(1990 - 1874) + chr(102) + chr(45) + chr(2341 - 2285)))))): jSV9IKnemH7K = jSV9IKnemH7K.dtype if CHAOgk5VCHH_ and vbqhcY5kX820(jSV9IKnemH7K) and yBUx5qcFiTz6(QmmgWUB13VCJ): jSV9IKnemH7K = WqUC3KWvYVup.dtype(xafqLlk3kkUe(SXOLrMavuUCe(b'l\xbavan!\xba'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b1000000 + 0o57) + '\x64' + chr(944 - 843))(chr(0b1011101 + 0o30) + chr(0b110001 + 0o103) + chr(0b1010000 + 0o26) + chr(0b101101) + '\x38')) elif PlSM16l2KDPD(jSV9IKnemH7K, xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'n\xa2`p\x7f'), chr(0b0 + 0o144) + '\145' + '\143' + chr(0b1101111) + '\144' + '\x65')('\x75' + chr(0b110000 + 0o104) + chr(2573 - 2471) + chr(0b1111 + 0o36) + chr(0b111000 + 0o0)))) and xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'a\xbfwd'), chr(100) + chr(0b110010 + 0o63) + chr(99) + chr(5319 - 5208) + chr(0b1000110 + 0o36) + chr(101))(chr(0b110010 + 0o103) + chr(0b1110100) + chr(4286 - 4184) + '\x2d' + chr(0b111000 + 0o0))) in (xafqLlk3kkUe(SXOLrMavuUCe(b'_'), chr(2886 - 2786) + chr(4532 - 4431) + chr(0b1000110 + 0o35) + chr(0b1101111) + '\144' + '\x65')(chr(0b1110101) + chr(0b1001111 + 0o45) + '\x66' + chr(1648 - 1603) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'Y'), chr(8372 - 8272) + '\145' + chr(0b1010110 + 0o15) + '\157' + chr(0b10101 + 0o117) + '\145')(chr(117) + chr(0b1100101 + 0o17) + chr(0b1100110) + chr(1720 - 1675) + chr(0b1100 + 0o54))): jSV9IKnemH7K = sR_24x3xd4bh if not yBUx5qcFiTz6(QmmgWUB13VCJ): QmmgWUB13VCJ = GvDTOHVnsr7F(QmmgWUB13VCJ) v90CNIZuLOk4 = WqUC3KWvYVup.empty(CHAOgk5VCHH_, dtype=jSV9IKnemH7K) xafqLlk3kkUe(v90CNIZuLOk4, xafqLlk3kkUe(SXOLrMavuUCe(b'l\xbful'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + '\144' + chr(0b1100101))('\x75' + chr(116) + chr(0b1100110) + chr(1497 - 1452) + chr(56)))(QmmgWUB13VCJ) return v90CNIZuLOk4
pandas-dev/pandas
pandas/core/dtypes/cast.py
construct_1d_object_array_from_listlike
def construct_1d_object_array_from_listlike(values): """ Transform any list-like object in a 1-dimensional numpy array of object dtype. Parameters ---------- values : any iterable which has a len() Raises ------ TypeError * If `values` does not have a len() Returns ------- 1-dimensional numpy array of dtype object """ # numpy will try to interpret nested lists as further dimensions, hence # making a 1D array that contains list-likes is a bit tricky: result = np.empty(len(values), dtype='object') result[:] = values return result
python
def construct_1d_object_array_from_listlike(values): """ Transform any list-like object in a 1-dimensional numpy array of object dtype. Parameters ---------- values : any iterable which has a len() Raises ------ TypeError * If `values` does not have a len() Returns ------- 1-dimensional numpy array of dtype object """ # numpy will try to interpret nested lists as further dimensions, hence # making a 1D array that contains list-likes is a bit tricky: result = np.empty(len(values), dtype='object') result[:] = values return result
[ "def", "construct_1d_object_array_from_listlike", "(", "values", ")", ":", "# numpy will try to interpret nested lists as further dimensions, hence", "# making a 1D array that contains list-likes is a bit tricky:", "result", "=", "np", ".", "empty", "(", "len", "(", "values", ")", ",", "dtype", "=", "'object'", ")", "result", "[", ":", "]", "=", "values", "return", "result" ]
Transform any list-like object in a 1-dimensional numpy array of object dtype. Parameters ---------- values : any iterable which has a len() Raises ------ TypeError * If `values` does not have a len() Returns ------- 1-dimensional numpy array of dtype object
[ "Transform", "any", "list", "-", "like", "object", "in", "a", "1", "-", "dimensional", "numpy", "array", "of", "object", "dtype", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L1202-L1224
train
Transform any list - like object in a 1 - dimensional numpy array of dtype object .
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALC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k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(551 - 503) + chr(0b1101111) + '\063' + chr(1872 - 1817) + chr(2027 - 1975), 0b1000), ehT0Px3KOsy9('\x30' + chr(6112 - 6001) + '\061' + chr(1472 - 1420), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(0b110001) + chr(49) + chr(0b10101 + 0o42), 22569 - 22561), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + '\x34' + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + '\x31', 12121 - 12113), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11010 + 0o27) + '\x33' + '\x31', 45505 - 45497), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b100110 + 0o14) + chr(2981 - 2926), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(1002 - 954) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1011 + 0o47) + chr(54) + chr(1707 - 1657), 48555 - 48547), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(0b110010) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100100 + 0o113) + chr(50) + chr(0b11111 + 0o22) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(2472 - 2361) + chr(0b110011) + chr(0b110111) + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10011 + 0o134) + '\x31' + chr(157 - 103) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + '\x32' + '\060' + chr(1260 - 1206), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1437 - 1387) + chr(238 - 185) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + '\062' + chr(0b10111 + 0o34), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(0b1001 + 0o52) + chr(0b110000) + chr(940 - 885), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + chr(0b110011) + chr(2699 - 2645) + chr(0b110110), 51202 - 51194), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b101 + 0o60) + chr(53), 61750 - 61742), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10 + 0o60) + '\066', 34509 - 34501), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + chr(756 - 706) + chr(0b110010) + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101001 + 0o6) + chr(51) + chr(1229 - 1181) + '\067', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(1386 - 1332) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(6365 - 6254) + chr(0b110011) + '\x32' + chr(1631 - 1578), 52181 - 52173), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\157' + '\x34' + chr(2423 - 2373), 38808 - 38800), ehT0Px3KOsy9(chr(519 - 471) + chr(0b10011 + 0o134) + '\062' + '\062' + chr(54), 0o10), ehT0Px3KOsy9(chr(2183 - 2135) + '\157' + '\062' + '\062' + chr(1037 - 987), 8), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1010010 + 0o35) + chr(49) + chr(0b110101) + chr(0b10100 + 0o41), 8), ehT0Px3KOsy9(chr(48) + '\157' + '\064' + chr(1932 - 1884), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(52) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(1386 - 1275) + chr(1314 - 1261) + chr(51), 0o10), ehT0Px3KOsy9(chr(188 - 140) + chr(10527 - 10416) + '\x33' + chr(48) + chr(1411 - 1356), 8), ehT0Px3KOsy9('\x30' + chr(5979 - 5868) + chr(0b101 + 0o56), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011101 + 0o22) + chr(51) + '\060' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(55) + '\x31', 0b1000), ehT0Px3KOsy9(chr(194 - 146) + chr(0b1101111) + chr(0b110 + 0o53) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(52) + chr(0b10111 + 0o33), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1918 - 1867) + '\x36' + chr(0b110001), 64934 - 64926), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1011 + 0o50) + '\064' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(52) + '\x30', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + chr(2489 - 2436) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2'), chr(100) + '\145' + chr(0b1111 + 0o124) + chr(111) + chr(100) + chr(3202 - 3101))('\x75' + '\x74' + chr(102) + chr(0b101101) + chr(2783 - 2727)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def WSrFjWjGncz3(SPnCNu54H1db): ShZmEKfTkAOZ = WqUC3KWvYVup.empty(c2A0yzQpDQB3(SPnCNu54H1db), dtype=xafqLlk3kkUe(SXOLrMavuUCe(b'\x93n%\x06j-'), chr(0b1100010 + 0o2) + '\145' + chr(8693 - 8594) + '\157' + chr(0b1100100) + chr(101))('\165' + '\164' + chr(0b1010 + 0o134) + '\055' + '\x38')) ShZmEKfTkAOZ[:] = SPnCNu54H1db return ShZmEKfTkAOZ
pandas-dev/pandas
pandas/core/dtypes/cast.py
construct_1d_ndarray_preserving_na
def construct_1d_ndarray_preserving_na(values, dtype=None, copy=False): """ Construct a new ndarray, coercing `values` to `dtype`, preserving NA. Parameters ---------- values : Sequence dtype : numpy.dtype, optional copy : bool, default False Note that copies may still be made with ``copy=False`` if casting is required. Returns ------- arr : ndarray[dtype] Examples -------- >>> np.array([1.0, 2.0, None], dtype='str') array(['1.0', '2.0', 'None'], dtype='<U4') >>> construct_1d_ndarray_preserving_na([1.0, 2.0, None], dtype='str') """ subarr = np.array(values, dtype=dtype, copy=copy) if dtype is not None and dtype.kind in ("U", "S"): # GH-21083 # We can't just return np.array(subarr, dtype='str') since # NumPy will convert the non-string objects into strings # Including NA values. Se we have to go # string -> object -> update NA, which requires an # additional pass over the data. na_values = isna(values) subarr2 = subarr.astype(object) subarr2[na_values] = np.asarray(values, dtype=object)[na_values] subarr = subarr2 return subarr
python
def construct_1d_ndarray_preserving_na(values, dtype=None, copy=False): """ Construct a new ndarray, coercing `values` to `dtype`, preserving NA. Parameters ---------- values : Sequence dtype : numpy.dtype, optional copy : bool, default False Note that copies may still be made with ``copy=False`` if casting is required. Returns ------- arr : ndarray[dtype] Examples -------- >>> np.array([1.0, 2.0, None], dtype='str') array(['1.0', '2.0', 'None'], dtype='<U4') >>> construct_1d_ndarray_preserving_na([1.0, 2.0, None], dtype='str') """ subarr = np.array(values, dtype=dtype, copy=copy) if dtype is not None and dtype.kind in ("U", "S"): # GH-21083 # We can't just return np.array(subarr, dtype='str') since # NumPy will convert the non-string objects into strings # Including NA values. Se we have to go # string -> object -> update NA, which requires an # additional pass over the data. na_values = isna(values) subarr2 = subarr.astype(object) subarr2[na_values] = np.asarray(values, dtype=object)[na_values] subarr = subarr2 return subarr
[ "def", "construct_1d_ndarray_preserving_na", "(", "values", ",", "dtype", "=", "None", ",", "copy", "=", "False", ")", ":", "subarr", "=", "np", ".", "array", "(", "values", ",", "dtype", "=", "dtype", ",", "copy", "=", "copy", ")", "if", "dtype", "is", "not", "None", "and", "dtype", ".", "kind", "in", "(", "\"U\"", ",", "\"S\"", ")", ":", "# GH-21083", "# We can't just return np.array(subarr, dtype='str') since", "# NumPy will convert the non-string objects into strings", "# Including NA values. Se we have to go", "# string -> object -> update NA, which requires an", "# additional pass over the data.", "na_values", "=", "isna", "(", "values", ")", "subarr2", "=", "subarr", ".", "astype", "(", "object", ")", "subarr2", "[", "na_values", "]", "=", "np", ".", "asarray", "(", "values", ",", "dtype", "=", "object", ")", "[", "na_values", "]", "subarr", "=", "subarr2", "return", "subarr" ]
Construct a new ndarray, coercing `values` to `dtype`, preserving NA. Parameters ---------- values : Sequence dtype : numpy.dtype, optional copy : bool, default False Note that copies may still be made with ``copy=False`` if casting is required. Returns ------- arr : ndarray[dtype] Examples -------- >>> np.array([1.0, 2.0, None], dtype='str') array(['1.0', '2.0', 'None'], dtype='<U4') >>> construct_1d_ndarray_preserving_na([1.0, 2.0, None], dtype='str')
[ "Construct", "a", "new", "ndarray", "coercing", "values", "to", "dtype", "preserving", "NA", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L1227-L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AeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11010 + 0o31) + chr(0b0 + 0o65) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + chr(0b110011) + chr(48) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + '\x31' + chr(51) + chr(0b110000), 31950 - 31942), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\x6f' + chr(0b110111) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + '\x36' + chr(0b110100), 33489 - 33481), ehT0Px3KOsy9('\060' + chr(264 - 153) + '\x31' + '\067', 6518 - 6510), ehT0Px3KOsy9('\060' + '\x6f' + chr(1479 - 1430) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101111 + 0o4) + chr(0b110001) + chr(0b100010 + 0o16), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + '\x33' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\x30' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(0b110001) + chr(760 - 711), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000110 + 0o51) + chr(0b110001) + '\066' + chr(1935 - 1887), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(4283 - 4172) + chr(0b110010) + '\x33' + chr(2842 - 2787), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100110 + 0o13) + '\061' + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(2528 - 2417) + '\x33' + chr(51) + chr(121 - 70), ord("\x08")), ehT0Px3KOsy9(chr(1500 - 1452) + '\x6f' + chr(0b110011) + '\x30' + chr(1629 - 1579), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101100 + 0o3) + '\x35' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1514 - 1463) + chr(0b110101) + chr(0b10101 + 0o34), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000001 + 0o56) + chr(50) + '\063', 0o10), ehT0Px3KOsy9(chr(1207 - 1159) + chr(0b101011 + 0o104) + '\x31' + '\064' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b111 + 0o53) + chr(0b100011 + 0o21), 27443 - 27435), ehT0Px3KOsy9(chr(0b110000) + chr(0b101000 + 0o107) + chr(0b110011) + chr(50) + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(0b100001 + 0o20) + chr(0b1100 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(3726 - 3615) + '\x33' + chr(0b110001 + 0o2) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(279 - 231) + '\157' + chr(51) + chr(0b110101) + chr(50), 42810 - 42802), ehT0Px3KOsy9('\060' + chr(4973 - 4862) + chr(2742 - 2688) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\x30' + chr(0b10 + 0o57), 58962 - 58954), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\x36' + chr(54), 24160 - 24152), ehT0Px3KOsy9(chr(128 - 80) + '\157' + chr(51) + chr(52) + chr(0b100101 + 0o17), 65265 - 65257), ehT0Px3KOsy9(chr(48) + chr(12071 - 11960) + chr(2050 - 1999) + chr(0b110000) + '\x35', 8), ehT0Px3KOsy9('\060' + '\157' + chr(53), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\067' + '\x33', 57233 - 57225), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101 + 0o55) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(52) + chr(0b110011), 55961 - 55953), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(0b100010 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(1196 - 1148) + chr(111) + chr(50) + chr(0b110011) + chr(2228 - 2178), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(7627 - 7516) + '\x36' + '\x34', 8), ehT0Px3KOsy9('\060' + chr(8028 - 7917) + '\x32' + '\066', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b110000), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(11101 - 10990) + chr(915 - 862) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0'), chr(0b11110 + 0o106) + chr(101) + chr(8823 - 8724) + chr(0b1101111) + chr(0b1100100) + chr(0b1100010 + 0o3))(chr(0b111101 + 0o70) + chr(116) + '\x66' + chr(481 - 436) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Hrh_oidp_ldG(SPnCNu54H1db, jSV9IKnemH7K=None, igThHS4jwVsa=ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + '\060', 25281 - 25273)): v90CNIZuLOk4 = WqUC3KWvYVup.array(SPnCNu54H1db, dtype=jSV9IKnemH7K, copy=igThHS4jwVsa) if jSV9IKnemH7K is not None and xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\xa86_'), '\x64' + '\145' + chr(3392 - 3293) + '\x6f' + chr(0b101101 + 0o67) + '\x65')(chr(0b1000 + 0o155) + chr(9102 - 8986) + chr(102) + chr(0b101101) + chr(0b10011 + 0o45))) in (xafqLlk3kkUe(SXOLrMavuUCe(b'\xbb'), chr(100) + chr(0b1100101) + '\x63' + chr(9062 - 8951) + '\144' + chr(101))('\x75' + '\164' + chr(0b1100 + 0o132) + chr(45) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd'), chr(9839 - 9739) + chr(101) + '\143' + chr(8480 - 8369) + chr(6607 - 6507) + chr(6702 - 6601))(chr(0b110101 + 0o100) + chr(116) + chr(3522 - 3420) + '\055' + '\070')): f1JrdXaQm87D = yBUx5qcFiTz6(SPnCNu54H1db) LBOuQx2_wxgW = v90CNIZuLOk4.astype(sR_24x3xd4bh) LBOuQx2_wxgW[f1JrdXaQm87D] = WqUC3KWvYVup.asarray(SPnCNu54H1db, dtype=sR_24x3xd4bh)[f1JrdXaQm87D] v90CNIZuLOk4 = LBOuQx2_wxgW return v90CNIZuLOk4
pandas-dev/pandas
pandas/core/dtypes/cast.py
maybe_cast_to_integer_array
def maybe_cast_to_integer_array(arr, dtype, copy=False): """ Takes any dtype and returns the casted version, raising for when data is incompatible with integer/unsigned integer dtypes. .. versionadded:: 0.24.0 Parameters ---------- arr : array-like The array to cast. dtype : str, np.dtype The integer dtype to cast the array to. copy: boolean, default False Whether to make a copy of the array before returning. Returns ------- int_arr : ndarray An array of integer or unsigned integer dtype Raises ------ OverflowError : the dtype is incompatible with the data ValueError : loss of precision has occurred during casting Examples -------- If you try to coerce negative values to unsigned integers, it raises: >>> Series([-1], dtype="uint64") Traceback (most recent call last): ... OverflowError: Trying to coerce negative values to unsigned integers Also, if you try to coerce float values to integers, it raises: >>> Series([1, 2, 3.5], dtype="int64") Traceback (most recent call last): ... ValueError: Trying to coerce float values to integers """ try: if not hasattr(arr, "astype"): casted = np.array(arr, dtype=dtype, copy=copy) else: casted = arr.astype(dtype, copy=copy) except OverflowError: raise OverflowError("The elements provided in the data cannot all be " "casted to the dtype {dtype}".format(dtype=dtype)) if np.array_equal(arr, casted): return casted # We do this casting to allow for proper # data and dtype checking. # # We didn't do this earlier because NumPy # doesn't handle `uint64` correctly. arr = np.asarray(arr) if is_unsigned_integer_dtype(dtype) and (arr < 0).any(): raise OverflowError("Trying to coerce negative values " "to unsigned integers") if is_integer_dtype(dtype) and (is_float_dtype(arr) or is_object_dtype(arr)): raise ValueError("Trying to coerce float values to integers")
python
def maybe_cast_to_integer_array(arr, dtype, copy=False): """ Takes any dtype and returns the casted version, raising for when data is incompatible with integer/unsigned integer dtypes. .. versionadded:: 0.24.0 Parameters ---------- arr : array-like The array to cast. dtype : str, np.dtype The integer dtype to cast the array to. copy: boolean, default False Whether to make a copy of the array before returning. Returns ------- int_arr : ndarray An array of integer or unsigned integer dtype Raises ------ OverflowError : the dtype is incompatible with the data ValueError : loss of precision has occurred during casting Examples -------- If you try to coerce negative values to unsigned integers, it raises: >>> Series([-1], dtype="uint64") Traceback (most recent call last): ... OverflowError: Trying to coerce negative values to unsigned integers Also, if you try to coerce float values to integers, it raises: >>> Series([1, 2, 3.5], dtype="int64") Traceback (most recent call last): ... ValueError: Trying to coerce float values to integers """ try: if not hasattr(arr, "astype"): casted = np.array(arr, dtype=dtype, copy=copy) else: casted = arr.astype(dtype, copy=copy) except OverflowError: raise OverflowError("The elements provided in the data cannot all be " "casted to the dtype {dtype}".format(dtype=dtype)) if np.array_equal(arr, casted): return casted # We do this casting to allow for proper # data and dtype checking. # # We didn't do this earlier because NumPy # doesn't handle `uint64` correctly. arr = np.asarray(arr) if is_unsigned_integer_dtype(dtype) and (arr < 0).any(): raise OverflowError("Trying to coerce negative values " "to unsigned integers") if is_integer_dtype(dtype) and (is_float_dtype(arr) or is_object_dtype(arr)): raise ValueError("Trying to coerce float values to integers")
[ "def", "maybe_cast_to_integer_array", "(", "arr", ",", "dtype", ",", "copy", "=", "False", ")", ":", "try", ":", "if", "not", "hasattr", "(", "arr", ",", "\"astype\"", ")", ":", "casted", "=", "np", ".", "array", "(", "arr", ",", "dtype", "=", "dtype", ",", "copy", "=", "copy", ")", "else", ":", "casted", "=", "arr", ".", "astype", "(", "dtype", ",", "copy", "=", "copy", ")", "except", "OverflowError", ":", "raise", "OverflowError", "(", "\"The elements provided in the data cannot all be \"", "\"casted to the dtype {dtype}\"", ".", "format", "(", "dtype", "=", "dtype", ")", ")", "if", "np", ".", "array_equal", "(", "arr", ",", "casted", ")", ":", "return", "casted", "# We do this casting to allow for proper", "# data and dtype checking.", "#", "# We didn't do this earlier because NumPy", "# doesn't handle `uint64` correctly.", "arr", "=", "np", ".", "asarray", "(", "arr", ")", "if", "is_unsigned_integer_dtype", "(", "dtype", ")", "and", "(", "arr", "<", "0", ")", ".", "any", "(", ")", ":", "raise", "OverflowError", "(", "\"Trying to coerce negative values \"", "\"to unsigned integers\"", ")", "if", "is_integer_dtype", "(", "dtype", ")", "and", "(", "is_float_dtype", "(", "arr", ")", "or", "is_object_dtype", "(", "arr", ")", ")", ":", "raise", "ValueError", "(", "\"Trying to coerce float values to integers\"", ")" ]
Takes any dtype and returns the casted version, raising for when data is incompatible with integer/unsigned integer dtypes. .. versionadded:: 0.24.0 Parameters ---------- arr : array-like The array to cast. dtype : str, np.dtype The integer dtype to cast the array to. copy: boolean, default False Whether to make a copy of the array before returning. Returns ------- int_arr : ndarray An array of integer or unsigned integer dtype Raises ------ OverflowError : the dtype is incompatible with the data ValueError : loss of precision has occurred during casting Examples -------- If you try to coerce negative values to unsigned integers, it raises: >>> Series([-1], dtype="uint64") Traceback (most recent call last): ... OverflowError: Trying to coerce negative values to unsigned integers Also, if you try to coerce float values to integers, it raises: >>> Series([1, 2, 3.5], dtype="int64") Traceback (most recent call last): ... ValueError: Trying to coerce float values to integers
[ "Takes", "any", "dtype", "and", "returns", "the", "casted", "version", "raising", "for", "when", "data", "is", "incompatible", "with", "integer", "/", "unsigned", "integer", "dtypes", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/dtypes/cast.py#L1269-L1337
train
Casts an array to integer array.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o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edError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + '\061' + chr(1308 - 1258) + chr(0b110000), 19351 - 19343), ehT0Px3KOsy9('\060' + '\157' + chr(2138 - 2085) + chr(2096 - 2047), 34022 - 34014), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(3981 - 3870) + '\x33' + '\x35' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(797 - 746) + chr(1412 - 1363) + chr(0b1110 + 0o43), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100001 + 0o16) + chr(50) + chr(0b110101) + chr(0b110011), 61406 - 61398), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1101 + 0o44) + chr(55) + chr(170 - 117), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1287 - 1236) + '\x32' + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b111 + 0o52) + chr(0b110100) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(2193 - 2145) + '\x6f' + chr(0b10100 + 0o37) + chr(0b100000 + 0o27) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\060' + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101000 + 0o12) + chr(0b100001 + 0o26) + chr(51), 37747 - 37739), ehT0Px3KOsy9(chr(1084 - 1036) + chr(0b1101111) + chr(0b10100 + 0o37) + chr(52) + '\065', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11111 + 0o23) + chr(51) + '\063', 1045 - 1037), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + chr(51) + chr(0b101110 + 0o2) + '\x31', 5920 - 5912), ehT0Px3KOsy9(chr(1824 - 1776) + '\x6f' + '\x33' + chr(1595 - 1546) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(993 - 945) + chr(0b1101111) + '\x32' + chr(0b10011 + 0o41) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8144 - 8033) + chr(2006 - 1955) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2389 - 2338) + '\x33' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100111 + 0o12) + chr(0b10100 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(1011 - 963) + chr(0b1101111) + chr(0b11 + 0o63) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5090 - 4979) + '\061' + chr(0b10010 + 0o37), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + '\065' + chr(0b110111), 38312 - 38304), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + '\062' + chr(0b110110) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(7924 - 7813) + chr(0b110010) + chr(0b10010 + 0o42) + chr(2138 - 2087), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + chr(0b110010) + '\061', 38619 - 38611), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(1864 - 1753) + chr(0b110010) + chr(0b101000 + 0o10), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x35' + chr(2352 - 2298), 40532 - 40524), ehT0Px3KOsy9(chr(1196 - 1148) + chr(0b1101111 + 0o0) + chr(0b110001) + chr(0b101000 + 0o16) + chr(1949 - 1899), 1764 - 1756), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1111 + 0o43) + '\x34' + chr(53), 36242 - 36234), ehT0Px3KOsy9(chr(48) + chr(5088 - 4977) + chr(0b110001) + chr(0b110111) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + chr(48) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + chr(0b100000 + 0o22) + chr(368 - 316) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + chr(10184 - 10073) + '\063' + chr(0b11011 + 0o25) + chr(0b10111 + 0o32), 8), ehT0Px3KOsy9('\060' + chr(0b1100000 + 0o17) + chr(50) + chr(0b110010) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(784 - 734) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100111 + 0o10) + chr(2155 - 2103) + chr(975 - 922), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(0b110001) + chr(0b110101 + 0o2), 53130 - 53122), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10101 + 0o35) + '\x37' + chr(196 - 141), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(54) + chr(50), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + '\065' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'~'), chr(0b1000011 + 0o41) + chr(0b1100101) + '\143' + '\x6f' + '\x64' + chr(0b1100101))(chr(10157 - 10040) + chr(0b1100011 + 0o21) + chr(102) + '\055' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def iDaPSOIT4ckJ(ZxkNvNvuRNy5, jSV9IKnemH7K, igThHS4jwVsa=ehT0Px3KOsy9(chr(48) + chr(0b1010010 + 0o35) + chr(0b110000), ord("\x08"))): try: if not lot1PSoAwYhj(ZxkNvNvuRNy5, xafqLlk3kkUe(SXOLrMavuUCe(b'1Z\x9dl\xb9\xce'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(111) + chr(100) + '\145')(chr(0b11100 + 0o131) + chr(10510 - 10394) + chr(0b1100110) + '\x2d' + chr(2292 - 2236))): tF8kxZWI9ii9 = WqUC3KWvYVup.array(ZxkNvNvuRNy5, dtype=jSV9IKnemH7K, copy=igThHS4jwVsa) else: tF8kxZWI9ii9 = ZxkNvNvuRNy5.astype(jSV9IKnemH7K, copy=igThHS4jwVsa) except N5Ee6d9YGQ_x: raise N5Ee6d9YGQ_x(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x04A\x8c5\xac\xc7\x18\xbb\x03\x94\xb7\xc8\xc5\xeb\xb3\xa4\xd7q\xb9mV)\x06\xdc\x83exKR\xc1\x1e\xf4\xc1\xe1\xf3wKa\xd0FpH\x85y\xe9\xc9\x18\xf6\x05\x9b\xb0\xcf\x80\xff\xe1\xbf\xce8\xa9`W)\x0b\xc6\xdaau\x0e\t\xc1\x0b\xf9\xd0\xa4\xed'), '\x64' + '\145' + chr(0b101111 + 0o64) + '\157' + chr(100) + chr(0b1010001 + 0o24))(chr(12894 - 12777) + chr(0b1110100) + '\x66' + '\055' + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'6F\x9bx\xa8\xdf'), chr(0b1100100) + '\145' + chr(237 - 138) + chr(11420 - 11309) + chr(0b100000 + 0o104) + chr(0b111000 + 0o55))(chr(117) + chr(3309 - 3193) + '\146' + '\x2d' + '\070'))(dtype=jSV9IKnemH7K)) if xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'1[\x9bt\xb0\xf4\x18\xa7\x13\x9b\xaf'), chr(0b111000 + 0o54) + chr(101) + chr(0b100101 + 0o76) + '\157' + chr(3172 - 3072) + chr(101))(chr(0b1110101) + chr(10895 - 10779) + chr(0b1011001 + 0o15) + '\055' + '\070'))(ZxkNvNvuRNy5, tF8kxZWI9ii9): return tF8kxZWI9ii9 ZxkNvNvuRNy5 = WqUC3KWvYVup.asarray(ZxkNvNvuRNy5) if qhL16yfy51I3(jSV9IKnemH7K) and xafqLlk3kkUe(ZxkNvNvuRNy5 < ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\060', 8), xafqLlk3kkUe(SXOLrMavuUCe(b'\x05\x7f\xba|\xfd\xf3*\xe1\x03\xb8\x8a\xf6'), chr(4851 - 4751) + '\145' + chr(99) + '\x6f' + chr(100) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(102) + chr(45) + chr(56)))(): raise N5Ee6d9YGQ_x(xafqLlk3kkUe(SXOLrMavuUCe(b'\x04[\x90|\xa7\xcc]\xa2\t\xda\xa0\xd4\x80\xe9\xa2\xae\x81v\xb8oS}\x06\xc4\xc61fO\x1e\xd0\x1a\xf3\x80\xb5\xff6Pa\xcc[7G\x8cq\xe9\xc2\x13\xa2\x03\x9d\xa6\xc9\x96'), '\x64' + '\x65' + chr(99) + chr(2261 - 2150) + chr(100) + chr(2932 - 2831))(chr(373 - 256) + chr(0b1011100 + 0o30) + chr(8105 - 8003) + '\055' + chr(56))) if vbqhcY5kX820(jSV9IKnemH7K) and (GID6_fWM6lkY(ZxkNvNvuRNy5) or NGkWsclKfnpq(ZxkNvNvuRNy5)): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x04[\x90|\xa7\xcc]\xa2\t\xda\xa0\xd4\x80\xe9\xa2\xae\x81~\xb1gS}O\xc4\xc2}eK\x01\x85\x0b\xef\x80\xa8\xfeb@h\xda@#'), chr(0b1001111 + 0o25) + chr(0b1001111 + 0o26) + chr(0b1100011) + chr(0b1011001 + 0o26) + chr(2456 - 2356) + '\x65')(chr(0b1110101) + '\164' + chr(102) + '\055' + chr(56)))
pandas-dev/pandas
pandas/plotting/_core.py
scatter_plot
def scatter_plot(data, x, y, by=None, ax=None, figsize=None, grid=False, **kwargs): """ Make a scatter plot from two DataFrame columns Parameters ---------- data : DataFrame x : Column name for the x-axis values y : Column name for the y-axis values ax : Matplotlib axis object figsize : A tuple (width, height) in inches grid : Setting this to True will show the grid kwargs : other plotting keyword arguments To be passed to scatter function Returns ------- matplotlib.Figure """ import matplotlib.pyplot as plt kwargs.setdefault('edgecolors', 'none') def plot_group(group, ax): xvals = group[x].values yvals = group[y].values ax.scatter(xvals, yvals, **kwargs) ax.grid(grid) if by is not None: fig = _grouped_plot(plot_group, data, by=by, figsize=figsize, ax=ax) else: if ax is None: fig = plt.figure() ax = fig.add_subplot(111) else: fig = ax.get_figure() plot_group(data, ax) ax.set_ylabel(pprint_thing(y)) ax.set_xlabel(pprint_thing(x)) ax.grid(grid) return fig
python
def scatter_plot(data, x, y, by=None, ax=None, figsize=None, grid=False, **kwargs): """ Make a scatter plot from two DataFrame columns Parameters ---------- data : DataFrame x : Column name for the x-axis values y : Column name for the y-axis values ax : Matplotlib axis object figsize : A tuple (width, height) in inches grid : Setting this to True will show the grid kwargs : other plotting keyword arguments To be passed to scatter function Returns ------- matplotlib.Figure """ import matplotlib.pyplot as plt kwargs.setdefault('edgecolors', 'none') def plot_group(group, ax): xvals = group[x].values yvals = group[y].values ax.scatter(xvals, yvals, **kwargs) ax.grid(grid) if by is not None: fig = _grouped_plot(plot_group, data, by=by, figsize=figsize, ax=ax) else: if ax is None: fig = plt.figure() ax = fig.add_subplot(111) else: fig = ax.get_figure() plot_group(data, ax) ax.set_ylabel(pprint_thing(y)) ax.set_xlabel(pprint_thing(x)) ax.grid(grid) return fig
[ "def", "scatter_plot", "(", "data", ",", "x", ",", "y", ",", "by", "=", "None", ",", "ax", "=", "None", ",", "figsize", "=", "None", ",", "grid", "=", "False", ",", "*", "*", "kwargs", ")", ":", "import", "matplotlib", ".", "pyplot", "as", "plt", "kwargs", ".", "setdefault", "(", "'edgecolors'", ",", "'none'", ")", "def", "plot_group", "(", "group", ",", "ax", ")", ":", "xvals", "=", "group", "[", "x", "]", ".", "values", "yvals", "=", "group", "[", "y", "]", ".", "values", "ax", ".", "scatter", "(", "xvals", ",", "yvals", ",", "*", "*", "kwargs", ")", "ax", ".", "grid", "(", "grid", ")", "if", "by", "is", "not", "None", ":", "fig", "=", "_grouped_plot", "(", "plot_group", ",", "data", ",", "by", "=", "by", ",", "figsize", "=", "figsize", ",", "ax", "=", "ax", ")", "else", ":", "if", "ax", "is", "None", ":", "fig", "=", "plt", ".", "figure", "(", ")", "ax", "=", "fig", ".", "add_subplot", "(", "111", ")", "else", ":", "fig", "=", "ax", ".", "get_figure", "(", ")", "plot_group", "(", "data", ",", "ax", ")", "ax", ".", "set_ylabel", "(", "pprint_thing", "(", "y", ")", ")", "ax", ".", "set_xlabel", "(", "pprint_thing", "(", "x", ")", ")", "ax", ".", "grid", "(", "grid", ")", "return", "fig" ]
Make a scatter plot from two DataFrame columns Parameters ---------- data : DataFrame x : Column name for the x-axis values y : Column name for the y-axis values ax : Matplotlib axis object figsize : A tuple (width, height) in inches grid : Setting this to True will show the grid kwargs : other plotting keyword arguments To be passed to scatter function Returns ------- matplotlib.Figure
[ "Make", "a", "scatter", "plot", "from", "two", "DataFrame", "columns" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L2284-L2328
train
Make a scatter plot from two DataFrame columns x y and by.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoV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Lo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(0b110111) + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(5290 - 5179) + '\x32' + chr(51) + chr(0b1010 + 0o53), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1101111) + chr(0b110001) + '\065' + chr(50), 1301 - 1293), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(1339 - 1288) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110111) + chr(1887 - 1838), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100001 + 0o23) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b110100) + chr(1769 - 1717), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + '\x33' + '\x35' + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(0b1000011 + 0o54) + '\062' + '\066' + '\x30', 0b1000), ehT0Px3KOsy9(chr(1982 - 1934) + chr(2283 - 2172) + chr(599 - 548) + chr(48) + chr(53), 0b1000), ehT0Px3KOsy9(chr(549 - 501) + chr(1480 - 1369) + chr(0b10111 + 0o33) + '\063' + chr(489 - 439), 29337 - 29329), ehT0Px3KOsy9('\x30' + chr(111) + chr(54) + chr(1130 - 1079), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(48) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(1244 - 1133) + '\062' + '\061' + chr(0b100001 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(647 - 597) + '\x32' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1011011 + 0o24) + chr(51) + '\066' + '\x32', 0o10), ehT0Px3KOsy9('\x30' + chr(3688 - 3577) + '\x33' + chr(1782 - 1730), 0o10), ehT0Px3KOsy9('\x30' + chr(0b101100 + 0o103) + chr(0b10010 + 0o45) + chr(0b11111 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(1160 - 1112) + '\157' + chr(1170 - 1121) + '\x36' + chr(0b10001 + 0o42), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100111 + 0o110) + chr(49) + chr(1986 - 1935) + chr(0b10001 + 0o40), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + '\062' + chr(0b110100 + 0o1), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b10110 + 0o37) + '\x30', 0o10), ehT0Px3KOsy9(chr(2295 - 2247) + chr(111) + chr(0b110010) + chr(0b110110) + chr(2018 - 1965), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1180 - 1131), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101100 + 0o7), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b10100 + 0o36) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\x32' + chr(2500 - 2447), 5550 - 5542), ehT0Px3KOsy9('\060' + '\157' + chr(1028 - 978) + chr(0b110100) + chr(192 - 138), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\x34' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(111) + chr(0b110011) + '\061' + '\061', 0b1000), ehT0Px3KOsy9(chr(1381 - 1333) + '\x6f' + chr(0b100000 + 0o23) + chr(524 - 476), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10011 + 0o134) + '\x36' + chr(1384 - 1333), 8), ehT0Px3KOsy9(chr(891 - 843) + '\157' + chr(0b110001) + chr(0b10000 + 0o46) + chr(0b100100 + 0o20), 33483 - 33475), ehT0Px3KOsy9(chr(1950 - 1902) + chr(9343 - 9232) + '\061' + chr(2329 - 2275), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(4156 - 4045) + chr(2469 - 2418) + chr(0b100011 + 0o20) + chr(2072 - 2022), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11101 + 0o122) + '\066' + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3384 - 3273) + '\063' + chr(55) + chr(0b11100 + 0o31), 16656 - 16648), ehT0Px3KOsy9(chr(1323 - 1275) + chr(0b1000000 + 0o57) + '\x31' + '\061' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3124 - 3013) + chr(0b11001 + 0o32) + chr(1411 - 1359), 8), ehT0Px3KOsy9(chr(0b110000) + chr(1891 - 1780) + '\062' + chr(0b110010) + '\062', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + chr(53) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4'), chr(320 - 220) + chr(101) + chr(879 - 780) + chr(0b1101111) + chr(0b1100100 + 0o0) + '\x65')(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b0 + 0o70)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def OzbeBliZLXk3(ULnjp6D6efFH, OeWW0F1dBPRQ, SqiSOtYOqOJH, KPtq2czfwPS6=None, UFCqCPYQEkxy=None, EOCd1WZj2r_S=None, HQlygFZjk_Ts=ehT0Px3KOsy9('\060' + '\x6f' + '\060', 0o10), **M8EIoTs2GJXE): (eRubm8FH879n,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x97\xfc\x1e\xabUM\x10\x87\xd9\xa7\xb4C>\xf8\xfc\x9dh'), chr(100) + chr(4395 - 4294) + chr(2624 - 2525) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(117) + chr(4217 - 4101) + chr(0b1100110) + '\055' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a\xe4\x1a\xb7VV'), chr(251 - 151) + '\x65' + '\x63' + '\157' + chr(0b1100100) + chr(101))('\165' + chr(116) + chr(6877 - 6775) + chr(1355 - 1310) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a\xe4\x1a\xb7VV'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\144' + '\x65')(chr(0b100000 + 0o125) + chr(3893 - 3777) + chr(102) + chr(0b101001 + 0o4) + '\070')),) xafqLlk3kkUe(M8EIoTs2GJXE, xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\xf8\x1e\xbf\\D\x05\x9e\xdc\xb1'), '\x64' + chr(0b1000010 + 0o43) + chr(99) + chr(0b1101111) + chr(0b1111 + 0o125) + chr(0b101010 + 0o73))('\165' + '\x74' + chr(0b1100110) + '\055' + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\xf9\r\xbeZM\x08\x84\xc2\xb6'), chr(0b100001 + 0o103) + '\x65' + chr(99) + chr(0b1101111) + chr(0b1001 + 0o133) + chr(0b1100101))(chr(9374 - 9257) + '\164' + chr(102) + chr(1418 - 1373) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x94\xf2\x04\xbe'), chr(0b1100100) + chr(0b1100101) + chr(99) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(4096 - 3979) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(2806 - 2750))) def Bg_IDOb9VeQN(N9UnmYvaW1pO, UFCqCPYQEkxy): MNxMise_IlMm = N9UnmYvaW1pO[OeWW0F1dBPRQ].SPnCNu54H1db DhgkejRtBdRL = N9UnmYvaW1pO[SqiSOtYOqOJH].SPnCNu54H1db xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\xfe\x0b\xafMG\x16'), chr(0b1100100) + '\145' + chr(9678 - 9579) + '\x6f' + chr(0b1100100) + chr(0b1010000 + 0o25))(chr(752 - 635) + '\x74' + chr(4993 - 4891) + chr(0b1 + 0o54) + chr(56)))(MNxMise_IlMm, DhgkejRtBdRL, **M8EIoTs2GJXE) xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\xef\x03\xbf'), chr(0b1100100) + chr(0b111011 + 0o52) + chr(99) + '\x6f' + chr(0b1001101 + 0o27) + chr(101))('\x75' + chr(10553 - 10437) + chr(0b1100110) + chr(0b10101 + 0o30) + '\x38'))(HQlygFZjk_Ts) if KPtq2czfwPS6 is not None: IPypcZ53eNRW = U0P5py7sbftJ(Bg_IDOb9VeQN, ULnjp6D6efFH, by=KPtq2czfwPS6, figsize=EOCd1WZj2r_S, ax=UFCqCPYQEkxy) else: if UFCqCPYQEkxy is None: IPypcZ53eNRW = eRubm8FH879n.figure() UFCqCPYQEkxy = IPypcZ53eNRW.add_subplot(ehT0Px3KOsy9('\060' + chr(0b101100 + 0o103) + '\061' + chr(0b110101) + '\x37', 15590 - 15582)) else: IPypcZ53eNRW = UFCqCPYQEkxy.get_figure() Bg_IDOb9VeQN(ULnjp6D6efFH, UFCqCPYQEkxy) xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\xf8\x1e\x84@N\x05\x89\xd5\xa9'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(7678 - 7578) + '\x65')('\x75' + '\164' + '\146' + chr(830 - 785) + '\x38'))(wXDH9bYGsgMR(SqiSOtYOqOJH)) xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\xf8\x1e\x84AN\x05\x89\xd5\xa9'), chr(0b1100100) + '\x65' + chr(0b11111 + 0o104) + chr(9570 - 9459) + chr(1129 - 1029) + chr(1444 - 1343))(chr(0b10110 + 0o137) + '\x74' + '\x66' + chr(1529 - 1484) + chr(0b10110 + 0o42)))(wXDH9bYGsgMR(OeWW0F1dBPRQ)) xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\xef\x03\xbf'), chr(100) + '\145' + chr(0b1100011) + chr(1165 - 1054) + '\x64' + chr(0b111011 + 0o52))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(1792 - 1747) + chr(0b10111 + 0o41)))(HQlygFZjk_Ts) return IPypcZ53eNRW
pandas-dev/pandas
pandas/plotting/_core.py
hist_frame
def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None, xrot=None, ylabelsize=None, yrot=None, ax=None, sharex=False, sharey=False, figsize=None, layout=None, bins=10, **kwds): """ Make a histogram of the DataFrame's. A `histogram`_ is a representation of the distribution of data. This function calls :meth:`matplotlib.pyplot.hist`, on each series in the DataFrame, resulting in one histogram per column. .. _histogram: https://en.wikipedia.org/wiki/Histogram Parameters ---------- data : DataFrame The pandas object holding the data. column : string or sequence If passed, will be used to limit data to a subset of columns. by : object, optional If passed, then used to form histograms for separate groups. grid : bool, default True Whether to show axis grid lines. xlabelsize : int, default None If specified changes the x-axis label size. xrot : float, default None Rotation of x axis labels. For example, a value of 90 displays the x labels rotated 90 degrees clockwise. ylabelsize : int, default None If specified changes the y-axis label size. yrot : float, default None Rotation of y axis labels. For example, a value of 90 displays the y labels rotated 90 degrees clockwise. ax : Matplotlib axes object, default None The axes to plot the histogram on. sharex : bool, default True if ax is None else False In case subplots=True, share x axis and set some x axis labels to invisible; defaults to True if ax is None otherwise False if an ax is passed in. Note that passing in both an ax and sharex=True will alter all x axis labels for all subplots in a figure. sharey : bool, default False In case subplots=True, share y axis and set some y axis labels to invisible. figsize : tuple The size in inches of the figure to create. Uses the value in `matplotlib.rcParams` by default. layout : tuple, optional Tuple of (rows, columns) for the layout of the histograms. bins : integer or sequence, default 10 Number of histogram bins to be used. If an integer is given, bins + 1 bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified. **kwds All other plotting keyword arguments to be passed to :meth:`matplotlib.pyplot.hist`. Returns ------- matplotlib.AxesSubplot or numpy.ndarray of them See Also -------- matplotlib.pyplot.hist : Plot a histogram using matplotlib. Examples -------- .. plot:: :context: close-figs This example draws a histogram based on the length and width of some animals, displayed in three bins >>> df = pd.DataFrame({ ... 'length': [1.5, 0.5, 1.2, 0.9, 3], ... 'width': [0.7, 0.2, 0.15, 0.2, 1.1] ... }, index= ['pig', 'rabbit', 'duck', 'chicken', 'horse']) >>> hist = df.hist(bins=3) """ _raise_if_no_mpl() _converter._WARN = False if by is not None: axes = grouped_hist(data, column=column, by=by, ax=ax, grid=grid, figsize=figsize, sharex=sharex, sharey=sharey, layout=layout, bins=bins, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot, **kwds) return axes if column is not None: if not isinstance(column, (list, np.ndarray, ABCIndexClass)): column = [column] data = data[column] data = data._get_numeric_data() naxes = len(data.columns) fig, axes = _subplots(naxes=naxes, ax=ax, squeeze=False, sharex=sharex, sharey=sharey, figsize=figsize, layout=layout) _axes = _flatten(axes) for i, col in enumerate(com.try_sort(data.columns)): ax = _axes[i] ax.hist(data[col].dropna().values, bins=bins, **kwds) ax.set_title(col) ax.grid(grid) _set_ticks_props(axes, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot) fig.subplots_adjust(wspace=0.3, hspace=0.3) return axes
python
def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None, xrot=None, ylabelsize=None, yrot=None, ax=None, sharex=False, sharey=False, figsize=None, layout=None, bins=10, **kwds): """ Make a histogram of the DataFrame's. A `histogram`_ is a representation of the distribution of data. This function calls :meth:`matplotlib.pyplot.hist`, on each series in the DataFrame, resulting in one histogram per column. .. _histogram: https://en.wikipedia.org/wiki/Histogram Parameters ---------- data : DataFrame The pandas object holding the data. column : string or sequence If passed, will be used to limit data to a subset of columns. by : object, optional If passed, then used to form histograms for separate groups. grid : bool, default True Whether to show axis grid lines. xlabelsize : int, default None If specified changes the x-axis label size. xrot : float, default None Rotation of x axis labels. For example, a value of 90 displays the x labels rotated 90 degrees clockwise. ylabelsize : int, default None If specified changes the y-axis label size. yrot : float, default None Rotation of y axis labels. For example, a value of 90 displays the y labels rotated 90 degrees clockwise. ax : Matplotlib axes object, default None The axes to plot the histogram on. sharex : bool, default True if ax is None else False In case subplots=True, share x axis and set some x axis labels to invisible; defaults to True if ax is None otherwise False if an ax is passed in. Note that passing in both an ax and sharex=True will alter all x axis labels for all subplots in a figure. sharey : bool, default False In case subplots=True, share y axis and set some y axis labels to invisible. figsize : tuple The size in inches of the figure to create. Uses the value in `matplotlib.rcParams` by default. layout : tuple, optional Tuple of (rows, columns) for the layout of the histograms. bins : integer or sequence, default 10 Number of histogram bins to be used. If an integer is given, bins + 1 bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified. **kwds All other plotting keyword arguments to be passed to :meth:`matplotlib.pyplot.hist`. Returns ------- matplotlib.AxesSubplot or numpy.ndarray of them See Also -------- matplotlib.pyplot.hist : Plot a histogram using matplotlib. Examples -------- .. plot:: :context: close-figs This example draws a histogram based on the length and width of some animals, displayed in three bins >>> df = pd.DataFrame({ ... 'length': [1.5, 0.5, 1.2, 0.9, 3], ... 'width': [0.7, 0.2, 0.15, 0.2, 1.1] ... }, index= ['pig', 'rabbit', 'duck', 'chicken', 'horse']) >>> hist = df.hist(bins=3) """ _raise_if_no_mpl() _converter._WARN = False if by is not None: axes = grouped_hist(data, column=column, by=by, ax=ax, grid=grid, figsize=figsize, sharex=sharex, sharey=sharey, layout=layout, bins=bins, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot, **kwds) return axes if column is not None: if not isinstance(column, (list, np.ndarray, ABCIndexClass)): column = [column] data = data[column] data = data._get_numeric_data() naxes = len(data.columns) fig, axes = _subplots(naxes=naxes, ax=ax, squeeze=False, sharex=sharex, sharey=sharey, figsize=figsize, layout=layout) _axes = _flatten(axes) for i, col in enumerate(com.try_sort(data.columns)): ax = _axes[i] ax.hist(data[col].dropna().values, bins=bins, **kwds) ax.set_title(col) ax.grid(grid) _set_ticks_props(axes, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot) fig.subplots_adjust(wspace=0.3, hspace=0.3) return axes
[ "def", "hist_frame", "(", "data", ",", "column", "=", "None", ",", "by", "=", "None", ",", "grid", "=", "True", ",", "xlabelsize", "=", "None", ",", "xrot", "=", "None", ",", "ylabelsize", "=", "None", ",", "yrot", "=", "None", ",", "ax", "=", "None", ",", "sharex", "=", "False", ",", "sharey", "=", "False", ",", "figsize", "=", "None", ",", "layout", "=", "None", ",", "bins", "=", "10", ",", "*", "*", "kwds", ")", ":", "_raise_if_no_mpl", "(", ")", "_converter", ".", "_WARN", "=", "False", "if", "by", "is", "not", "None", ":", "axes", "=", "grouped_hist", "(", "data", ",", "column", "=", "column", ",", "by", "=", "by", ",", "ax", "=", "ax", ",", "grid", "=", "grid", ",", "figsize", "=", "figsize", ",", "sharex", "=", "sharex", ",", "sharey", "=", "sharey", ",", "layout", "=", "layout", ",", "bins", "=", "bins", ",", "xlabelsize", "=", "xlabelsize", ",", "xrot", "=", "xrot", ",", "ylabelsize", "=", "ylabelsize", ",", "yrot", "=", "yrot", ",", "*", "*", "kwds", ")", "return", "axes", "if", "column", "is", "not", "None", ":", "if", "not", "isinstance", "(", "column", ",", "(", "list", ",", "np", ".", "ndarray", ",", "ABCIndexClass", ")", ")", ":", "column", "=", "[", "column", "]", "data", "=", "data", "[", "column", "]", "data", "=", "data", ".", "_get_numeric_data", "(", ")", "naxes", "=", "len", "(", "data", ".", "columns", ")", "fig", ",", "axes", "=", "_subplots", "(", "naxes", "=", "naxes", ",", "ax", "=", "ax", ",", "squeeze", "=", "False", ",", "sharex", "=", "sharex", ",", "sharey", "=", "sharey", ",", "figsize", "=", "figsize", ",", "layout", "=", "layout", ")", "_axes", "=", "_flatten", "(", "axes", ")", "for", "i", ",", "col", "in", "enumerate", "(", "com", ".", "try_sort", "(", "data", ".", "columns", ")", ")", ":", "ax", "=", "_axes", "[", "i", "]", "ax", ".", "hist", "(", "data", "[", "col", "]", ".", "dropna", "(", ")", ".", "values", ",", "bins", "=", "bins", ",", "*", "*", "kwds", ")", "ax", ".", "set_title", "(", "col", ")", "ax", ".", "grid", "(", "grid", ")", "_set_ticks_props", "(", "axes", ",", "xlabelsize", "=", "xlabelsize", ",", "xrot", "=", "xrot", ",", "ylabelsize", "=", "ylabelsize", ",", "yrot", "=", "yrot", ")", "fig", ".", "subplots_adjust", "(", "wspace", "=", "0.3", ",", "hspace", "=", "0.3", ")", "return", "axes" ]
Make a histogram of the DataFrame's. A `histogram`_ is a representation of the distribution of data. This function calls :meth:`matplotlib.pyplot.hist`, on each series in the DataFrame, resulting in one histogram per column. .. _histogram: https://en.wikipedia.org/wiki/Histogram Parameters ---------- data : DataFrame The pandas object holding the data. column : string or sequence If passed, will be used to limit data to a subset of columns. by : object, optional If passed, then used to form histograms for separate groups. grid : bool, default True Whether to show axis grid lines. xlabelsize : int, default None If specified changes the x-axis label size. xrot : float, default None Rotation of x axis labels. For example, a value of 90 displays the x labels rotated 90 degrees clockwise. ylabelsize : int, default None If specified changes the y-axis label size. yrot : float, default None Rotation of y axis labels. For example, a value of 90 displays the y labels rotated 90 degrees clockwise. ax : Matplotlib axes object, default None The axes to plot the histogram on. sharex : bool, default True if ax is None else False In case subplots=True, share x axis and set some x axis labels to invisible; defaults to True if ax is None otherwise False if an ax is passed in. Note that passing in both an ax and sharex=True will alter all x axis labels for all subplots in a figure. sharey : bool, default False In case subplots=True, share y axis and set some y axis labels to invisible. figsize : tuple The size in inches of the figure to create. Uses the value in `matplotlib.rcParams` by default. layout : tuple, optional Tuple of (rows, columns) for the layout of the histograms. bins : integer or sequence, default 10 Number of histogram bins to be used. If an integer is given, bins + 1 bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified. **kwds All other plotting keyword arguments to be passed to :meth:`matplotlib.pyplot.hist`. Returns ------- matplotlib.AxesSubplot or numpy.ndarray of them See Also -------- matplotlib.pyplot.hist : Plot a histogram using matplotlib. Examples -------- .. plot:: :context: close-figs This example draws a histogram based on the length and width of some animals, displayed in three bins >>> df = pd.DataFrame({ ... 'length': [1.5, 0.5, 1.2, 0.9, 3], ... 'width': [0.7, 0.2, 0.15, 0.2, 1.1] ... }, index= ['pig', 'rabbit', 'duck', 'chicken', 'horse']) >>> hist = df.hist(bins=3)
[ "Make", "a", "histogram", "of", "the", "DataFrame", "s", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L2331-L2443
train
This function creates a histogram of the data in a DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9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qBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b111110 + 0o61) + chr(0b110001) + '\x31' + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b110011) + chr(2707 - 2653), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101011 + 0o4) + chr(0b100110 + 0o13) + chr(1745 - 1691), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(0b11000 + 0o32) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + chr(0b111 + 0o53) + chr(0b110011) + chr(0b110011 + 0o2), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\x6f' + chr(0b101110 + 0o6) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010101 + 0o32) + chr(0b111 + 0o53) + chr(0b100 + 0o60) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(0b110110) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\063' + chr(428 - 373), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6997 - 6886) + chr(0b110001) + chr(1671 - 1621) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(8233 - 8122) + chr(51) + chr(1673 - 1624) + chr(0b111 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + chr(0b110001) + '\066' + chr(2021 - 1972), 20875 - 20867), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(1327 - 1216) + chr(0b10 + 0o61) + chr(75 - 27) + chr(0b10111 + 0o31), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(52) + chr(0b100 + 0o60), 36149 - 36141), ehT0Px3KOsy9(chr(1022 - 974) + chr(0b11011 + 0o124) + chr(0b10010 + 0o40) + chr(2536 - 2481) + chr(0b101111 + 0o5), 0b1000), ehT0Px3KOsy9('\x30' + chr(2613 - 2502) + '\063' + '\062' + chr(0b100010 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000111 + 0o50) + chr(0b1000 + 0o57) + chr(54), 20996 - 20988), ehT0Px3KOsy9('\x30' + chr(0b1001000 + 0o47) + chr(0b10110 + 0o34) + '\061' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(54) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(103 - 54) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(1944 - 1833) + '\063' + chr(0b111 + 0o60) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(188 - 140) + '\157' + chr(0b110010) + chr(51) + chr(0b110000 + 0o3), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + '\067' + chr(54), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(0b11001 + 0o31), 8), ehT0Px3KOsy9(chr(973 - 925) + '\x6f' + '\061' + chr(54) + chr(332 - 278), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100101 + 0o16) + chr(0b110000 + 0o7) + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x35' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(52) + chr(1304 - 1249), 3189 - 3181), ehT0Px3KOsy9(chr(1203 - 1155) + chr(0b101101 + 0o102) + '\x33' + chr(50) + chr(1272 - 1222), 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1100011 + 0o14) + chr(896 - 845) + '\067' + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\066' + chr(1003 - 953), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\x6f' + chr(50) + chr(52) + chr(0b10111 + 0o32), 39426 - 39418), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101100 + 0o3) + chr(0b100010 + 0o21) + '\x30' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + chr(0b110011) + '\064' + chr(0b100111 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + '\x32' + chr(1300 - 1247), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(498 - 447) + chr(54) + chr(0b0 + 0o64), 0b1000), ehT0Px3KOsy9('\x30' + chr(7627 - 7516) + '\x31' + chr(55) + '\064', 65187 - 65179), ehT0Px3KOsy9(chr(48) + chr(6744 - 6633) + chr(0b100110 + 0o15) + '\x36' + '\x37', 0b1000), ehT0Px3KOsy9(chr(360 - 312) + chr(0b1101111) + chr(2155 - 2106) + chr(671 - 622) + '\x36', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1472 - 1419) + chr(1845 - 1797), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'a'), chr(0b1100100) + chr(0b101000 + 0o75) + chr(0b1100011) + '\157' + '\144' + chr(101))(chr(117) + '\x74' + '\x66' + chr(1310 - 1265) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def vPaS7UG5APlB(ULnjp6D6efFH, Pl0JgJDv0QqN=None, KPtq2czfwPS6=None, HQlygFZjk_Ts=ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o21), 0b1000), O6IqtluwDsBM=None, EkdxULuB9H6Z=None, mpU8c8_lbVWZ=None, bE_fxV0mOBtM=None, UFCqCPYQEkxy=None, EXJVTwDkeUM0=ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110000), 29063 - 29055), MfpZhnWx798V=ehT0Px3KOsy9(chr(48) + chr(3528 - 3417) + chr(1174 - 1126), 8), EOCd1WZj2r_S=None, HDH7OEwZuDah=None, KQ4BDFoY4RVo=ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(0b11000 + 0o32), 8), **ClrkdavlbKME): J0iiixqYX_fZ() Kt4weVQLYz5A.mn5QZuyPrYP0 = ehT0Px3KOsy9('\060' + chr(0b111111 + 0o60) + chr(2065 - 2017), 8) if KPtq2czfwPS6 is not None: gJ3Tbhvvj8Ru = muROo5u_drt2(ULnjp6D6efFH, column=Pl0JgJDv0QqN, by=KPtq2czfwPS6, ax=UFCqCPYQEkxy, grid=HQlygFZjk_Ts, figsize=EOCd1WZj2r_S, sharex=EXJVTwDkeUM0, sharey=MfpZhnWx798V, layout=HDH7OEwZuDah, bins=KQ4BDFoY4RVo, xlabelsize=O6IqtluwDsBM, xrot=EkdxULuB9H6Z, ylabelsize=mpU8c8_lbVWZ, yrot=bE_fxV0mOBtM, **ClrkdavlbKME) return gJ3Tbhvvj8Ru if Pl0JgJDv0QqN is not None: if not PlSM16l2KDPD(Pl0JgJDv0QqN, (YyaZ4tpXu4lf, xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'!\xfao\xe6\xefG\xda'), chr(100) + chr(0b1100101) + '\x63' + '\157' + chr(100) + '\145')(chr(0b1110101) + '\164' + chr(0b111100 + 0o52) + chr(0b101101) + chr(0b100000 + 0o30))), zLJfq2_IbJjZ)): Pl0JgJDv0QqN = [Pl0JgJDv0QqN] ULnjp6D6efFH = ULnjp6D6efFH[Pl0JgJDv0QqN] ULnjp6D6efFH = ULnjp6D6efFH._get_numeric_data() YLWhYbaD7hv4 = c2A0yzQpDQB3(ULnjp6D6efFH.qKlXBtn3PKy4) (IPypcZ53eNRW, gJ3Tbhvvj8Ru) = NJ7UFoibKFcf(naxes=YLWhYbaD7hv4, ax=UFCqCPYQEkxy, squeeze=ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110000), 8), sharex=EXJVTwDkeUM0, sharey=MfpZhnWx798V, figsize=EOCd1WZj2r_S, layout=HDH7OEwZuDah) JQRFi7acKdjR = rH_ZFwwirodI(gJ3Tbhvvj8Ru) for (WVxHKyX45z_L, Qa2uSJqQPT3w) in YlkZvXL8qwsX(xafqLlk3kkUe(CDQ27PYjPxZQ, xafqLlk3kkUe(SXOLrMavuUCe(b';\xecw\xcb\xeeI\xd1\xc3'), chr(100) + chr(0b1000100 + 0o41) + chr(99) + '\x6f' + chr(0b1100100) + '\145')(chr(0b1000111 + 0o56) + '\164' + chr(3403 - 3301) + '\055' + chr(2331 - 2275)))(xafqLlk3kkUe(ULnjp6D6efFH, xafqLlk3kkUe(SXOLrMavuUCe(b'>\xd5b\xcc\xdfR\xcd\x84\xcf\x1f\xb1E'), chr(0b10001 + 0o123) + chr(0b1100101) + chr(99) + '\x6f' + chr(3029 - 2929) + chr(101))(chr(0b1110101) + chr(10086 - 9970) + chr(0b1000011 + 0o43) + '\x2d' + chr(0b111000 + 0o0))))): UFCqCPYQEkxy = JQRFi7acKdjR[WVxHKyX45z_L] xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b"'\xf7}\xe0"), chr(100) + chr(0b1100100 + 0o1) + chr(9080 - 8981) + '\157' + '\144' + chr(0b1100101))('\x75' + chr(116) + chr(102) + '\x2d' + chr(56)))(xafqLlk3kkUe(ULnjp6D6efFH[Qa2uSJqQPT3w].dropna(), xafqLlk3kkUe(SXOLrMavuUCe(b'\x1c\xce`\xd7\xd3S\x96\x83\xd7e\xac\x13'), chr(0b1100100) + '\145' + chr(2547 - 2448) + '\x6f' + '\x64' + chr(0b1100101))('\x75' + chr(3462 - 3346) + '\146' + chr(1064 - 1019) + chr(1194 - 1138))), bins=KQ4BDFoY4RVo, **ClrkdavlbKME) xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'<\xfbz\xcb\xe9O\xd7\xdb\xfa'), chr(0b111110 + 0o46) + chr(0b1100101) + '\x63' + chr(0b11110 + 0o121) + chr(100) + chr(101))(chr(117) + chr(0b1100111 + 0o15) + chr(0b1100110) + chr(414 - 369) + '\070'))(Qa2uSJqQPT3w) xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'(\xecg\xf0'), chr(7285 - 7185) + chr(101) + chr(3711 - 3612) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(102) + '\x2d' + chr(56)))(HQlygFZjk_Ts) Y8oTx2_Zkajn(gJ3Tbhvvj8Ru, xlabelsize=O6IqtluwDsBM, xrot=EkdxULuB9H6Z, ylabelsize=mpU8c8_lbVWZ, yrot=bE_fxV0mOBtM) xafqLlk3kkUe(IPypcZ53eNRW, xafqLlk3kkUe(SXOLrMavuUCe(b'<\xebl\xe4\xf1I\xd7\xc4\xc05\xac\x1b\xb5a\xd0'), chr(0b1100100) + chr(0b1000101 + 0o40) + chr(99) + '\x6f' + chr(0b1100100) + chr(9381 - 9280))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b111000)))(wspace=0.3, hspace=0.3) return gJ3Tbhvvj8Ru
pandas-dev/pandas
pandas/plotting/_core.py
hist_series
def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None, xrot=None, ylabelsize=None, yrot=None, figsize=None, bins=10, **kwds): """ Draw histogram of the input series using matplotlib. Parameters ---------- by : object, optional If passed, then used to form histograms for separate groups ax : matplotlib axis object If not passed, uses gca() grid : bool, default True Whether to show axis grid lines xlabelsize : int, default None If specified changes the x-axis label size xrot : float, default None rotation of x axis labels ylabelsize : int, default None If specified changes the y-axis label size yrot : float, default None rotation of y axis labels figsize : tuple, default None figure size in inches by default bins : integer or sequence, default 10 Number of histogram bins to be used. If an integer is given, bins + 1 bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified. bins : integer, default 10 Number of histogram bins to be used `**kwds` : keywords To be passed to the actual plotting function See Also -------- matplotlib.axes.Axes.hist : Plot a histogram using matplotlib. """ import matplotlib.pyplot as plt if by is None: if kwds.get('layout', None) is not None: raise ValueError("The 'layout' keyword is not supported when " "'by' is None") # hack until the plotting interface is a bit more unified fig = kwds.pop('figure', plt.gcf() if plt.get_fignums() else plt.figure(figsize=figsize)) if (figsize is not None and tuple(figsize) != tuple(fig.get_size_inches())): fig.set_size_inches(*figsize, forward=True) if ax is None: ax = fig.gca() elif ax.get_figure() != fig: raise AssertionError('passed axis not bound to passed figure') values = self.dropna().values ax.hist(values, bins=bins, **kwds) ax.grid(grid) axes = np.array([ax]) _set_ticks_props(axes, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot) else: if 'figure' in kwds: raise ValueError("Cannot pass 'figure' when using the " "'by' argument, since a new 'Figure' instance " "will be created") axes = grouped_hist(self, by=by, ax=ax, grid=grid, figsize=figsize, bins=bins, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot, **kwds) if hasattr(axes, 'ndim'): if axes.ndim == 1 and len(axes) == 1: return axes[0] return axes
python
def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None, xrot=None, ylabelsize=None, yrot=None, figsize=None, bins=10, **kwds): """ Draw histogram of the input series using matplotlib. Parameters ---------- by : object, optional If passed, then used to form histograms for separate groups ax : matplotlib axis object If not passed, uses gca() grid : bool, default True Whether to show axis grid lines xlabelsize : int, default None If specified changes the x-axis label size xrot : float, default None rotation of x axis labels ylabelsize : int, default None If specified changes the y-axis label size yrot : float, default None rotation of y axis labels figsize : tuple, default None figure size in inches by default bins : integer or sequence, default 10 Number of histogram bins to be used. If an integer is given, bins + 1 bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified. bins : integer, default 10 Number of histogram bins to be used `**kwds` : keywords To be passed to the actual plotting function See Also -------- matplotlib.axes.Axes.hist : Plot a histogram using matplotlib. """ import matplotlib.pyplot as plt if by is None: if kwds.get('layout', None) is not None: raise ValueError("The 'layout' keyword is not supported when " "'by' is None") # hack until the plotting interface is a bit more unified fig = kwds.pop('figure', plt.gcf() if plt.get_fignums() else plt.figure(figsize=figsize)) if (figsize is not None and tuple(figsize) != tuple(fig.get_size_inches())): fig.set_size_inches(*figsize, forward=True) if ax is None: ax = fig.gca() elif ax.get_figure() != fig: raise AssertionError('passed axis not bound to passed figure') values = self.dropna().values ax.hist(values, bins=bins, **kwds) ax.grid(grid) axes = np.array([ax]) _set_ticks_props(axes, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot) else: if 'figure' in kwds: raise ValueError("Cannot pass 'figure' when using the " "'by' argument, since a new 'Figure' instance " "will be created") axes = grouped_hist(self, by=by, ax=ax, grid=grid, figsize=figsize, bins=bins, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot, **kwds) if hasattr(axes, 'ndim'): if axes.ndim == 1 and len(axes) == 1: return axes[0] return axes
[ "def", "hist_series", "(", "self", ",", "by", "=", "None", ",", "ax", "=", "None", ",", "grid", "=", "True", ",", "xlabelsize", "=", "None", ",", "xrot", "=", "None", ",", "ylabelsize", "=", "None", ",", "yrot", "=", "None", ",", "figsize", "=", "None", ",", "bins", "=", "10", ",", "*", "*", "kwds", ")", ":", "import", "matplotlib", ".", "pyplot", "as", "plt", "if", "by", "is", "None", ":", "if", "kwds", ".", "get", "(", "'layout'", ",", "None", ")", "is", "not", "None", ":", "raise", "ValueError", "(", "\"The 'layout' keyword is not supported when \"", "\"'by' is None\"", ")", "# hack until the plotting interface is a bit more unified", "fig", "=", "kwds", ".", "pop", "(", "'figure'", ",", "plt", ".", "gcf", "(", ")", "if", "plt", ".", "get_fignums", "(", ")", "else", "plt", ".", "figure", "(", "figsize", "=", "figsize", ")", ")", "if", "(", "figsize", "is", "not", "None", "and", "tuple", "(", "figsize", ")", "!=", "tuple", "(", "fig", ".", "get_size_inches", "(", ")", ")", ")", ":", "fig", ".", "set_size_inches", "(", "*", "figsize", ",", "forward", "=", "True", ")", "if", "ax", "is", "None", ":", "ax", "=", "fig", ".", "gca", "(", ")", "elif", "ax", ".", "get_figure", "(", ")", "!=", "fig", ":", "raise", "AssertionError", "(", "'passed axis not bound to passed figure'", ")", "values", "=", "self", ".", "dropna", "(", ")", ".", "values", "ax", ".", "hist", "(", "values", ",", "bins", "=", "bins", ",", "*", "*", "kwds", ")", "ax", ".", "grid", "(", "grid", ")", "axes", "=", "np", ".", "array", "(", "[", "ax", "]", ")", "_set_ticks_props", "(", "axes", ",", "xlabelsize", "=", "xlabelsize", ",", "xrot", "=", "xrot", ",", "ylabelsize", "=", "ylabelsize", ",", "yrot", "=", "yrot", ")", "else", ":", "if", "'figure'", "in", "kwds", ":", "raise", "ValueError", "(", "\"Cannot pass 'figure' when using the \"", "\"'by' argument, since a new 'Figure' instance \"", "\"will be created\"", ")", "axes", "=", "grouped_hist", "(", "self", ",", "by", "=", "by", ",", "ax", "=", "ax", ",", "grid", "=", "grid", ",", "figsize", "=", "figsize", ",", "bins", "=", "bins", ",", "xlabelsize", "=", "xlabelsize", ",", "xrot", "=", "xrot", ",", "ylabelsize", "=", "ylabelsize", ",", "yrot", "=", "yrot", ",", "*", "*", "kwds", ")", "if", "hasattr", "(", "axes", ",", "'ndim'", ")", ":", "if", "axes", ".", "ndim", "==", "1", "and", "len", "(", "axes", ")", "==", "1", ":", "return", "axes", "[", "0", "]", "return", "axes" ]
Draw histogram of the input series using matplotlib. Parameters ---------- by : object, optional If passed, then used to form histograms for separate groups ax : matplotlib axis object If not passed, uses gca() grid : bool, default True Whether to show axis grid lines xlabelsize : int, default None If specified changes the x-axis label size xrot : float, default None rotation of x axis labels ylabelsize : int, default None If specified changes the y-axis label size yrot : float, default None rotation of y axis labels figsize : tuple, default None figure size in inches by default bins : integer or sequence, default 10 Number of histogram bins to be used. If an integer is given, bins + 1 bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified. bins : integer, default 10 Number of histogram bins to be used `**kwds` : keywords To be passed to the actual plotting function See Also -------- matplotlib.axes.Axes.hist : Plot a histogram using matplotlib.
[ "Draw", "histogram", "of", "the", "input", "series", "using", "matplotlib", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L2446-L2521
train
Plots a histogram of the input series using matplotlib.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIA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2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1512 - 1464) + '\157' + chr(0b100100 + 0o23) + chr(0b101001 + 0o7), 3478 - 3470), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(1016 - 965) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x36' + chr(1093 - 1043), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + '\060' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(50) + '\x32', 9092 - 9084), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(55) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(228 - 179) + chr(2409 - 2359) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\x34' + chr(1304 - 1254), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(2542 - 2431) + '\x31' + '\061' + '\064', 52188 - 52180), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + chr(0b11 + 0o56) + chr(204 - 156) + chr(236 - 181), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b111 + 0o53) + chr(51) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100111 + 0o14) + chr(0b11110 + 0o26) + chr(2499 - 2445), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9081 - 8970) + chr(1559 - 1508) + chr(516 - 464) + chr(54), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011110 + 0o21) + chr(894 - 844) + '\x35' + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(1275 - 1222) + chr(589 - 540), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + '\061' + chr(940 - 889) + '\x32', 37453 - 37445), ehT0Px3KOsy9(chr(1254 - 1206) + chr(0b101011 + 0o104) + chr(50) + chr(1901 - 1849) + chr(49), 0b1000), ehT0Px3KOsy9(chr(1464 - 1416) + chr(111) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101001 + 0o6) + '\x36' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110110) + chr(54), 0b1000), ehT0Px3KOsy9(chr(323 - 275) + chr(0b1101111) + '\062' + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(6264 - 6153) + chr(1561 - 1507), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100001 + 0o116) + '\061' + chr(53), 35068 - 35060), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + chr(558 - 507) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1726 - 1678) + chr(9248 - 9137) + chr(0b1 + 0o62) + chr(0b110001) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1001001 + 0o46) + '\062' + '\062' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(11809 - 11698) + chr(49), 0b1000), ehT0Px3KOsy9(chr(1155 - 1107) + chr(0b1101111) + chr(0b11010 + 0o30) + chr(0b110101) + '\x31', 59651 - 59643), ehT0Px3KOsy9(chr(0b110000) + chr(780 - 669) + chr(2436 - 2386) + chr(1171 - 1121) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1272 - 1224) + chr(10286 - 10175) + '\x31' + chr(834 - 782) + chr(460 - 405), 0o10), ehT0Px3KOsy9(chr(484 - 436) + chr(0b111010 + 0o65) + chr(0b1000 + 0o51) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(5978 - 5867) + chr(0b110101) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(2134 - 2084) + '\x35', 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b1 + 0o61) + '\060' + chr(0b10111 + 0o37), 65490 - 65482), ehT0Px3KOsy9(chr(716 - 668) + '\x6f' + '\x37' + chr(53), 18642 - 18634), ehT0Px3KOsy9('\060' + chr(111) + chr(53) + chr(0b110011), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + '\061' + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(0b111001 + 0o66) + '\x32' + '\x33' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b110001) + chr(0b110110), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(8343 - 8232) + chr(2133 - 2080) + chr(1162 - 1114), 20723 - 20715)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x16'), '\x64' + '\x65' + chr(99) + chr(6178 - 6067) + chr(7627 - 7527) + chr(0b1010110 + 0o17))(chr(0b10000 + 0o145) + chr(0b1000000 + 0o64) + '\x66' + chr(0b1011 + 0o42) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def fdjiVoHz9XcC(oVre8I6UXc3b, KPtq2czfwPS6=None, UFCqCPYQEkxy=None, HQlygFZjk_Ts=ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31', 8), O6IqtluwDsBM=None, EkdxULuB9H6Z=None, mpU8c8_lbVWZ=None, bE_fxV0mOBtM=None, EOCd1WZj2r_S=None, KQ4BDFoY4RVo=ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(50), ord("\x08")), **ClrkdavlbKME): (eRubm8FH879n,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'U>F\xb3\xfep\xca:\x0b.i\xef\x9f\x96\xc2\x86.'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\157' + '\144' + chr(101))(chr(0b1110101) + '\164' + chr(196 - 94) + chr(0b101101) + chr(0b110100 + 0o4)), xafqLlk3kkUe(SXOLrMavuUCe(b'H&B\xaf\xfdk'), chr(100) + chr(0b1011011 + 0o12) + chr(0b11010 + 0o111) + chr(0b10110 + 0o131) + '\x64' + '\145')(chr(10160 - 10043) + '\x74' + chr(102) + chr(1981 - 1936) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'H&B\xaf\xfdk'), chr(100) + chr(0b1101 + 0o130) + '\143' + chr(7518 - 7407) + chr(100) + chr(101))(chr(0b10101 + 0o140) + chr(0b1110100) + chr(102) + chr(45) + chr(0b110011 + 0o5))),) if KPtq2czfwPS6 is None: if xafqLlk3kkUe(ClrkdavlbKME, xafqLlk3kkUe(SXOLrMavuUCe(b'_:F'), chr(0b111110 + 0o46) + chr(101) + '\143' + '\x6f' + '\x64' + '\x65')(chr(0b1100011 + 0o22) + chr(10702 - 10586) + chr(0b1100110) + chr(45) + chr(477 - 421)))(xafqLlk3kkUe(SXOLrMavuUCe(b'T>K\xac\xe7k'), '\144' + '\145' + chr(2603 - 2504) + chr(0b1101111) + '\x64' + chr(0b1100011 + 0o2))(chr(0b1110101) + chr(116) + chr(102) + '\x2d' + chr(56)), None) is not None: raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'l7W\xe3\xb5s\xdf/\r93\xb8\xc6\x8d\xcb\x90-\xcepT\x16|u-p\xa4\xe3!\xda\xe3\x17xDg\xf2XO\xea\xee\xa6]1\x12\xe4\xf0f\x99v\x0b?g\xd1\x89\x88\xcb'), chr(1826 - 1726) + chr(0b110100 + 0o61) + chr(99) + chr(7772 - 7661) + chr(0b1100100) + chr(101))(chr(7828 - 7711) + '\164' + chr(0b1100110) + chr(0b101101) + '\070')) IPypcZ53eNRW = ClrkdavlbKME.pop(xafqLlk3kkUe(SXOLrMavuUCe(b'^6U\xb6\xe0z'), chr(2986 - 2886) + chr(101) + chr(0b11010 + 0o111) + chr(0b1101111) + chr(0b1010100 + 0o20) + '\145')(chr(6423 - 6306) + chr(116) + chr(102) + chr(0b100011 + 0o12) + chr(0b100100 + 0o24)), eRubm8FH879n.gcf() if eRubm8FH879n.get_fignums() else eRubm8FH879n.figure(figsize=EOCd1WZj2r_S)) if EOCd1WZj2r_S is not None and KNyTy8rYcwji(EOCd1WZj2r_S) != KNyTy8rYcwji(xafqLlk3kkUe(IPypcZ53eNRW, xafqLlk3kkUe(SXOLrMavuUCe(b'_:F\x9c\xe1v\xc43=%)\xfc\x8e\x83\xdd'), '\x64' + chr(101) + '\x63' + chr(0b100100 + 0o113) + '\144' + chr(0b111000 + 0o55))('\165' + chr(116) + '\146' + '\x2d' + '\x38'))()): xafqLlk3kkUe(IPypcZ53eNRW, xafqLlk3kkUe(SXOLrMavuUCe(b'K:F\x9c\xe1v\xc43=%)\xfc\x8e\x83\xdd'), chr(0b1000101 + 0o37) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b101 + 0o137) + '\145')(chr(536 - 419) + chr(0b1110100) + '\146' + '\055' + chr(0b11111 + 0o31)))(*EOCd1WZj2r_S, forward=ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b11110 + 0o121) + chr(0b11101 + 0o24), 8)) if UFCqCPYQEkxy is None: UFCqCPYQEkxy = IPypcZ53eNRW.gca() elif xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'_:F\x9c\xf4v\xd9#\x10)'), '\144' + chr(3979 - 3878) + chr(0b1011001 + 0o12) + '\157' + chr(0b1001010 + 0o32) + chr(4952 - 4851))('\x75' + chr(0b1110100) + chr(2244 - 2142) + '\x2d' + chr(0b100 + 0o64)))() != IPypcZ53eNRW: raise vcEHXBQXuDuh(xafqLlk3kkUe(SXOLrMavuUCe(b'H>A\xb0\xf7{\x9e7\x1a%4\xbf\x88\x89\xda\xc98\xcew^R5rb>\xbb\xf6r\xda\xf3\x03(M|\xe1HY\xaf'), '\144' + chr(8733 - 8632) + '\143' + chr(111) + chr(0b1000111 + 0o35) + '\x65')(chr(5401 - 5284) + '\164' + '\146' + chr(0b101101) + chr(56))) SPnCNu54H1db = oVre8I6UXc3b.dropna().SPnCNu54H1db xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'P6A\xb7'), chr(0b1100100) + chr(1182 - 1081) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(7143 - 7042))(chr(0b1000110 + 0o57) + chr(5887 - 5771) + chr(102) + chr(45) + chr(56)))(SPnCNu54H1db, bins=KQ4BDFoY4RVo, **ClrkdavlbKME) xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'_-[\xa7'), chr(100) + '\145' + chr(2708 - 2609) + '\x6f' + chr(3697 - 3597) + chr(0b100111 + 0o76))('\x75' + '\164' + chr(0b1011111 + 0o7) + '\x2d' + '\070'))(HQlygFZjk_Ts) gJ3Tbhvvj8Ru = WqUC3KWvYVup.array([UFCqCPYQEkxy]) Y8oTx2_Zkajn(gJ3Tbhvvj8Ru, xlabelsize=O6IqtluwDsBM, xrot=EkdxULuB9H6Z, ylabelsize=mpU8c8_lbVWZ, yrot=bE_fxV0mOBtM) else: if xafqLlk3kkUe(SXOLrMavuUCe(b'^6U\xb6\xe0z'), '\144' + chr(0b1110 + 0o127) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b11 + 0o142))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b111000)) in ClrkdavlbKME: raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'{>\\\xad\xfdk\x9e&\x03?4\xbf\xc1\x80\xc7\x8e/\xd3g\x17\x16bnhp\xeb\xe2r\xc0\xf8\x00(_}\xe3\x1d\x0c\xa8\xe0\xe9\x18>@\xa4\xe7r\xdb8\x16`g\xec\x8f\x88\xcd\x8cz\xc0"^Sb&*X\xa2\xf0t\xdb\xf3@(B{\xf5IJ\xa4\xfa\xab\x18([\xaf\xfe?\xdc3B/5\xfa\x87\x92\xcb\x8d'), chr(100) + chr(0b1100101) + chr(0b1010101 + 0o16) + chr(111) + chr(0b10011 + 0o121) + chr(4789 - 4688))('\165' + chr(2307 - 2191) + chr(132 - 30) + '\x2d' + chr(225 - 169))) gJ3Tbhvvj8Ru = muROo5u_drt2(oVre8I6UXc3b, by=KPtq2czfwPS6, ax=UFCqCPYQEkxy, grid=HQlygFZjk_Ts, figsize=EOCd1WZj2r_S, bins=KQ4BDFoY4RVo, xlabelsize=O6IqtluwDsBM, xrot=EkdxULuB9H6Z, ylabelsize=mpU8c8_lbVWZ, yrot=bE_fxV0mOBtM, **ClrkdavlbKME) if lot1PSoAwYhj(gJ3Tbhvvj8Ru, xafqLlk3kkUe(SXOLrMavuUCe(b'V;[\xae'), chr(0b11011 + 0o111) + chr(101) + chr(99) + '\157' + chr(7941 - 7841) + '\x65')('\x75' + '\x74' + '\146' + chr(45) + chr(0b111000))): if xafqLlk3kkUe(gJ3Tbhvvj8Ru, xafqLlk3kkUe(SXOLrMavuUCe(b'_0_\xb3\xda]\xd7\x02\x11*\r\xcb'), chr(100) + chr(0b1100101) + chr(2579 - 2480) + chr(6514 - 6403) + '\x64' + chr(0b1111 + 0o126))(chr(0b1110101) + '\164' + '\x66' + '\x2d' + '\070')) == ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001), 8) and c2A0yzQpDQB3(gJ3Tbhvvj8Ru) == ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + chr(0b110001), 8): return gJ3Tbhvvj8Ru[ehT0Px3KOsy9('\x30' + chr(0b110101 + 0o72) + '\060', ord("\x08"))] return gJ3Tbhvvj8Ru
pandas-dev/pandas
pandas/plotting/_core.py
grouped_hist
def grouped_hist(data, column=None, by=None, ax=None, bins=50, figsize=None, layout=None, sharex=False, sharey=False, rot=90, grid=True, xlabelsize=None, xrot=None, ylabelsize=None, yrot=None, **kwargs): """ Grouped histogram Parameters ---------- data : Series/DataFrame column : object, optional by : object, optional ax : axes, optional bins : int, default 50 figsize : tuple, optional layout : optional sharex : bool, default False sharey : bool, default False rot : int, default 90 grid : bool, default True kwargs : dict, keyword arguments passed to matplotlib.Axes.hist Returns ------- collection of Matplotlib Axes """ _raise_if_no_mpl() _converter._WARN = False def plot_group(group, ax): ax.hist(group.dropna().values, bins=bins, **kwargs) xrot = xrot or rot fig, axes = _grouped_plot(plot_group, data, column=column, by=by, sharex=sharex, sharey=sharey, ax=ax, figsize=figsize, layout=layout, rot=rot) _set_ticks_props(axes, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot) fig.subplots_adjust(bottom=0.15, top=0.9, left=0.1, right=0.9, hspace=0.5, wspace=0.3) return axes
python
def grouped_hist(data, column=None, by=None, ax=None, bins=50, figsize=None, layout=None, sharex=False, sharey=False, rot=90, grid=True, xlabelsize=None, xrot=None, ylabelsize=None, yrot=None, **kwargs): """ Grouped histogram Parameters ---------- data : Series/DataFrame column : object, optional by : object, optional ax : axes, optional bins : int, default 50 figsize : tuple, optional layout : optional sharex : bool, default False sharey : bool, default False rot : int, default 90 grid : bool, default True kwargs : dict, keyword arguments passed to matplotlib.Axes.hist Returns ------- collection of Matplotlib Axes """ _raise_if_no_mpl() _converter._WARN = False def plot_group(group, ax): ax.hist(group.dropna().values, bins=bins, **kwargs) xrot = xrot or rot fig, axes = _grouped_plot(plot_group, data, column=column, by=by, sharex=sharex, sharey=sharey, ax=ax, figsize=figsize, layout=layout, rot=rot) _set_ticks_props(axes, xlabelsize=xlabelsize, xrot=xrot, ylabelsize=ylabelsize, yrot=yrot) fig.subplots_adjust(bottom=0.15, top=0.9, left=0.1, right=0.9, hspace=0.5, wspace=0.3) return axes
[ "def", "grouped_hist", "(", "data", ",", "column", "=", "None", ",", "by", "=", "None", ",", "ax", "=", "None", ",", "bins", "=", "50", ",", "figsize", "=", "None", ",", "layout", "=", "None", ",", "sharex", "=", "False", ",", "sharey", "=", "False", ",", "rot", "=", "90", ",", "grid", "=", "True", ",", "xlabelsize", "=", "None", ",", "xrot", "=", "None", ",", "ylabelsize", "=", "None", ",", "yrot", "=", "None", ",", "*", "*", "kwargs", ")", ":", "_raise_if_no_mpl", "(", ")", "_converter", ".", "_WARN", "=", "False", "def", "plot_group", "(", "group", ",", "ax", ")", ":", "ax", ".", "hist", "(", "group", ".", "dropna", "(", ")", ".", "values", ",", "bins", "=", "bins", ",", "*", "*", "kwargs", ")", "xrot", "=", "xrot", "or", "rot", "fig", ",", "axes", "=", "_grouped_plot", "(", "plot_group", ",", "data", ",", "column", "=", "column", ",", "by", "=", "by", ",", "sharex", "=", "sharex", ",", "sharey", "=", "sharey", ",", "ax", "=", "ax", ",", "figsize", "=", "figsize", ",", "layout", "=", "layout", ",", "rot", "=", "rot", ")", "_set_ticks_props", "(", "axes", ",", "xlabelsize", "=", "xlabelsize", ",", "xrot", "=", "xrot", ",", "ylabelsize", "=", "ylabelsize", ",", "yrot", "=", "yrot", ")", "fig", ".", "subplots_adjust", "(", "bottom", "=", "0.15", ",", "top", "=", "0.9", ",", "left", "=", "0.1", ",", "right", "=", "0.9", ",", "hspace", "=", "0.5", ",", "wspace", "=", "0.3", ")", "return", "axes" ]
Grouped histogram Parameters ---------- data : Series/DataFrame column : object, optional by : object, optional ax : axes, optional bins : int, default 50 figsize : tuple, optional layout : optional sharex : bool, default False sharey : bool, default False rot : int, default 90 grid : bool, default True kwargs : dict, keyword arguments passed to matplotlib.Axes.hist Returns ------- collection of Matplotlib Axes
[ "Grouped", "histogram" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L2524-L2567
train
Plots a grouped histogram of the data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,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qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110000) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010 + 0o145) + chr(49) + chr(0b110010) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(1041 - 987) + chr(0b110000), 58232 - 58224), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(2024 - 1975) + chr(0b11 + 0o62) + chr(2645 - 2593), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(52) + '\065', 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + chr(0b11000 + 0o33) + chr(0b110111) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(1925 - 1877) + chr(0b10011 + 0o134) + chr(1554 - 1503) + chr(0b1 + 0o63) + chr(1807 - 1754), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10001 + 0o44) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11111 + 0o24) + chr(0b100 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101010 + 0o5) + chr(0b110011) + chr(0b11101 + 0o26) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(755 - 705) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(8312 - 8201) + chr(1688 - 1637) + chr(0b110100) + chr(1323 - 1271), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11569 - 11458) + chr(1706 - 1656) + '\067' + '\063', 40865 - 40857), ehT0Px3KOsy9(chr(823 - 775) + chr(5688 - 5577) + chr(50) + '\x33' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\061' + chr(688 - 634), 53813 - 53805), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110111) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11110 + 0o121) + chr(0b1011 + 0o54) + '\066', 21161 - 21153), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2150 - 2101) + chr(0b110110 + 0o1) + chr(0b1110 + 0o45), 33073 - 33065), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(48) + chr(822 - 774), ord("\x08")), ehT0Px3KOsy9(chr(1860 - 1812) + chr(111) + '\062' + chr(50) + chr(1847 - 1799), 26862 - 26854), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\157' + chr(1722 - 1673) + '\x32' + chr(0b1000 + 0o52), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110111) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x37' + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3604 - 3493) + '\062' + chr(50) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(2884 - 2830) + chr(0b11100 + 0o25), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b101011 + 0o12) + chr(827 - 776), 29659 - 29651), ehT0Px3KOsy9('\x30' + chr(0b110100 + 0o73) + chr(54) + chr(804 - 753), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9198 - 9087) + '\062' + chr(0b110001 + 0o0) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(1791 - 1743) + '\157' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8053 - 7942) + '\x31' + chr(0b10011 + 0o37) + chr(0b101011 + 0o7), 8), ehT0Px3KOsy9(chr(0b110000) + chr(7837 - 7726) + '\x32' + '\x36' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + chr(0b110101) + chr(53), 23259 - 23251), ehT0Px3KOsy9('\x30' + chr(0b1000110 + 0o51) + '\061' + chr(49) + '\x34', 37118 - 37110), ehT0Px3KOsy9(chr(0b110000) + chr(0b11 + 0o154) + '\062' + chr(0b110110 + 0o0) + chr(2179 - 2128), 46587 - 46579), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(1725 - 1676) + '\x36' + chr(0b10000 + 0o44), 0o10), ehT0Px3KOsy9(chr(706 - 658) + chr(0b1101111) + chr(0b110011) + chr(52) + chr(0b110110), 16206 - 16198), ehT0Px3KOsy9('\060' + chr(111) + chr(737 - 684) + chr(48), 0o10), ehT0Px3KOsy9(chr(55 - 7) + chr(111) + chr(0b110101) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(6523 - 6412) + '\x33' + '\060' + '\060', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(4573 - 4462) + chr(1215 - 1162) + chr(1526 - 1478), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xee'), '\144' + chr(2335 - 2234) + chr(0b11100 + 0o107) + chr(0b110000 + 0o77) + chr(100) + '\145')(chr(537 - 420) + chr(0b1110100) + chr(0b100010 + 0o104) + chr(0b101101) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def muROo5u_drt2(ULnjp6D6efFH, Pl0JgJDv0QqN=None, KPtq2czfwPS6=None, UFCqCPYQEkxy=None, KQ4BDFoY4RVo=ehT0Px3KOsy9('\x30' + '\157' + chr(0b110110) + chr(526 - 476), 0o10), EOCd1WZj2r_S=None, HDH7OEwZuDah=None, EXJVTwDkeUM0=ehT0Px3KOsy9(chr(48) + chr(5243 - 5132) + '\x30', 0b1000), MfpZhnWx798V=ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + chr(0b100111 + 0o11), 8), xhqfUfhWcy58=ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111) + chr(49) + '\x33' + '\x32', 0b1000), HQlygFZjk_Ts=ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49), 8), O6IqtluwDsBM=None, EkdxULuB9H6Z=None, mpU8c8_lbVWZ=None, bE_fxV0mOBtM=None, **M8EIoTs2GJXE): J0iiixqYX_fZ() Kt4weVQLYz5A.mn5QZuyPrYP0 = ehT0Px3KOsy9(chr(0b110000) + chr(0b110011 + 0o74) + chr(0b110000), 8) def Bg_IDOb9VeQN(N9UnmYvaW1pO, UFCqCPYQEkxy): xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8?\x83\x18'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(2460 - 2360) + '\x65')(chr(117) + chr(0b1110100) + '\x66' + '\055' + '\x38'))(xafqLlk3kkUe(N9UnmYvaW1pO.dropna(), xafqLlk3kkUe(SXOLrMavuUCe(b'\x93\x06\x9e/k\x8c\xd0\x1eS\xe9v\x86'), chr(7250 - 7150) + chr(101) + chr(99) + chr(111) + chr(100) + '\x65')(chr(117) + '\x74' + chr(0b1100110) + '\055' + chr(0b111000))), bins=KQ4BDFoY4RVo, **M8EIoTs2GJXE) EkdxULuB9H6Z = EkdxULuB9H6Z or xhqfUfhWcy58 (IPypcZ53eNRW, gJ3Tbhvvj8Ru) = U0P5py7sbftJ(Bg_IDOb9VeQN, ULnjp6D6efFH, column=Pl0JgJDv0QqN, by=KPtq2czfwPS6, sharex=EXJVTwDkeUM0, sharey=MfpZhnWx798V, ax=UFCqCPYQEkxy, figsize=EOCd1WZj2r_S, layout=HDH7OEwZuDah, rot=xhqfUfhWcy58) Y8oTx2_Zkajn(gJ3Tbhvvj8Ru, xlabelsize=O6IqtluwDsBM, xrot=EkdxULuB9H6Z, ylabelsize=mpU8c8_lbVWZ, yrot=bE_fxV0mOBtM) xafqLlk3kkUe(IPypcZ53eNRW, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3#\x92\x1cI\x96\x91YD\xb9v\x8e\xce\xef:'), chr(100) + '\x65' + chr(99) + chr(8152 - 8041) + chr(100) + chr(0b1100101))(chr(0b1110101) + '\164' + '\x66' + chr(0b11101 + 0o20) + chr(0b111000)))(bottom=0.15, top=0.9, left=0.1, right=0.9, hspace=0.5, wspace=0.3) return gJ3Tbhvvj8Ru
pandas-dev/pandas
pandas/plotting/_core.py
boxplot_frame_groupby
def boxplot_frame_groupby(grouped, subplots=True, column=None, fontsize=None, rot=0, grid=True, ax=None, figsize=None, layout=None, sharex=False, sharey=True, **kwds): """ Make box plots from DataFrameGroupBy data. Parameters ---------- grouped : Grouped DataFrame subplots : bool * ``False`` - no subplots will be used * ``True`` - create a subplot for each group column : column name or list of names, or vector Can be any valid input to groupby fontsize : int or string rot : label rotation angle grid : Setting this to True will show the grid ax : Matplotlib axis object, default None figsize : A tuple (width, height) in inches layout : tuple (optional) (rows, columns) for the layout of the plot sharex : bool, default False Whether x-axes will be shared among subplots .. versionadded:: 0.23.1 sharey : bool, default True Whether y-axes will be shared among subplots .. versionadded:: 0.23.1 `**kwds` : Keyword Arguments All other plotting keyword arguments to be passed to matplotlib's boxplot function Returns ------- dict of key/value = group key/DataFrame.boxplot return value or DataFrame.boxplot return value in case subplots=figures=False Examples -------- >>> import itertools >>> tuples = [t for t in itertools.product(range(1000), range(4))] >>> index = pd.MultiIndex.from_tuples(tuples, names=['lvl0', 'lvl1']) >>> data = np.random.randn(len(index),4) >>> df = pd.DataFrame(data, columns=list('ABCD'), index=index) >>> >>> grouped = df.groupby(level='lvl1') >>> boxplot_frame_groupby(grouped) >>> >>> grouped = df.unstack(level='lvl1').groupby(level=0, axis=1) >>> boxplot_frame_groupby(grouped, subplots=False) """ _raise_if_no_mpl() _converter._WARN = False if subplots is True: naxes = len(grouped) fig, axes = _subplots(naxes=naxes, squeeze=False, ax=ax, sharex=sharex, sharey=sharey, figsize=figsize, layout=layout) axes = _flatten(axes) from pandas.core.series import Series ret = Series() for (key, group), ax in zip(grouped, axes): d = group.boxplot(ax=ax, column=column, fontsize=fontsize, rot=rot, grid=grid, **kwds) ax.set_title(pprint_thing(key)) ret.loc[key] = d fig.subplots_adjust(bottom=0.15, top=0.9, left=0.1, right=0.9, wspace=0.2) else: from pandas.core.reshape.concat import concat keys, frames = zip(*grouped) if grouped.axis == 0: df = concat(frames, keys=keys, axis=1) else: if len(frames) > 1: df = frames[0].join(frames[1::]) else: df = frames[0] ret = df.boxplot(column=column, fontsize=fontsize, rot=rot, grid=grid, ax=ax, figsize=figsize, layout=layout, **kwds) return ret
python
def boxplot_frame_groupby(grouped, subplots=True, column=None, fontsize=None, rot=0, grid=True, ax=None, figsize=None, layout=None, sharex=False, sharey=True, **kwds): """ Make box plots from DataFrameGroupBy data. Parameters ---------- grouped : Grouped DataFrame subplots : bool * ``False`` - no subplots will be used * ``True`` - create a subplot for each group column : column name or list of names, or vector Can be any valid input to groupby fontsize : int or string rot : label rotation angle grid : Setting this to True will show the grid ax : Matplotlib axis object, default None figsize : A tuple (width, height) in inches layout : tuple (optional) (rows, columns) for the layout of the plot sharex : bool, default False Whether x-axes will be shared among subplots .. versionadded:: 0.23.1 sharey : bool, default True Whether y-axes will be shared among subplots .. versionadded:: 0.23.1 `**kwds` : Keyword Arguments All other plotting keyword arguments to be passed to matplotlib's boxplot function Returns ------- dict of key/value = group key/DataFrame.boxplot return value or DataFrame.boxplot return value in case subplots=figures=False Examples -------- >>> import itertools >>> tuples = [t for t in itertools.product(range(1000), range(4))] >>> index = pd.MultiIndex.from_tuples(tuples, names=['lvl0', 'lvl1']) >>> data = np.random.randn(len(index),4) >>> df = pd.DataFrame(data, columns=list('ABCD'), index=index) >>> >>> grouped = df.groupby(level='lvl1') >>> boxplot_frame_groupby(grouped) >>> >>> grouped = df.unstack(level='lvl1').groupby(level=0, axis=1) >>> boxplot_frame_groupby(grouped, subplots=False) """ _raise_if_no_mpl() _converter._WARN = False if subplots is True: naxes = len(grouped) fig, axes = _subplots(naxes=naxes, squeeze=False, ax=ax, sharex=sharex, sharey=sharey, figsize=figsize, layout=layout) axes = _flatten(axes) from pandas.core.series import Series ret = Series() for (key, group), ax in zip(grouped, axes): d = group.boxplot(ax=ax, column=column, fontsize=fontsize, rot=rot, grid=grid, **kwds) ax.set_title(pprint_thing(key)) ret.loc[key] = d fig.subplots_adjust(bottom=0.15, top=0.9, left=0.1, right=0.9, wspace=0.2) else: from pandas.core.reshape.concat import concat keys, frames = zip(*grouped) if grouped.axis == 0: df = concat(frames, keys=keys, axis=1) else: if len(frames) > 1: df = frames[0].join(frames[1::]) else: df = frames[0] ret = df.boxplot(column=column, fontsize=fontsize, rot=rot, grid=grid, ax=ax, figsize=figsize, layout=layout, **kwds) return ret
[ "def", "boxplot_frame_groupby", "(", "grouped", ",", "subplots", "=", "True", ",", "column", "=", "None", ",", "fontsize", "=", "None", ",", "rot", "=", "0", ",", "grid", "=", "True", ",", "ax", "=", "None", ",", "figsize", "=", "None", ",", "layout", "=", "None", ",", "sharex", "=", "False", ",", "sharey", "=", "True", ",", "*", "*", "kwds", ")", ":", "_raise_if_no_mpl", "(", ")", "_converter", ".", "_WARN", "=", "False", "if", "subplots", "is", "True", ":", "naxes", "=", "len", "(", "grouped", ")", "fig", ",", "axes", "=", "_subplots", "(", "naxes", "=", "naxes", ",", "squeeze", "=", "False", ",", "ax", "=", "ax", ",", "sharex", "=", "sharex", ",", "sharey", "=", "sharey", ",", "figsize", "=", "figsize", ",", "layout", "=", "layout", ")", "axes", "=", "_flatten", "(", "axes", ")", "from", "pandas", ".", "core", ".", "series", "import", "Series", "ret", "=", "Series", "(", ")", "for", "(", "key", ",", "group", ")", ",", "ax", "in", "zip", "(", "grouped", ",", "axes", ")", ":", "d", "=", "group", ".", "boxplot", "(", "ax", "=", "ax", ",", "column", "=", "column", ",", "fontsize", "=", "fontsize", ",", "rot", "=", "rot", ",", "grid", "=", "grid", ",", "*", "*", "kwds", ")", "ax", ".", "set_title", "(", "pprint_thing", "(", "key", ")", ")", "ret", ".", "loc", "[", "key", "]", "=", "d", "fig", ".", "subplots_adjust", "(", "bottom", "=", "0.15", ",", "top", "=", "0.9", ",", "left", "=", "0.1", ",", "right", "=", "0.9", ",", "wspace", "=", "0.2", ")", "else", ":", "from", "pandas", ".", "core", ".", "reshape", ".", "concat", "import", "concat", "keys", ",", "frames", "=", "zip", "(", "*", "grouped", ")", "if", "grouped", ".", "axis", "==", "0", ":", "df", "=", "concat", "(", "frames", ",", "keys", "=", "keys", ",", "axis", "=", "1", ")", "else", ":", "if", "len", "(", "frames", ")", ">", "1", ":", "df", "=", "frames", "[", "0", "]", ".", "join", "(", "frames", "[", "1", ":", ":", "]", ")", "else", ":", "df", "=", "frames", "[", "0", "]", "ret", "=", "df", ".", "boxplot", "(", "column", "=", "column", ",", "fontsize", "=", "fontsize", ",", "rot", "=", "rot", ",", "grid", "=", "grid", ",", "ax", "=", "ax", ",", "figsize", "=", "figsize", ",", "layout", "=", "layout", ",", "*", "*", "kwds", ")", "return", "ret" ]
Make box plots from DataFrameGroupBy data. Parameters ---------- grouped : Grouped DataFrame subplots : bool * ``False`` - no subplots will be used * ``True`` - create a subplot for each group column : column name or list of names, or vector Can be any valid input to groupby fontsize : int or string rot : label rotation angle grid : Setting this to True will show the grid ax : Matplotlib axis object, default None figsize : A tuple (width, height) in inches layout : tuple (optional) (rows, columns) for the layout of the plot sharex : bool, default False Whether x-axes will be shared among subplots .. versionadded:: 0.23.1 sharey : bool, default True Whether y-axes will be shared among subplots .. versionadded:: 0.23.1 `**kwds` : Keyword Arguments All other plotting keyword arguments to be passed to matplotlib's boxplot function Returns ------- dict of key/value = group key/DataFrame.boxplot return value or DataFrame.boxplot return value in case subplots=figures=False Examples -------- >>> import itertools >>> tuples = [t for t in itertools.product(range(1000), range(4))] >>> index = pd.MultiIndex.from_tuples(tuples, names=['lvl0', 'lvl1']) >>> data = np.random.randn(len(index),4) >>> df = pd.DataFrame(data, columns=list('ABCD'), index=index) >>> >>> grouped = df.groupby(level='lvl1') >>> boxplot_frame_groupby(grouped) >>> >>> grouped = df.unstack(level='lvl1').groupby(level=0, axis=1) >>> boxplot_frame_groupby(grouped, subplots=False)
[ "Make", "box", "plots", "from", "DataFrameGroupBy", "data", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L2570-L2653
train
Group by function for a set of dataframes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOW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68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\x36' + chr(0b100010 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b100000 + 0o22) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(3572 - 3461) + '\x32' + chr(0b110101) + chr(0b110001), 46507 - 46499), ehT0Px3KOsy9(chr(1081 - 1033) + chr(111) + chr(49) + chr(0b101001 + 0o12) + chr(2505 - 2450), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(1630 - 1578), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110101) + chr(1833 - 1785), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b101 + 0o61) + chr(744 - 695), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(0b110011) + chr(1834 - 1779) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(1433 - 1380) + chr(298 - 250), 16127 - 16119), ehT0Px3KOsy9(chr(0b110000) + chr(389 - 278) + '\x31' + '\063' + chr(0b11101 + 0o24), 0o10), ehT0Px3KOsy9(chr(48) + chr(9255 - 9144) + '\x33' + '\x34', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101000 + 0o16) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + '\x31' + chr(0b100110 + 0o17) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b111110 + 0o61) + chr(232 - 177) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(1692 - 1641) + chr(0b110010 + 0o2), 41485 - 41477), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\157' + chr(51) + chr(0b110100), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b10 + 0o60) + chr(0b11110 + 0o24) + chr(52), 37806 - 37798), ehT0Px3KOsy9(chr(318 - 270) + '\x6f' + chr(2594 - 2543) + '\x37' + '\060', 33500 - 33492), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(1005 - 953) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x36' + '\x31', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(1087 - 1038) + chr(1981 - 1929), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100101 + 0o16) + chr(1299 - 1248) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8335 - 8224) + chr(516 - 465) + '\x35' + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(1808 - 1697) + chr(1565 - 1516) + chr(0b11100 + 0o32) + chr(55), 27221 - 27213), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101001 + 0o6) + '\x31' + chr(54) + chr(0b1000 + 0o56), 35867 - 35859), ehT0Px3KOsy9(chr(48) + chr(0b11111 + 0o120) + chr(0b11011 + 0o26) + chr(55) + chr(194 - 145), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5105 - 4994) + '\061' + chr(103 - 54) + chr(0b11100 + 0o27), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\060' + chr(1805 - 1750), 37941 - 37933), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(5881 - 5770) + chr(0b1100 + 0o47) + chr(53) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + chr(784 - 673) + '\063' + chr(0b110011) + chr(0b0 + 0o62), ord("\x08")), ehT0Px3KOsy9(chr(1630 - 1582) + chr(0b1101111) + '\x31' + chr(0b110110) + chr(128 - 78), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6453 - 6342) + '\062' + chr(50) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(370 - 322) + chr(0b10100 + 0o133) + '\x33' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(3404 - 3293) + chr(49) + chr(0b110010) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(2231 - 2179), 0b1000), ehT0Px3KOsy9('\060' + chr(5500 - 5389) + '\063' + chr(0b11110 + 0o27), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7510 - 7399) + chr(1062 - 1009) + chr(0b1111 + 0o47), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(348 - 299) + '\062' + chr(0b100 + 0o61), 0o10), ehT0Px3KOsy9('\060' + chr(0b100111 + 0o110) + chr(0b110010) + chr(113 - 63) + chr(0b10100 + 0o35), 7347 - 7339), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\x34', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(3305 - 3194) + chr(785 - 732) + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf'), chr(0b110110 + 0o56) + chr(101) + '\x63' + chr(111) + '\x64' + '\x65')(chr(117) + '\x74' + '\146' + '\055' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def fH36Y640YeOo(iYhy974p0Ldn, WuPlsSVhhVV1=ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31', 0o10), Pl0JgJDv0QqN=None, TDEJPHYIHA5z=None, xhqfUfhWcy58=ehT0Px3KOsy9('\060' + chr(111) + chr(0b101010 + 0o6), 0o10), HQlygFZjk_Ts=ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10 + 0o57), 8), UFCqCPYQEkxy=None, EOCd1WZj2r_S=None, HDH7OEwZuDah=None, EXJVTwDkeUM0=ehT0Px3KOsy9(chr(1527 - 1479) + chr(0b1101111) + '\x30', 8), MfpZhnWx798V=ehT0Px3KOsy9(chr(1477 - 1429) + '\157' + chr(0b0 + 0o61), 8), **ClrkdavlbKME): J0iiixqYX_fZ() Kt4weVQLYz5A.mn5QZuyPrYP0 = ehT0Px3KOsy9(chr(563 - 515) + chr(111) + chr(0b101101 + 0o3), 8) if WuPlsSVhhVV1 is ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101101 + 0o4), 8): YLWhYbaD7hv4 = c2A0yzQpDQB3(iYhy974p0Ldn) (IPypcZ53eNRW, gJ3Tbhvvj8Ru) = NJ7UFoibKFcf(naxes=YLWhYbaD7hv4, squeeze=ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(2035 - 1987), 8), ax=UFCqCPYQEkxy, sharex=EXJVTwDkeUM0, sharey=MfpZhnWx798V, figsize=EOCd1WZj2r_S, layout=HDH7OEwZuDah) gJ3Tbhvvj8Ru = rH_ZFwwirodI(gJ3Tbhvvj8Ru) (I9PbrFvU4NYI,) = (xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x81\xf6\xc7;}[_\x99\x87+y\x19\x1aZ\xaeu\xf1\x8b'), '\x64' + chr(101) + chr(9038 - 8939) + '\157' + chr(753 - 653) + chr(6318 - 6217))(chr(0b1110101) + '\x74' + chr(0b1100110) + '\055' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2\xf2\xdb6y['), chr(0b1100100) + '\145' + chr(2474 - 2375) + chr(7695 - 7584) + chr(8062 - 7962) + '\145')(chr(0b1110101) + chr(116) + '\146' + '\x2d' + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xf8\xdb:'), chr(5004 - 4904) + chr(101) + chr(0b111110 + 0o45) + '\x6f' + chr(100) + '\x65')('\165' + chr(0b1010001 + 0o43) + '\146' + '\055' + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xf2\xdb6y['), chr(9154 - 9054) + chr(0b1100101) + '\x63' + chr(10989 - 10878) + '\144' + chr(1816 - 1715))('\165' + chr(0b101 + 0o157) + '\x66' + chr(45) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2\xf2\xdb6y['), chr(0b1100100) + chr(0b1100001 + 0o4) + '\x63' + '\x6f' + '\144' + '\145')(chr(0b1110101) + chr(2978 - 2862) + chr(6420 - 6318) + chr(0b101101) + chr(0b100001 + 0o27))),) VHn4CV4Ymrei = I9PbrFvU4NYI() for ((K3J4ZwSlE0sT, N9UnmYvaW1pO), UFCqCPYQEkxy) in pZ0NK2y6HRbn(iYhy974p0Ldn, gJ3Tbhvvj8Ru): pd3lxn9vqWxp = N9UnmYvaW1pO.boxplot(ax=UFCqCPYQEkxy, column=Pl0JgJDv0QqN, fontsize=TDEJPHYIHA5z, rot=xhqfUfhWcy58, grid=HQlygFZjk_Ts, **ClrkdavlbKME) xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xf2\xdd\x00hA\x05\x96\x8d'), chr(1150 - 1050) + '\145' + chr(6712 - 6613) + '\x6f' + chr(0b1100100) + '\x65')(chr(0b1110101) + '\x74' + chr(3075 - 2973) + chr(45) + '\x38'))(wXDH9bYGsgMR(K3J4ZwSlE0sT)) VHn4CV4Ymrei.MmVY7Id_ODNA[K3J4ZwSlE0sT] = pd3lxn9vqWxp xafqLlk3kkUe(IPypcZ53eNRW, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xe2\xcb/pG\x05\x89\xb78x]\x1cL\xa8'), chr(0b1100100) + '\x65' + '\x63' + '\157' + chr(0b110010 + 0o62) + chr(0b1000100 + 0o41))(chr(12290 - 12173) + '\164' + chr(0b1010001 + 0o25) + chr(45) + '\x38'))(bottom=0.15, top=0.9, left=0.1, right=0.9, wspace=0.2) else: (n6iOk5pPXJg1,) = (xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x81\xf6\xc7;}[_\x99\x87+y\x19\x1bZ\xaft\xf5\x88\x01\x9f/\xb1\x81\x14\x17\r'), chr(0b100000 + 0o104) + '\x65' + chr(7692 - 7593) + '\157' + chr(100) + '\145')(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b10101 + 0o30) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xf8\xc7<}\\'), chr(5099 - 4999) + chr(5063 - 4962) + chr(0b1001000 + 0o33) + chr(111) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(2648 - 2546) + '\x2d' + chr(1381 - 1325))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xf8\xdb:'), chr(0b100 + 0o140) + chr(101) + '\143' + '\x6f' + '\144' + '\x65')(chr(8085 - 7968) + chr(0b1100111 + 0o15) + chr(102) + chr(0b11000 + 0o25) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\xf2\xda7}X\x14'), chr(0b1110 + 0o126) + chr(8792 - 8691) + '\143' + '\157' + '\144' + chr(0b1000110 + 0o37))(chr(0b1000000 + 0o65) + chr(116) + '\146' + chr(0b101101) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xf8\xc7<}\\'), '\x64' + '\145' + chr(99) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(4984 - 4867) + chr(0b1011110 + 0o26) + chr(10380 - 10278) + chr(0b101101) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xf8\xc7<}\\'), chr(0b100001 + 0o103) + chr(101) + '\143' + chr(1004 - 893) + chr(0b10 + 0o142) + chr(0b111001 + 0o54))('\x75' + '\164' + chr(0b10 + 0o144) + chr(400 - 355) + chr(0b10011 + 0o45))),) (w8H8C9ec5BO1, RlRNrq1190ue) = pZ0NK2y6HRbn(*iYhy974p0Ldn) if xafqLlk3kkUe(iYhy974p0Ldn, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xc5\xfd7*\x19\x00\x83\x9e0.\x03'), chr(7970 - 7870) + '\x65' + chr(0b1010110 + 0o15) + '\157' + '\x64' + '\145')(chr(0b11110 + 0o127) + '\x74' + '\x66' + '\x2d' + '\x38')) == ehT0Px3KOsy9(chr(0b110000) + chr(11255 - 11144) + chr(0b110000), 8): aVhM9WzaWXU5 = n6iOk5pPXJg1(RlRNrq1190ue, keys=w8H8C9ec5BO1, axis=ehT0Px3KOsy9(chr(894 - 846) + '\157' + chr(0b11 + 0o56), 8)) elif c2A0yzQpDQB3(RlRNrq1190ue) > ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11010 + 0o27), 8): aVhM9WzaWXU5 = RlRNrq1190ue[ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + chr(0b110000), 8)].join(RlRNrq1190ue[ehT0Px3KOsy9(chr(48) + chr(5316 - 5205) + chr(0b110001), 8):]) else: aVhM9WzaWXU5 = RlRNrq1190ue[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x30', 8)] VHn4CV4Ymrei = aVhM9WzaWXU5.boxplot(column=Pl0JgJDv0QqN, fontsize=TDEJPHYIHA5z, rot=xhqfUfhWcy58, grid=HQlygFZjk_Ts, ax=UFCqCPYQEkxy, figsize=EOCd1WZj2r_S, layout=HDH7OEwZuDah, **ClrkdavlbKME) return VHn4CV4Ymrei
pandas-dev/pandas
pandas/plotting/_core.py
MPLPlot._has_plotted_object
def _has_plotted_object(self, ax): """check whether ax has data""" return (len(ax.lines) != 0 or len(ax.artists) != 0 or len(ax.containers) != 0)
python
def _has_plotted_object(self, ax): """check whether ax has data""" return (len(ax.lines) != 0 or len(ax.artists) != 0 or len(ax.containers) != 0)
[ "def", "_has_plotted_object", "(", "self", ",", "ax", ")", ":", "return", "(", "len", "(", "ax", ".", "lines", ")", "!=", "0", "or", "len", "(", "ax", ".", "artists", ")", "!=", "0", "or", "len", "(", "ax", ".", "containers", ")", "!=", "0", ")" ]
check whether ax has data
[ "check", "whether", "ax", "has", "data" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b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S7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1299 - 1251) + chr(0b1101111) + '\063' + chr(0b1001 + 0o50) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(111) + chr(0b110001) + chr(55) + chr(0b11000 + 0o33), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110111) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + '\061' + chr(1045 - 995) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11111 + 0o23) + chr(49) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(2347 - 2236) + chr(0b110011) + chr(53) + '\061', 0b1000), ehT0Px3KOsy9(chr(188 - 140) + chr(111) + chr(2319 - 2268) + chr(0b1101 + 0o52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11011 + 0o124) + chr(0b110000 + 0o1) + chr(0b110000) + chr(1027 - 973), ord("\x08")), ehT0Px3KOsy9(chr(1291 - 1243) + chr(111) + '\x31' + chr(1849 - 1796) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + chr(0b11000 + 0o32) + chr(50) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1981 - 1931) + '\064' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11100 + 0o32) + chr(2621 - 2568), 0b1000), ehT0Px3KOsy9(chr(1928 - 1880) + '\157' + '\062' + chr(55) + chr(0b110010), 9782 - 9774), ehT0Px3KOsy9(chr(1873 - 1825) + chr(0b1101111) + '\x35' + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(1088 - 1038) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + chr(0b100 + 0o56) + chr(0b110111) + chr(0b110001), 46236 - 46228), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(111) + '\x31' + chr(0b11010 + 0o26) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1874 - 1824) + '\x33' + '\066', 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + chr(50) + chr(1286 - 1234) + chr(0b110001), 20919 - 20911), ehT0Px3KOsy9('\x30' + chr(11596 - 11485) + '\x36' + chr(0b110111), 7223 - 7215), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(54) + '\067', 65068 - 65060), ehT0Px3KOsy9(chr(229 - 181) + chr(0b1101111) + chr(0b10011 + 0o36) + chr(0b110110) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11 + 0o57) + '\x31' + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\061' + chr(48), 8), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(49) + chr(0b11100 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + '\062' + chr(0b110010) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(0b110001) + chr(52) + chr(2587 - 2532), 27298 - 27290), ehT0Px3KOsy9('\x30' + chr(0b111101 + 0o62) + '\x33' + '\060' + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(0b110000) + chr(0b100 + 0o55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b110001 + 0o76) + '\062' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\157' + chr(0b110001) + chr(0b110 + 0o61) + chr(54), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(0b1001 + 0o53) + '\x31', 8), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(0b11110 + 0o24) + '\x33' + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b11100 + 0o25) + '\x31', 8), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(0b1000 + 0o52) + chr(1136 - 1083), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(55) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b10101 + 0o132) + chr(0b110010) + chr(661 - 612), 0b1000), ehT0Px3KOsy9(chr(48) + chr(10523 - 10412) + chr(0b10011 + 0o37) + chr(0b110010 + 0o1) + chr(48), 34595 - 34587), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + chr(51) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(0b111 + 0o52) + chr(52) + chr(48), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110101) + chr(0b101001 + 0o7), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6'), '\144' + chr(101) + chr(0b110101 + 0o56) + chr(111) + chr(0b11110 + 0o106) + '\145')(chr(117) + chr(12134 - 12018) + chr(102) + chr(0b101011 + 0o2) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def fLkBkLkO4t2N(oVre8I6UXc3b, UFCqCPYQEkxy): return c2A0yzQpDQB3(xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4\x12S6\xfa'), chr(1973 - 1873) + chr(0b1100101) + chr(0b1010 + 0o131) + '\x6f' + '\x64' + chr(101))(chr(117) + chr(3487 - 3371) + chr(102) + chr(0b101101) + chr(56)))) != ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1001011 + 0o44) + chr(0b111 + 0o51), 0b1000) or c2A0yzQpDQB3(xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9\tI:\xfa\x9dl'), '\144' + '\x65' + chr(0b1100011) + chr(0b111110 + 0o61) + chr(1325 - 1225) + '\x65')('\165' + chr(7764 - 7648) + chr(0b1000000 + 0o46) + '\x2d' + '\070'))) != ehT0Px3KOsy9(chr(0b110000) + chr(0b10100 + 0o133) + chr(218 - 170), 8) or c2A0yzQpDQB3(xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b"\xab\x14S'\xe8\x80q#\x1a\xe7"), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b100111 + 0o77) + '\055' + chr(3011 - 2955)))) != ehT0Px3KOsy9(chr(0b110000) + chr(0b110100 + 0o73) + chr(1609 - 1561), 8)
pandas-dev/pandas
pandas/plotting/_core.py
MPLPlot.result
def result(self): """ Return result axes """ if self.subplots: if self.layout is not None and not is_list_like(self.ax): return self.axes.reshape(*self.layout) else: return self.axes else: sec_true = isinstance(self.secondary_y, bool) and self.secondary_y all_sec = (is_list_like(self.secondary_y) and len(self.secondary_y) == self.nseries) if (sec_true or all_sec): # if all data is plotted on secondary, return right axes return self._get_ax_layer(self.axes[0], primary=False) else: return self.axes[0]
python
def result(self): """ Return result axes """ if self.subplots: if self.layout is not None and not is_list_like(self.ax): return self.axes.reshape(*self.layout) else: return self.axes else: sec_true = isinstance(self.secondary_y, bool) and self.secondary_y all_sec = (is_list_like(self.secondary_y) and len(self.secondary_y) == self.nseries) if (sec_true or all_sec): # if all data is plotted on secondary, return right axes return self._get_ax_layer(self.axes[0], primary=False) else: return self.axes[0]
[ "def", "result", "(", "self", ")", ":", "if", "self", ".", "subplots", ":", "if", "self", ".", "layout", "is", "not", "None", "and", "not", "is_list_like", "(", "self", ".", "ax", ")", ":", "return", "self", ".", "axes", ".", "reshape", "(", "*", "self", ".", "layout", ")", "else", ":", "return", "self", ".", "axes", "else", ":", "sec_true", "=", "isinstance", "(", "self", ".", "secondary_y", ",", "bool", ")", "and", "self", ".", "secondary_y", "all_sec", "=", "(", "is_list_like", "(", "self", ".", "secondary_y", ")", "and", "len", "(", "self", ".", "secondary_y", ")", "==", "self", ".", "nseries", ")", "if", "(", "sec_true", "or", "all_sec", ")", ":", "# if all data is plotted on secondary, return right axes", "return", "self", ".", "_get_ax_layer", "(", "self", ".", "axes", "[", "0", "]", ",", "primary", "=", "False", ")", "else", ":", "return", "self", ".", "axes", "[", "0", "]" ]
Return result axes
[ "Return", "result", "axes" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L336-L353
train
Return result axes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4Be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eM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b11001 + 0o126) + chr(0b110011) + '\061' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(48) + chr(0b1111 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(0b100001 + 0o20) + chr(0b110001) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1000 + 0o51) + chr(394 - 345) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101101 + 0o2) + chr(0b110010) + '\x34' + chr(0b1111 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(674 - 626) + chr(0b1101111) + chr(2464 - 2414) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + '\x36' + chr(50), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(54) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + '\062' + chr(2864 - 2810), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(2391 - 2342) + chr(0b110100) + chr(1520 - 1472), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11011 + 0o26) + chr(49) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + '\060' + chr(53), 36131 - 36123), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(0b110101) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + '\x32' + '\063', 18334 - 18326), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(50) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x37', 0b1000), ehT0Px3KOsy9(chr(1989 - 1941) + '\157' + chr(0b110011) + chr(0b110101) + chr(0b110011), 7878 - 7870), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(11555 - 11444) + '\x31' + '\064' + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\064' + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100010 + 0o22) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(665 - 617) + chr(347 - 236) + '\x32' + chr(0b110000) + chr(0b10101 + 0o37), 26149 - 26141), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1305 - 1253) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(374 - 320), 24576 - 24568), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\x31' + chr(0b10111 + 0o34), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1011 + 0o50) + '\x31' + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100 + 0o55) + chr(49) + chr(51), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110110) + chr(0b110101), 42615 - 42607), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\064' + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100110 + 0o11) + chr(0b1100 + 0o51) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011111 + 0o20) + chr(0b1011 + 0o54) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(245 - 197) + chr(0b11 + 0o154) + '\067' + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110110) + '\064', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(629 - 579) + chr(0b110001 + 0o1) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(111) + chr(50) + chr(1061 - 1011) + '\065', 55292 - 55284), ehT0Px3KOsy9('\x30' + '\x6f' + chr(828 - 778) + '\063', 8), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(796 - 746) + '\x35' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7445 - 7334) + chr(233 - 182) + chr(51) + '\067', 43662 - 43654)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2'), '\144' + chr(101) + chr(6901 - 6802) + chr(0b110011 + 0o74) + chr(100) + chr(101))('\x75' + chr(116) + chr(7159 - 7057) + '\x2d' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ShZmEKfTkAOZ(oVre8I6UXc3b): if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbf\xb4(;\xcc~\xc6@'), chr(100) + '\x65' + chr(0b100010 + 0o101) + '\157' + chr(0b100101 + 0o77) + chr(0b1100101))(chr(117) + chr(0b1101001 + 0o13) + chr(3189 - 3087) + chr(1827 - 1782) + '\x38')): if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\xa03$\xd5e'), chr(1587 - 1487) + chr(0b1100101) + chr(1660 - 1561) + '\x6f' + '\144' + '\145')(chr(0b1110101) + chr(0b1110100) + chr(6796 - 6694) + chr(1840 - 1795) + chr(0b111000))) is not None and (not bAgBF7jXI53B(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xb9'), chr(100) + '\145' + '\x63' + '\157' + '\144' + chr(3435 - 3334))(chr(10699 - 10582) + '\x74' + '\x66' + '\055' + chr(56))))): return xafqLlk3kkUe(oVre8I6UXc3b.axes, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe\xa49#\xc1a\xd7'), chr(0b1100100) + chr(3798 - 3697) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(101))('\165' + chr(116) + '\x66' + chr(1256 - 1211) + chr(461 - 405)))(*xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\xa03$\xd5e'), '\144' + '\x65' + chr(99) + chr(0b1101111) + chr(9173 - 9073) + chr(3754 - 3653))('\x75' + chr(0b1110100) + '\146' + chr(45) + chr(2323 - 2267)))) else: return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\x8by\x1f\xc2y\xc4Er.28'), '\x64' + chr(4923 - 4822) + '\143' + chr(111) + '\144' + chr(0b100001 + 0o104))('\x75' + chr(0b10 + 0o162) + '\x66' + chr(0b101101 + 0o0) + chr(0b111000))) else: dctxha9RO_Di = PlSM16l2KDPD(oVre8I6UXc3b.secondary_y, WbBjf8Y7v9VN) and oVre8I6UXc3b.secondary_y k0PpdNpqrEt5 = bAgBF7jXI53B(oVre8I6UXc3b.secondary_y) and c2A0yzQpDQB3(oVre8I6UXc3b.secondary_y) == oVre8I6UXc3b.nseries if dctxha9RO_Di or k0PpdNpqrEt5: return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93\xa6/?\xffp\xcaltw\x19(7'), chr(5532 - 5432) + chr(0b1100101) + chr(99) + chr(7021 - 6910) + '\x64' + chr(9673 - 9572))('\x75' + '\164' + '\x66' + chr(1069 - 1024) + '\x38'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\x8by\x1f\xc2y\xc4Er.28'), '\x64' + chr(0b110000 + 0o65) + chr(0b1011000 + 0o13) + chr(11480 - 11369) + chr(0b11101 + 0o107) + '\145')('\165' + chr(0b10001 + 0o143) + chr(0b1100110) + '\055' + chr(0b111000)))[ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2253 - 2205), ord("\x08"))], primary=ehT0Px3KOsy9(chr(48) + '\x6f' + '\060', 8)) else: return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\x8by\x1f\xc2y\xc4Er.28'), chr(100) + chr(0b1100101) + chr(99) + chr(111) + '\x64' + chr(0b1100101))('\x75' + chr(13444 - 13328) + chr(0b110100 + 0o62) + chr(45) + chr(0b111000)))[ehT0Px3KOsy9('\x30' + chr(8407 - 8296) + chr(0b100110 + 0o12), 8)]
pandas-dev/pandas
pandas/plotting/_core.py
MPLPlot._post_plot_logic_common
def _post_plot_logic_common(self, ax, data): """Common post process for each axes""" def get_label(i): try: return pprint_thing(data.index[i]) except Exception: return '' if self.orientation == 'vertical' or self.orientation is None: if self._need_to_set_index: xticklabels = [get_label(x) for x in ax.get_xticks()] ax.set_xticklabels(xticklabels) self._apply_axis_properties(ax.xaxis, rot=self.rot, fontsize=self.fontsize) self._apply_axis_properties(ax.yaxis, fontsize=self.fontsize) if hasattr(ax, 'right_ax'): self._apply_axis_properties(ax.right_ax.yaxis, fontsize=self.fontsize) elif self.orientation == 'horizontal': if self._need_to_set_index: yticklabels = [get_label(y) for y in ax.get_yticks()] ax.set_yticklabels(yticklabels) self._apply_axis_properties(ax.yaxis, rot=self.rot, fontsize=self.fontsize) self._apply_axis_properties(ax.xaxis, fontsize=self.fontsize) if hasattr(ax, 'right_ax'): self._apply_axis_properties(ax.right_ax.yaxis, fontsize=self.fontsize) else: # pragma no cover raise ValueError
python
def _post_plot_logic_common(self, ax, data): """Common post process for each axes""" def get_label(i): try: return pprint_thing(data.index[i]) except Exception: return '' if self.orientation == 'vertical' or self.orientation is None: if self._need_to_set_index: xticklabels = [get_label(x) for x in ax.get_xticks()] ax.set_xticklabels(xticklabels) self._apply_axis_properties(ax.xaxis, rot=self.rot, fontsize=self.fontsize) self._apply_axis_properties(ax.yaxis, fontsize=self.fontsize) if hasattr(ax, 'right_ax'): self._apply_axis_properties(ax.right_ax.yaxis, fontsize=self.fontsize) elif self.orientation == 'horizontal': if self._need_to_set_index: yticklabels = [get_label(y) for y in ax.get_yticks()] ax.set_yticklabels(yticklabels) self._apply_axis_properties(ax.yaxis, rot=self.rot, fontsize=self.fontsize) self._apply_axis_properties(ax.xaxis, fontsize=self.fontsize) if hasattr(ax, 'right_ax'): self._apply_axis_properties(ax.right_ax.yaxis, fontsize=self.fontsize) else: # pragma no cover raise ValueError
[ "def", "_post_plot_logic_common", "(", "self", ",", "ax", ",", "data", ")", ":", "def", "get_label", "(", "i", ")", ":", "try", ":", "return", "pprint_thing", "(", "data", ".", "index", "[", "i", "]", ")", "except", "Exception", ":", "return", "''", "if", "self", ".", "orientation", "==", "'vertical'", "or", "self", ".", "orientation", "is", "None", ":", "if", "self", ".", "_need_to_set_index", ":", "xticklabels", "=", "[", "get_label", "(", "x", ")", "for", "x", "in", "ax", ".", "get_xticks", "(", ")", "]", "ax", ".", "set_xticklabels", "(", "xticklabels", ")", "self", ".", "_apply_axis_properties", "(", "ax", ".", "xaxis", ",", "rot", "=", "self", ".", "rot", ",", "fontsize", "=", "self", ".", "fontsize", ")", "self", ".", "_apply_axis_properties", "(", "ax", ".", "yaxis", ",", "fontsize", "=", "self", ".", "fontsize", ")", "if", "hasattr", "(", "ax", ",", "'right_ax'", ")", ":", "self", ".", "_apply_axis_properties", "(", "ax", ".", "right_ax", ".", "yaxis", ",", "fontsize", "=", "self", ".", "fontsize", ")", "elif", "self", ".", "orientation", "==", "'horizontal'", ":", "if", "self", ".", "_need_to_set_index", ":", "yticklabels", "=", "[", "get_label", "(", "y", ")", "for", "y", "in", "ax", ".", "get_yticks", "(", ")", "]", "ax", ".", "set_yticklabels", "(", "yticklabels", ")", "self", ".", "_apply_axis_properties", "(", "ax", ".", "yaxis", ",", "rot", "=", "self", ".", "rot", ",", "fontsize", "=", "self", ".", "fontsize", ")", "self", ".", "_apply_axis_properties", "(", "ax", ".", "xaxis", ",", "fontsize", "=", "self", ".", "fontsize", ")", "if", "hasattr", "(", "ax", ",", "'right_ax'", ")", ":", "self", ".", "_apply_axis_properties", "(", "ax", ".", "right_ax", ".", "yaxis", ",", "fontsize", "=", "self", ".", "fontsize", ")", "else", ":", "# pragma no cover", "raise", "ValueError" ]
Common post process for each axes
[ "Common", "post", "process", "for", "each", "axes" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L402-L435
train
Common post processing for each axes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT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8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\065' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(7506 - 7395) + '\x33' + '\x35' + '\062', 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + chr(0b11101 + 0o26) + chr(53) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(0b100111 + 0o14) + '\x33', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x34' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(48) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(574 - 526) + chr(0b10011 + 0o134) + '\x36' + chr(0b10001 + 0o46), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\065', 4601 - 4593), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(3948 - 3837) + chr(373 - 324) + chr(0b110111) + chr(1087 - 1039), 56862 - 56854), ehT0Px3KOsy9(chr(2118 - 2070) + chr(111) + chr(0b100110 + 0o16) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + '\066' + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(0b110001) + chr(58 - 5), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + chr(1345 - 1294) + chr(0b100010 + 0o16) + chr(2734 - 2679), 16029 - 16021), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + '\062' + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(48) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(1990 - 1938) + chr(0b110111), 43836 - 43828), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101001 + 0o15) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(48) + chr(0b100001 + 0o24), 0b1000), ehT0Px3KOsy9(chr(1792 - 1744) + '\x6f' + chr(0b110001) + chr(0b110000) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(11510 - 11399) + chr(0b110010) + chr(0b110 + 0o53) + chr(0b0 + 0o64), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1000111 + 0o50) + '\x32' + chr(51) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(0b100011 + 0o20) + chr(49), 51826 - 51818), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(1949 - 1894) + chr(1334 - 1285), 17339 - 17331), ehT0Px3KOsy9(chr(48) + chr(2127 - 2016) + '\063' + chr(0b100010 + 0o16) + chr(0b1110 + 0o43), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(11004 - 10893) + chr(0b110010) + '\x36' + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + '\x31' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(1070 - 1022) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(11309 - 11198) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011111 + 0o20) + chr(51) + chr(2241 - 2189) + chr(870 - 819), 0o10), ehT0Px3KOsy9(chr(2172 - 2124) + '\x6f' + chr(184 - 133) + chr(0b110001 + 0o3) + chr(0b101101 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + chr(49) + chr(53) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111101 + 0o62) + chr(2314 - 2265) + '\x36' + chr(55), 4109 - 4101), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(0b110011) + '\x36' + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b10111 + 0o36) + chr(51), 0o10), ehT0Px3KOsy9(chr(504 - 456) + chr(111) + chr(0b110010) + chr(1800 - 1745) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x36' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(1448 - 1397) + chr(0b11001 + 0o31), 0b1000), ehT0Px3KOsy9(chr(1739 - 1691) + '\157' + chr(0b110001) + chr(0b110010) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1100010 + 0o15) + chr(0b110110) + chr(0b10110 + 0o34), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(0b1 + 0o62) + '\061' + chr(0b110010), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + chr(0b110101) + chr(1043 - 995), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x03'), chr(8853 - 8753) + chr(0b111110 + 0o47) + '\143' + chr(0b101110 + 0o101) + '\144' + chr(0b1100101))(chr(117) + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b10110 + 0o42)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def wVPptacAo1rq(oVre8I6UXc3b, UFCqCPYQEkxy, ULnjp6D6efFH): def RRgjM7NzmF57(WVxHKyX45z_L): try: return wXDH9bYGsgMR(xafqLlk3kkUe(ULnjp6D6efFH, xafqLlk3kkUe(SXOLrMavuUCe(b'u\x8e\x80\xacp\xe1}N"q\xb8\xf4'), '\x64' + chr(101) + '\x63' + chr(111) + chr(7708 - 7608) + chr(101))('\165' + '\164' + chr(4842 - 4740) + '\x2d' + chr(56)))[WVxHKyX45z_L]) except jLmadlzMdunT: return xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(100) + chr(0b1100101) + '\143' + chr(3541 - 3430) + chr(0b1100100) + chr(0b1100101))('\165' + chr(0b10 + 0o162) + '\x66' + chr(0b101100 + 0o1) + chr(0b111 + 0o61)) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'B\x98\x86\xbeL\xf7Vq\x11I\x9a'), chr(8484 - 8384) + '\x65' + '\x63' + chr(0b1101111) + '\x64' + chr(101))('\165' + chr(0b100010 + 0o122) + chr(0b1100110) + chr(45) + chr(0b111000))) == xafqLlk3kkUe(SXOLrMavuUCe(b'[\x8f\x9d\xafK\xe0Vi'), chr(100) + chr(101) + chr(99) + chr(0b1010001 + 0o36) + chr(100) + chr(0b10 + 0o143))(chr(117) + '\x74' + chr(0b101011 + 0o73) + chr(1777 - 1732) + '\x38') or xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'B\x98\x86\xbeL\xf7Vq\x11I\x9a'), '\x64' + '\145' + chr(99) + chr(9673 - 9562) + '\144' + chr(2752 - 2651))(chr(0b111100 + 0o71) + chr(116) + chr(102) + chr(1683 - 1638) + chr(0b111000))) is None: if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"r\x84\x8a\xbeF\xdcCj'U\x91\xb9\x98\xbe\xab\xc3U="), '\x64' + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(6486 - 6386) + chr(1317 - 1216))(chr(0b11111 + 0o126) + chr(6738 - 6622) + chr(0b1100110) + chr(0b111 + 0o46) + chr(0b10011 + 0o45))): jpnkgQ8o0_UT = [RRgjM7NzmF57(OeWW0F1dBPRQ) for OeWW0F1dBPRQ in UFCqCPYQEkxy.get_xticks()] xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'^\x8f\x9b\x84Z\xf7^f\x13J\x95\xaf\xa2\xbb\xb6'), chr(3836 - 3736) + '\145' + chr(0b1011010 + 0o11) + '\x6f' + chr(0b1000001 + 0o43) + chr(0b1010011 + 0o22))(chr(0b1110101) + '\164' + '\x66' + '\055' + '\070'))(jpnkgQ8o0_UT) xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'r\x8b\x9f\xabN\xfahd\x00O\x87\x92\xb7\xa5\xaa\xd7U77\xe5\xfa\xaa'), '\144' + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + '\x65')(chr(117) + chr(0b1110100) + '\x66' + '\055' + '\x38'))(xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'U\x8b\x97\xb2Q'), chr(100) + chr(101) + '\143' + chr(0b1101111) + chr(100) + '\x65')(chr(0b1110101) + '\164' + chr(102) + '\x2d' + chr(0b111000))), rot=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'_\x85\x9b'), '\144' + '\145' + chr(2192 - 2093) + chr(0b1101111) + '\x64' + chr(0b11100 + 0o111))(chr(117) + chr(9420 - 9304) + chr(4294 - 4192) + chr(0b101101) + '\x38')), fontsize=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'K\x85\x81\xafQ\xeaM`'), chr(2399 - 2299) + chr(0b110101 + 0o60) + chr(0b1010110 + 0o15) + chr(3701 - 3590) + '\x64' + chr(6013 - 5912))(chr(117) + chr(926 - 810) + chr(0b1100110) + chr(1689 - 1644) + chr(56)))) xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'r\x8b\x9f\xabN\xfahd\x00O\x87\x92\xb7\xa5\xaa\xd7U77\xe5\xfa\xaa'), '\144' + '\x65' + chr(0b110100 + 0o57) + chr(0b100 + 0o153) + chr(0b110101 + 0o57) + '\x65')(chr(5593 - 5476) + chr(116) + chr(5421 - 5319) + chr(0b101101) + chr(0b111000)))(xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'T\x8b\x97\xb2Q'), '\x64' + '\x65' + chr(99) + '\x6f' + chr(0b1101 + 0o127) + chr(101))(chr(117) + '\x74' + chr(0b1001001 + 0o35) + '\x2d' + '\070')), fontsize=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'K\x85\x81\xafQ\xeaM`'), chr(4674 - 4574) + chr(101) + chr(0b1001111 + 0o24) + chr(0b1000001 + 0o56) + chr(0b1100100) + chr(8970 - 8869))(chr(117) + chr(9139 - 9023) + chr(102) + chr(45) + chr(56)))) if lot1PSoAwYhj(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'_\x83\x88\xb3V\xdcV}'), chr(100) + '\145' + '\x63' + '\157' + chr(0b10101 + 0o117) + chr(9969 - 9868))(chr(1434 - 1317) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(0b111000))): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'r\x8b\x9f\xabN\xfahd\x00O\x87\x92\xb7\xa5\xaa\xd7U77\xe5\xfa\xaa'), chr(0b1100100) + '\x65' + chr(1465 - 1366) + '\x6f' + chr(5551 - 5451) + chr(0b1100101))(chr(0b1110101) + chr(0b10001 + 0o143) + chr(0b1100110) + chr(0b101101) + '\x38'))(xafqLlk3kkUe(UFCqCPYQEkxy.right_ax, xafqLlk3kkUe(SXOLrMavuUCe(b'T\x8b\x97\xb2Q'), '\144' + '\145' + chr(99) + chr(111) + chr(0b1100100) + chr(101))('\165' + '\164' + chr(8108 - 8006) + '\x2d' + chr(0b1010 + 0o56))), fontsize=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'K\x85\x81\xafQ\xeaM`'), '\144' + chr(101) + chr(99) + chr(1650 - 1539) + chr(100) + chr(0b1100101))('\x75' + '\164' + chr(0b1100110) + chr(1120 - 1075) + chr(0b111000)))) elif xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'B\x98\x86\xbeL\xf7Vq\x11I\x9a'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(9879 - 9768) + chr(0b1100100) + '\145')(chr(0b1010 + 0o153) + chr(0b1001 + 0o153) + chr(0b1100110) + chr(1127 - 1082) + chr(0b11111 + 0o31))) == xafqLlk3kkUe(SXOLrMavuUCe(b'E\x85\x9d\xb2X\xecYq\x19J'), chr(0b1010111 + 0o15) + chr(101) + chr(0b111011 + 0o50) + chr(0b1101111) + chr(100) + '\x65')(chr(9547 - 9430) + chr(8757 - 8641) + chr(9927 - 9825) + chr(1384 - 1339) + chr(1866 - 1810)): if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"r\x84\x8a\xbeF\xdcCj'U\x91\xb9\x98\xbe\xab\xc3U="), chr(100) + '\x65' + chr(0b1001111 + 0o24) + chr(2931 - 2820) + chr(100) + chr(101))(chr(0b1110101) + chr(0b1001001 + 0o53) + chr(102) + chr(0b100111 + 0o6) + chr(0b111000))): iXUJ4B2acc1X = [RRgjM7NzmF57(SqiSOtYOqOJH) for SqiSOtYOqOJH in UFCqCPYQEkxy.get_yticks()] xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'^\x8f\x9b\x84[\xf7^f\x13J\x95\xaf\xa2\xbb\xb6'), chr(0b1100100) + chr(0b100011 + 0o102) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(0b1101000 + 0o15) + '\x74' + '\x66' + '\055' + chr(56)))(iXUJ4B2acc1X) xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'r\x8b\x9f\xabN\xfahd\x00O\x87\x92\xb7\xa5\xaa\xd7U77\xe5\xfa\xaa'), chr(6468 - 6368) + chr(101) + '\x63' + '\x6f' + chr(1896 - 1796) + chr(101))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(629 - 584) + '\x38'))(xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'T\x8b\x97\xb2Q'), '\144' + chr(0b1100101) + chr(99) + '\x6f' + chr(8367 - 8267) + '\145')(chr(0b1110101) + '\164' + chr(0b1011010 + 0o14) + '\x2d' + '\070')), rot=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'_\x85\x9b'), '\x64' + '\x65' + '\143' + chr(111) + chr(0b1100100) + '\x65')(chr(0b1011110 + 0o27) + chr(5849 - 5733) + chr(0b1100110) + '\x2d' + chr(56))), fontsize=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'K\x85\x81\xafQ\xeaM`'), chr(100) + '\145' + chr(99) + chr(0b1100000 + 0o17) + '\144' + chr(0b101110 + 0o67))('\x75' + chr(0b1110100) + '\146' + '\055' + chr(0b111000)))) xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'r\x8b\x9f\xabN\xfahd\x00O\x87\x92\xb7\xa5\xaa\xd7U77\xe5\xfa\xaa'), chr(1001 - 901) + chr(5663 - 5562) + chr(9613 - 9514) + chr(6682 - 6571) + '\x64' + chr(3648 - 3547))('\x75' + '\x74' + chr(0b1100011 + 0o3) + chr(45) + '\x38'))(xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'U\x8b\x97\xb2Q'), '\x64' + chr(101) + '\143' + chr(0b1101111) + chr(100) + chr(0b11000 + 0o115))('\x75' + chr(116) + chr(2361 - 2259) + chr(0b100100 + 0o11) + chr(56))), fontsize=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'K\x85\x81\xafQ\xeaM`'), '\x64' + chr(0b1100101) + chr(99) + chr(0b100101 + 0o112) + '\144' + '\145')('\165' + chr(13446 - 13330) + chr(0b10110 + 0o120) + chr(1616 - 1571) + '\x38'))) if lot1PSoAwYhj(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'_\x83\x88\xb3V\xdcV}'), chr(100) + chr(7686 - 7585) + chr(99) + chr(8547 - 8436) + chr(0b1100100) + '\145')('\165' + chr(116) + chr(0b1011101 + 0o11) + chr(1352 - 1307) + chr(0b1101 + 0o53))): xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'r\x8b\x9f\xabN\xfahd\x00O\x87\x92\xb7\xa5\xaa\xd7U77\xe5\xfa\xaa'), chr(0b1100100) + chr(6154 - 6053) + chr(8317 - 8218) + '\157' + chr(100) + chr(0b1000000 + 0o45))(chr(4720 - 4603) + chr(116) + chr(102) + '\055' + chr(0b110 + 0o62)))(xafqLlk3kkUe(UFCqCPYQEkxy.right_ax, xafqLlk3kkUe(SXOLrMavuUCe(b'T\x8b\x97\xb2Q'), chr(9228 - 9128) + chr(101) + chr(1977 - 1878) + chr(111) + '\x64' + chr(101))(chr(0b100111 + 0o116) + chr(2231 - 2115) + '\x66' + chr(0b101101) + chr(0b111 + 0o61))), fontsize=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'K\x85\x81\xafQ\xeaM`'), chr(0b1011000 + 0o14) + chr(0b1001000 + 0o35) + chr(0b1100011) + chr(111) + '\x64' + chr(4658 - 4557))('\x75' + '\164' + chr(7814 - 7712) + '\055' + chr(2901 - 2845)))) else: raise q1QCh3W88sgk
pandas-dev/pandas
pandas/plotting/_core.py
MPLPlot._adorn_subplots
def _adorn_subplots(self): """Common post process unrelated to data""" if len(self.axes) > 0: all_axes = self._get_subplots() nrows, ncols = self._get_axes_layout() _handle_shared_axes(axarr=all_axes, nplots=len(all_axes), naxes=nrows * ncols, nrows=nrows, ncols=ncols, sharex=self.sharex, sharey=self.sharey) for ax in self.axes: if self.yticks is not None: ax.set_yticks(self.yticks) if self.xticks is not None: ax.set_xticks(self.xticks) if self.ylim is not None: ax.set_ylim(self.ylim) if self.xlim is not None: ax.set_xlim(self.xlim) ax.grid(self.grid) if self.title: if self.subplots: if is_list_like(self.title): if len(self.title) != self.nseries: msg = ('The length of `title` must equal the number ' 'of columns if using `title` of type `list` ' 'and `subplots=True`.\n' 'length of title = {}\n' 'number of columns = {}').format( len(self.title), self.nseries) raise ValueError(msg) for (ax, title) in zip(self.axes, self.title): ax.set_title(title) else: self.fig.suptitle(self.title) else: if is_list_like(self.title): msg = ('Using `title` of type `list` is not supported ' 'unless `subplots=True` is passed') raise ValueError(msg) self.axes[0].set_title(self.title)
python
def _adorn_subplots(self): """Common post process unrelated to data""" if len(self.axes) > 0: all_axes = self._get_subplots() nrows, ncols = self._get_axes_layout() _handle_shared_axes(axarr=all_axes, nplots=len(all_axes), naxes=nrows * ncols, nrows=nrows, ncols=ncols, sharex=self.sharex, sharey=self.sharey) for ax in self.axes: if self.yticks is not None: ax.set_yticks(self.yticks) if self.xticks is not None: ax.set_xticks(self.xticks) if self.ylim is not None: ax.set_ylim(self.ylim) if self.xlim is not None: ax.set_xlim(self.xlim) ax.grid(self.grid) if self.title: if self.subplots: if is_list_like(self.title): if len(self.title) != self.nseries: msg = ('The length of `title` must equal the number ' 'of columns if using `title` of type `list` ' 'and `subplots=True`.\n' 'length of title = {}\n' 'number of columns = {}').format( len(self.title), self.nseries) raise ValueError(msg) for (ax, title) in zip(self.axes, self.title): ax.set_title(title) else: self.fig.suptitle(self.title) else: if is_list_like(self.title): msg = ('Using `title` of type `list` is not supported ' 'unless `subplots=True` is passed') raise ValueError(msg) self.axes[0].set_title(self.title)
[ "def", "_adorn_subplots", "(", "self", ")", ":", "if", "len", "(", "self", ".", "axes", ")", ">", "0", ":", "all_axes", "=", "self", ".", "_get_subplots", "(", ")", "nrows", ",", "ncols", "=", "self", ".", "_get_axes_layout", "(", ")", "_handle_shared_axes", "(", "axarr", "=", "all_axes", ",", "nplots", "=", "len", "(", "all_axes", ")", ",", "naxes", "=", "nrows", "*", "ncols", ",", "nrows", "=", "nrows", ",", "ncols", "=", "ncols", ",", "sharex", "=", "self", ".", "sharex", ",", "sharey", "=", "self", ".", "sharey", ")", "for", "ax", "in", "self", ".", "axes", ":", "if", "self", ".", "yticks", "is", "not", "None", ":", "ax", ".", "set_yticks", "(", "self", ".", "yticks", ")", "if", "self", ".", "xticks", "is", "not", "None", ":", "ax", ".", "set_xticks", "(", "self", ".", "xticks", ")", "if", "self", ".", "ylim", "is", "not", "None", ":", "ax", ".", "set_ylim", "(", "self", ".", "ylim", ")", "if", "self", ".", "xlim", "is", "not", "None", ":", "ax", ".", "set_xlim", "(", "self", ".", "xlim", ")", "ax", ".", "grid", "(", "self", ".", "grid", ")", "if", "self", ".", "title", ":", "if", "self", ".", "subplots", ":", "if", "is_list_like", "(", "self", ".", "title", ")", ":", "if", "len", "(", "self", ".", "title", ")", "!=", "self", ".", "nseries", ":", "msg", "=", "(", "'The length of `title` must equal the number '", "'of columns if using `title` of type `list` '", "'and `subplots=True`.\\n'", "'length of title = {}\\n'", "'number of columns = {}'", ")", ".", "format", "(", "len", "(", "self", ".", "title", ")", ",", "self", ".", "nseries", ")", "raise", "ValueError", "(", "msg", ")", "for", "(", "ax", ",", "title", ")", "in", "zip", "(", "self", ".", "axes", ",", "self", ".", "title", ")", ":", "ax", ".", "set_title", "(", "title", ")", "else", ":", "self", ".", "fig", ".", "suptitle", "(", "self", ".", "title", ")", "else", ":", "if", "is_list_like", "(", "self", ".", "title", ")", ":", "msg", "=", "(", "'Using `title` of type `list` is not supported '", "'unless `subplots=True` is passed'", ")", "raise", "ValueError", "(", "msg", ")", "self", ".", "axes", "[", "0", "]", ".", "set_title", "(", "self", ".", "title", ")" ]
Common post process unrelated to data
[ "Common", "post", "process", "unrelated", "to", "data" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L441-L487
train
Common post processing unrelated to data
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp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sy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010), 49647 - 49639), ehT0Px3KOsy9(chr(615 - 567) + chr(0b101000 + 0o107) + chr(1788 - 1738) + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1000110 + 0o51) + chr(0b1001 + 0o56), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000101 + 0o52) + chr(51) + chr(0b110100) + chr(0b10011 + 0o35), 25832 - 25824), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(51), 3606 - 3598), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\064' + chr(1985 - 1935), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\065' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + '\064' + '\065', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\x32' + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + chr(0b110010) + '\x34' + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3657 - 3546) + chr(2031 - 1982) + '\x35' + chr(0b11000 + 0o32), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(1980 - 1927) + chr(0b100 + 0o57), 64780 - 64772), ehT0Px3KOsy9(chr(48) + chr(8543 - 8432) + chr(50) + '\x37' + chr(0b10000 + 0o47), 0o10), ehT0Px3KOsy9('\x30' + chr(1151 - 1040) + chr(0b101000 + 0o17) + chr(1529 - 1481), 11189 - 11181), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + '\x36' + chr(0b110101), 22155 - 22147), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1010 + 0o47) + '\067' + chr(50), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(55) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(1893 - 1845) + chr(0b111001 + 0o66) + chr(687 - 638) + chr(49) + chr(972 - 921), 0o10), ehT0Px3KOsy9(chr(1727 - 1679) + '\157' + chr(53) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b111 + 0o52) + '\063' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1072 - 1024) + chr(111) + chr(0b110010) + '\x34' + chr(2280 - 2227), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b11000 + 0o32) + '\x31' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b100001 + 0o116) + chr(0b110001) + chr(0b11010 + 0o26) + chr(1571 - 1522), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(770 - 659) + chr(0b110011) + chr(55) + chr(0b100001 + 0o24), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(1378 - 1323) + chr(49), 21432 - 21424), ehT0Px3KOsy9(chr(1621 - 1573) + chr(111) + chr(0b110010) + '\066' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(444 - 396) + chr(0b1001 + 0o146) + '\x32' + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\062' + chr(1510 - 1458), 0b1000), ehT0Px3KOsy9(chr(2046 - 1998) + chr(5532 - 5421) + chr(0b111 + 0o54) + '\x35' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1295 - 1245) + '\x34' + chr(0b1100 + 0o47), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\063' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000100 + 0o53) + '\062' + chr(50) + chr(2612 - 2559), 11947 - 11939), ehT0Px3KOsy9('\x30' + chr(0b10011 + 0o134) + chr(0b110011) + '\067' + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(3669 - 3558) + chr(629 - 579) + '\x35' + chr(210 - 162), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010101 + 0o32) + chr(1790 - 1738) + chr(0b110010), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b111111 + 0o60) + chr(2337 - 2287) + chr(2897 - 2843) + chr(0b110100), 25009 - 25001), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(54) + '\060', 30232 - 30224), ehT0Px3KOsy9(chr(48) + chr(9234 - 9123) + '\x33' + chr(52) + chr(1908 - 1857), 0o10), ehT0Px3KOsy9(chr(1477 - 1429) + chr(111) + chr(50) + chr(2487 - 2433) + chr(0b110011), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + chr(53) + chr(0b110000), 31727 - 31719)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b','), '\x64' + '\145' + chr(0b11000 + 0o113) + chr(0b1101111) + chr(9383 - 9283) + '\x65')(chr(117) + '\164' + chr(102) + chr(0b100110 + 0o7) + chr(0b100 + 0o64)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def rpI5J3rogJbL(oVre8I6UXc3b): if c2A0yzQpDQB3(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'e^4\xb4qJ\x9b\xd3\xb9\x9a8\x1e'), chr(0b1000010 + 0o42) + chr(8316 - 8215) + '\x63' + chr(111) + '\144' + '\145')(chr(0b1000010 + 0o63) + chr(0b1110100) + '\x66' + '\055' + '\070'))) > ehT0Px3KOsy9('\060' + chr(5607 - 5496) + chr(1902 - 1854), 8): hl77AErxYlk5 = oVre8I6UXc3b._get_subplots() (MKYawqggLZfj, rv1R1vv7yV64) = oVre8I6UXc3b._get_axes_layout() dwaasw4Cnuks(axarr=hl77AErxYlk5, nplots=c2A0yzQpDQB3(hl77AErxYlk5), naxes=MKYawqggLZfj * rv1R1vv7yV64, nrows=MKYawqggLZfj, ncols=rv1R1vv7yV64, sharex=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'q|f\x92vZ'), chr(0b1100100) + '\145' + chr(0b1100011) + '\157' + chr(100) + '\145')(chr(117) + chr(8878 - 8762) + '\x66' + chr(0b1110 + 0o37) + chr(0b111000))), sharey=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'q|f\x92v['), chr(3824 - 3724) + chr(0b1100101) + chr(0b111011 + 0o50) + chr(111) + chr(3063 - 2963) + chr(101))(chr(117) + chr(0b111001 + 0o73) + chr(0b1000110 + 0o40) + chr(0b101101) + '\070'))) for UFCqCPYQEkxy in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'e^4\xb4qJ\x9b\xd3\xb9\x9a8\x1e'), chr(100) + chr(8781 - 8680) + '\x63' + '\x6f' + chr(0b1100100) + chr(0b10010 + 0o123))(chr(2679 - 2562) + chr(0b11001 + 0o133) + chr(6436 - 6334) + '\x2d' + '\x38')): if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{`n\x83xQ'), chr(3961 - 3861) + '\145' + chr(245 - 146) + '\x6f' + chr(0b10110 + 0o116) + '\145')(chr(0b1110101) + chr(116) + chr(0b111 + 0o137) + '\055' + chr(2307 - 2251))) is not None: xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'qqs\xbfjV\x84\xc6\xb8\xd1'), chr(100) + chr(0b11001 + 0o114) + chr(0b1100011) + chr(0b100111 + 0o110) + chr(5709 - 5609) + '\x65')(chr(0b110110 + 0o77) + chr(0b1000110 + 0o56) + chr(0b1100110) + '\055' + chr(56)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{`n\x83xQ'), chr(0b1100100) + chr(128 - 27) + chr(3801 - 3702) + chr(0b1101111) + chr(4276 - 4176) + '\x65')('\x75' + chr(0b101 + 0o157) + '\146' + chr(45) + '\x38'))) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'z`n\x83xQ'), '\144' + chr(101) + chr(0b100 + 0o137) + '\x6f' + chr(0b1100100) + '\145')(chr(117) + chr(5699 - 5583) + '\146' + chr(0b101000 + 0o5) + chr(56))) is not None: xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'qqs\xbfkV\x84\xc6\xb8\xd1'), chr(6957 - 6857) + '\x65' + chr(1494 - 1395) + chr(111) + chr(3690 - 3590) + chr(0b0 + 0o145))(chr(5127 - 5010) + chr(0b1110100) + '\x66' + '\x2d' + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'z`n\x83xQ'), chr(0b1100100) + chr(0b1100101) + chr(6328 - 6229) + chr(9397 - 9286) + chr(0b101 + 0o137) + '\145')('\165' + chr(116) + '\x66' + chr(45) + chr(0b111000)))) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{xn\x8d'), chr(100) + chr(6354 - 6253) + '\x63' + chr(0b1101111) + chr(100) + chr(9017 - 8916))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(1852 - 1796))) is not None: xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'qqs\xbfjN\x84\xc8'), chr(0b101100 + 0o70) + chr(0b1100101) + '\143' + chr(0b1011111 + 0o20) + chr(7251 - 7151) + chr(101))(chr(117) + chr(7192 - 7076) + chr(0b1100011 + 0o3) + chr(0b101101) + chr(56)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{xn\x8d'), '\144' + '\145' + chr(1227 - 1128) + '\x6f' + '\x64' + '\145')(chr(0b1110100 + 0o1) + chr(116) + '\x66' + chr(45) + '\070'))) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'zxn\x8d'), '\x64' + chr(5349 - 5248) + chr(3283 - 3184) + '\157' + chr(0b10011 + 0o121) + chr(101))(chr(0b10111 + 0o136) + '\164' + chr(0b1011110 + 0o10) + '\x2d' + chr(0b11001 + 0o37))) is not None: xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'qqs\xbfkN\x84\xc8'), chr(3901 - 3801) + chr(9058 - 8957) + chr(99) + '\157' + '\x64' + chr(9334 - 9233))(chr(0b1010101 + 0o40) + '\x74' + '\x66' + chr(1383 - 1338) + chr(0b111000)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'zxn\x8d'), '\144' + chr(0b111 + 0o136) + '\x63' + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b11101 + 0o127) + chr(102) + '\055' + chr(798 - 742)))) xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'efn\x84'), chr(100) + chr(101) + '\x63' + '\x6f' + chr(0b1011111 + 0o5) + chr(0b1011101 + 0o10))('\165' + '\x74' + chr(0b111101 + 0o51) + chr(1603 - 1558) + '\x38'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'efn\x84'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(6356 - 6245) + chr(9835 - 9735) + chr(0b101100 + 0o71))('\165' + '\x74' + chr(102) + chr(0b101 + 0o50) + chr(0b111000)))) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'v}s\x8cv'), '\x64' + chr(3367 - 3266) + chr(0b1011110 + 0o5) + chr(111) + chr(0b1100100) + '\145')('\165' + '\164' + chr(102) + '\x2d' + chr(0b1000 + 0o60))): if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'qae\x90\x7fM\x99\xd6'), chr(0b1100100) + chr(2662 - 2561) + chr(0b1100011) + chr(111) + '\x64' + chr(101))(chr(0b1101010 + 0o13) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\x38')): if bAgBF7jXI53B(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'v}s\x8cv'), '\144' + chr(101) + '\143' + chr(0b1101111) + '\x64' + chr(0b100101 + 0o100))(chr(0b1101111 + 0o6) + chr(0b111 + 0o155) + chr(102) + '\055' + '\070'))): if c2A0yzQpDQB3(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'v}s\x8cv'), '\144' + chr(0b1100101) + chr(99) + chr(111) + '\144' + '\145')(chr(0b1100000 + 0o25) + chr(12891 - 12775) + '\146' + chr(0b101100 + 0o1) + '\070'))) != xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'lgb\x92zG\x9e'), chr(100) + chr(0b1100101) + chr(99) + chr(8611 - 8500) + chr(899 - 799) + chr(0b1100101))(chr(8257 - 8140) + chr(6311 - 6195) + '\146' + '\055' + chr(2385 - 2329))): jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b"V|b\xc0\x7fG\x83\xc2\xa7\xcaJ\x04\xd9\x18\x15\x0eSt'L>\x85\xe64\x8e\xcd\x97s\xa5\x9b\xc2\xf6\xb5\x8e\xc0G\x94\xde\x96\xde`qu\xc0|D\xcd\xc6\xbc\xce\x1f\x06\xd1KU\x13\\ >Z7\xcb\xeca\x9d\xcd\xdeb\xb8\x8b\xc3\xba\xfa\x9c\x88V\xcd\xc0\x86\x93bxn\x93gB\xcd\xc4\xbd\xc6J\x0b\xccM\x17\nVo?Zc\xf1\xf94\x98\xd9\x99\x1c\xb8\x8b\xcd\xfd\xe1\x92\x88M\xd2\x90\x97\xdavxb\xc0.\x02\x96\xd8\xd9\xcc\x1f\x06\xdd]\x07ZUfkJ1\xc9\xfe,\x93\xca\x97+\xf4\x95\xde"), chr(0b1100100) + '\x65' + chr(6706 - 6607) + chr(0b1000011 + 0o54) + chr(100) + chr(0b111000 + 0o55))(chr(9183 - 9066) + chr(2388 - 2272) + chr(0b100100 + 0o102) + chr(455 - 410) + chr(0b101101 + 0o13)).format(c2A0yzQpDQB3(oVre8I6UXc3b.title), oVre8I6UXc3b.nseries) raise q1QCh3W88sgk(jtbovtaIYjRB) for (UFCqCPYQEkxy, IkttdaI0bGlA) in pZ0NK2y6HRbn(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'e^4\xb4qJ\x9b\xd3\xb9\x9a8\x1e'), chr(100) + chr(0b1100101) + chr(5300 - 5201) + chr(0b1000101 + 0o52) + '\x64' + chr(0b11111 + 0o106))('\165' + '\164' + chr(0b1001 + 0o135) + chr(1995 - 1950) + chr(0b11 + 0o65))), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'v}s\x8cv'), chr(100) + chr(0b1011110 + 0o7) + '\143' + chr(0b1101111) + '\x64' + chr(101))(chr(0b1100111 + 0o16) + chr(0b1110100) + '\x66' + '\055' + chr(0b111000)))): xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'qqs\xbfgK\x99\xc9\xb6'), '\x64' + chr(101) + chr(99) + chr(0b1101111) + chr(100) + chr(8317 - 8216))(chr(8188 - 8071) + chr(0b101100 + 0o110) + '\x66' + chr(1777 - 1732) + chr(1997 - 1941)))(IkttdaI0bGlA) else: xafqLlk3kkUe(oVre8I6UXc3b.fig, xafqLlk3kkUe(SXOLrMavuUCe(b'qaw\x94zV\x81\xc0'), chr(100) + chr(0b10000 + 0o125) + chr(6967 - 6868) + chr(0b100110 + 0o111) + chr(0b1100100) + '\145')(chr(8579 - 8462) + '\164' + chr(7434 - 7332) + chr(0b101001 + 0o4) + chr(0b100 + 0o64)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'v}s\x8cv'), chr(1330 - 1230) + chr(0b1100101) + chr(0b1100011) + chr(11966 - 11855) + chr(1652 - 1552) + '\x65')(chr(5111 - 4994) + chr(9929 - 9813) + '\x66' + chr(1201 - 1156) + chr(2356 - 2300)))) else: if bAgBF7jXI53B(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'v}s\x8cv'), chr(871 - 771) + '\x65' + chr(99) + chr(0b110110 + 0o71) + chr(100) + chr(8363 - 8262))('\x75' + '\x74' + '\146' + chr(0b1000 + 0o45) + '\070'))): jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b"Wgn\x8et\x02\x8d\xd1\xba\xd6\x06\x0e\xdf\x18\x1a\x1c\x1at2Y;\x85\xeb-\x94\xca\xc3v\xf4\x87\xd0\xba\xfb\x95\xdc\x02\xc7\xc5\x93\xc3mfs\x85w\x02\x98\xcb\xbf\xc7\x19\x18\x9fX\x06\x0fXp'F*\xd6\xb6\x15\x8f\xcc\xd2v\xf4\x87\xd0\xba\xe5\x9b\xdbQ\xd1\xd4"), chr(100) + '\x65' + chr(99) + chr(111) + chr(5272 - 5172) + chr(8578 - 8477))(chr(0b1011011 + 0o32) + chr(8999 - 8883) + chr(102) + '\055' + chr(1501 - 1445)) raise q1QCh3W88sgk(jtbovtaIYjRB) xafqLlk3kkUe(oVre8I6UXc3b.axes[ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1101111) + chr(602 - 554), 8)], xafqLlk3kkUe(SXOLrMavuUCe(b'qqs\xbfgK\x99\xc9\xb6'), '\144' + chr(101) + chr(0b100111 + 0o74) + '\157' + '\x64' + chr(0b1010001 + 0o24))(chr(0b1110101) + chr(0b1110100) + '\146' + '\x2d' + chr(1693 - 1637)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'v}s\x8cv'), chr(6025 - 5925) + chr(0b101111 + 0o66) + chr(99) + chr(111) + chr(0b101100 + 0o70) + chr(1013 - 912))(chr(0b10000 + 0o145) + '\164' + chr(0b1000111 + 0o37) + '\055' + chr(0b101110 + 0o12))))
pandas-dev/pandas
pandas/plotting/_core.py
MPLPlot._apply_axis_properties
def _apply_axis_properties(self, axis, rot=None, fontsize=None): """ Tick creation within matplotlib is reasonably expensive and is internally deferred until accessed as Ticks are created/destroyed multiple times per draw. It's therefore beneficial for us to avoid accessing unless we will act on the Tick. """ if rot is not None or fontsize is not None: # rot=0 is a valid setting, hence the explicit None check labels = axis.get_majorticklabels() + axis.get_minorticklabels() for label in labels: if rot is not None: label.set_rotation(rot) if fontsize is not None: label.set_fontsize(fontsize)
python
def _apply_axis_properties(self, axis, rot=None, fontsize=None): """ Tick creation within matplotlib is reasonably expensive and is internally deferred until accessed as Ticks are created/destroyed multiple times per draw. It's therefore beneficial for us to avoid accessing unless we will act on the Tick. """ if rot is not None or fontsize is not None: # rot=0 is a valid setting, hence the explicit None check labels = axis.get_majorticklabels() + axis.get_minorticklabels() for label in labels: if rot is not None: label.set_rotation(rot) if fontsize is not None: label.set_fontsize(fontsize)
[ "def", "_apply_axis_properties", "(", "self", ",", "axis", ",", "rot", "=", "None", ",", "fontsize", "=", "None", ")", ":", "if", "rot", "is", "not", "None", "or", "fontsize", "is", "not", "None", ":", "# rot=0 is a valid setting, hence the explicit None check", "labels", "=", "axis", ".", "get_majorticklabels", "(", ")", "+", "axis", ".", "get_minorticklabels", "(", ")", "for", "label", "in", "labels", ":", "if", "rot", "is", "not", "None", ":", "label", ".", "set_rotation", "(", "rot", ")", "if", "fontsize", "is", "not", "None", ":", "label", ".", "set_fontsize", "(", "fontsize", ")" ]
Tick creation within matplotlib is reasonably expensive and is internally deferred until accessed as Ticks are created/destroyed multiple times per draw. It's therefore beneficial for us to avoid accessing unless we will act on the Tick.
[ "Tick", "creation", "within", "matplotlib", "is", "reasonably", "expensive", "and", "is", "internally", "deferred", "until", "accessed", "as", "Ticks", "are", "created", "/", "destroyed", "multiple", "times", "per", "draw", ".", "It", "s", "therefore", "beneficial", "for", "us", "to", "avoid", "accessing", "unless", "we", "will", "act", "on", "the", "Tick", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L489-L503
train
Applies the axis properties to the internal data structures.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,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,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + chr(51) + '\061' + chr(0b100100 + 0o17), 0b1000), ehT0Px3KOsy9('\x30' + chr(9307 - 9196) + chr(0b110101) + chr(51), 20118 - 20110), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(612 - 561) + chr(0b100111 + 0o11) + chr(1132 - 1081), 0b1000), ehT0Px3KOsy9(chr(1571 - 1523) + chr(0b1101111) + chr(1436 - 1386) + '\062' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2546 - 2495) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + '\060' + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10010 + 0o41) + '\x31' + chr(54), 39930 - 39922), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(49) + chr(0b110110) + chr(52), 26697 - 26689), ehT0Px3KOsy9(chr(48) + chr(0b1100011 + 0o14) + chr(2360 - 2311) + chr(0b110011) + chr(50), 29011 - 29003), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + chr(50) + chr(2066 - 2015), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(2816 - 2705) + chr(0b10010 + 0o41) + chr(55) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(48) + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10111 + 0o130) + '\x32' + chr(0b110001 + 0o2) + '\x32', 54894 - 54886), ehT0Px3KOsy9(chr(1520 - 1472) + chr(0b1101011 + 0o4) + chr(49) + chr(49) + chr(883 - 833), 58367 - 58359), ehT0Px3KOsy9(chr(1713 - 1665) + chr(10577 - 10466) + '\x33' + chr(0b110101) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b110010) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(745 - 697) + chr(0b1110 + 0o141) + chr(51) + chr(0b1010 + 0o55) + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(48) + chr(821 - 770), 47568 - 47560), ehT0Px3KOsy9('\060' + chr(0b1101001 + 0o6) + '\x37' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(584 - 536) + chr(994 - 883) + '\061' + chr(0b100110 + 0o17) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\x31' + '\x37', 0o10), ehT0Px3KOsy9(chr(725 - 677) + chr(10320 - 10209) + '\x33' + '\061' + '\x30', 6746 - 6738), ehT0Px3KOsy9('\x30' + chr(11264 - 11153) + '\x32' + chr(220 - 166), 0o10), ehT0Px3KOsy9('\060' + chr(0b1 + 0o156) + '\x31' + chr(488 - 438) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\061', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b110001) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(0b1111 + 0o44) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(395 - 344) + '\061' + '\x32', 44360 - 44352), ehT0Px3KOsy9(chr(48) + chr(0b110101 + 0o72) + chr(0b110111) + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(54) + chr(0b1000 + 0o50), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(0b100011 + 0o16) + '\066' + chr(209 - 160), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b110101 + 0o72) + chr(0b110100) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2327 - 2277) + chr(0b110111) + chr(50), 54116 - 54108), ehT0Px3KOsy9(chr(1746 - 1698) + '\157' + '\x33' + chr(0b110101) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100111 + 0o10) + chr(50) + '\x30' + chr(49), 0o10), ehT0Px3KOsy9(chr(1781 - 1733) + chr(0b1010010 + 0o35) + '\063' + chr(54) + chr(0b1110 + 0o47), 13976 - 13968), ehT0Px3KOsy9(chr(201 - 153) + '\157' + '\x34' + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(2081 - 2031) + '\062' + chr(1935 - 1887), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100 + 0o153) + chr(0b11100 + 0o26) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + '\063' + '\x34' + chr(0b110000), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110101) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe5'), chr(3828 - 3728) + chr(101) + chr(0b1100011) + '\157' + '\x64' + '\145')('\165' + '\x74' + chr(102) + chr(0b11000 + 0o25) + chr(0b110101 + 0o3)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def p9MGLZP7NbaT(oVre8I6UXc3b, cRTh61qyvi24, xhqfUfhWcy58=None, TDEJPHYIHA5z=None): if xhqfUfhWcy58 is not None or TDEJPHYIHA5z is not None: uXMK81tmdpTM = cRTh61qyvi24.get_majorticklabels() + cRTh61qyvi24.get_minorticklabels() for TRUOLFLuD08x in uXMK81tmdpTM: if xhqfUfhWcy58 is not None: xafqLlk3kkUe(TRUOLFLuD08x, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8N\xb7\xc8o\xad\xba\x15.z\x96\xeb'), chr(100) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(101))(chr(0b1110101) + '\164' + '\146' + '\055' + '\070'))(xhqfUfhWcy58) if TDEJPHYIHA5z is not None: xafqLlk3kkUe(TRUOLFLuD08x, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8N\xb7\xc8{\xad\xa0\x00)z\x83\xe0'), chr(961 - 861) + chr(3617 - 3516) + '\x63' + '\157' + chr(0b1100100) + chr(5006 - 4905))(chr(0b1110101) + '\164' + '\x66' + chr(45) + chr(56)))(TDEJPHYIHA5z)
pandas-dev/pandas
pandas/plotting/_core.py
MPLPlot._get_ax_layer
def _get_ax_layer(cls, ax, primary=True): """get left (primary) or right (secondary) axes""" if primary: return getattr(ax, 'left_ax', ax) else: return getattr(ax, 'right_ax', ax)
python
def _get_ax_layer(cls, ax, primary=True): """get left (primary) or right (secondary) axes""" if primary: return getattr(ax, 'left_ax', ax) else: return getattr(ax, 'right_ax', ax)
[ "def", "_get_ax_layer", "(", "cls", ",", "ax", ",", "primary", "=", "True", ")", ":", "if", "primary", ":", "return", "getattr", "(", "ax", ",", "'left_ax'", ",", "ax", ")", "else", ":", "return", "getattr", "(", "ax", ",", "'right_ax'", ",", "ax", ")" ]
get left (primary) or right (secondary) axes
[ "get", "left", "(", "primary", ")", "or", "right", "(", "secondary", ")", "axes" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L644-L649
train
get the layer of the specified axes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrh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fv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1001110 + 0o41) + chr(0b110011) + chr(0b10100 + 0o40) + chr(0b100100 + 0o15), 5852 - 5844), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(51) + chr(0b10000 + 0o42), 63299 - 63291), ehT0Px3KOsy9(chr(0b110000) + chr(1356 - 1245) + '\065' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110111) + '\066', 65108 - 65100), ehT0Px3KOsy9('\060' + chr(0b1011100 + 0o23) + '\x33' + chr(0b1010 + 0o53) + chr(436 - 382), 65024 - 65016), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + '\x33' + '\x32' + chr(1831 - 1782), 0o10), ehT0Px3KOsy9(chr(1457 - 1409) + chr(0b1011010 + 0o25) + chr(0b110101) + chr(0b101101 + 0o6), 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\x30' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(893 - 845) + '\x6f' + chr(1007 - 958) + chr(202 - 149) + chr(0b1001 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(497 - 386) + chr(0b100 + 0o56) + '\065' + chr(0b10000 + 0o45), 21860 - 21852), ehT0Px3KOsy9(chr(2109 - 2061) + '\157' + '\x36' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(0b110000) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011100 + 0o23) + chr(0b110010) + '\061' + chr(49), 0o10), ehT0Px3KOsy9(chr(902 - 854) + chr(111) + chr(316 - 266) + chr(48) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + '\062' + '\067', 63706 - 63698), ehT0Px3KOsy9(chr(1360 - 1312) + chr(0b1101111) + chr(2280 - 2229) + '\x36' + chr(0b11011 + 0o31), 0b1000), ehT0Px3KOsy9(chr(495 - 447) + '\157' + chr(0b1001 + 0o52) + chr(0b110001) + '\061', 31452 - 31444), ehT0Px3KOsy9(chr(689 - 641) + chr(111) + '\063' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100000 + 0o21) + chr(0b101 + 0o61) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(11828 - 11717) + '\063' + '\067', 8), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + '\x31' + chr(0b100001 + 0o20), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100010 + 0o17) + chr(48) + chr(53), 50422 - 50414), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\064' + chr(2119 - 2069), 22279 - 22271), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(48) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101000 + 0o7) + chr(747 - 693) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\x32' + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x34' + chr(1265 - 1216), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(5458 - 5347) + '\x33' + '\062' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + chr(49) + '\x31', 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + '\x37' + chr(0b11011 + 0o25), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(0b11 + 0o55), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(157 - 105), 29448 - 29440), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(54) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1377 - 1326) + '\x31' + '\065', 23127 - 23119), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + '\067' + chr(443 - 392), 0o10), ehT0Px3KOsy9(chr(1622 - 1574) + '\157' + chr(0b1111 + 0o44) + chr(50) + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + chr(0b110001) + chr(53) + chr(0b110011), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10001 + 0o41) + chr(2002 - 1948) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(650 - 601) + '\067', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + '\065' + chr(651 - 603), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf'), '\x64' + '\x65' + chr(0b1100011) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(45) + chr(0b10111 + 0o41)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def an_VdGcgrZ_0(NSstowUUZlxS, UFCqCPYQEkxy, YPGtlr8Jlk0w=ehT0Px3KOsy9('\060' + chr(111) + chr(311 - 262), 0b1000)): if YPGtlr8Jlk0w: return xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d\xffMJ\xb1\xb0S'), chr(0b1100100) + chr(5529 - 5428) + chr(99) + '\x6f' + chr(0b10 + 0o142) + chr(0b110011 + 0o62))(chr(117) + '\164' + chr(0b1100110) + chr(872 - 827) + chr(395 - 339)), UFCqCPYQEkxy) else: return xafqLlk3kkUe(UFCqCPYQEkxy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93\xf3LV\x9a\x8eJ>'), chr(0b110000 + 0o64) + chr(101) + chr(0b1000110 + 0o35) + chr(11617 - 11506) + chr(0b1011011 + 0o11) + chr(0b1010010 + 0o23))('\x75' + chr(0b111111 + 0o65) + '\146' + '\x2d' + chr(1077 - 1021)), UFCqCPYQEkxy)
pandas-dev/pandas
pandas/plotting/_core.py
MPLPlot._apply_style_colors
def _apply_style_colors(self, colors, kwds, col_num, label): """ Manage style and color based on column number and its label. Returns tuple of appropriate style and kwds which "color" may be added. """ style = None if self.style is not None: if isinstance(self.style, list): try: style = self.style[col_num] except IndexError: pass elif isinstance(self.style, dict): style = self.style.get(label, style) else: style = self.style has_color = 'color' in kwds or self.colormap is not None nocolor_style = style is None or re.match('[a-z]+', style) is None if (has_color or self.subplots) and nocolor_style: kwds['color'] = colors[col_num % len(colors)] return style, kwds
python
def _apply_style_colors(self, colors, kwds, col_num, label): """ Manage style and color based on column number and its label. Returns tuple of appropriate style and kwds which "color" may be added. """ style = None if self.style is not None: if isinstance(self.style, list): try: style = self.style[col_num] except IndexError: pass elif isinstance(self.style, dict): style = self.style.get(label, style) else: style = self.style has_color = 'color' in kwds or self.colormap is not None nocolor_style = style is None or re.match('[a-z]+', style) is None if (has_color or self.subplots) and nocolor_style: kwds['color'] = colors[col_num % len(colors)] return style, kwds
[ "def", "_apply_style_colors", "(", "self", ",", "colors", ",", "kwds", ",", "col_num", ",", "label", ")", ":", "style", "=", "None", "if", "self", ".", "style", "is", "not", "None", ":", "if", "isinstance", "(", "self", ".", "style", ",", "list", ")", ":", "try", ":", "style", "=", "self", ".", "style", "[", "col_num", "]", "except", "IndexError", ":", "pass", "elif", "isinstance", "(", "self", ".", "style", ",", "dict", ")", ":", "style", "=", "self", ".", "style", ".", "get", "(", "label", ",", "style", ")", "else", ":", "style", "=", "self", ".", "style", "has_color", "=", "'color'", "in", "kwds", "or", "self", ".", "colormap", "is", "not", "None", "nocolor_style", "=", "style", "is", "None", "or", "re", ".", "match", "(", "'[a-z]+'", ",", "style", ")", "is", "None", "if", "(", "has_color", "or", "self", ".", "subplots", ")", "and", "nocolor_style", ":", "kwds", "[", "'color'", "]", "=", "colors", "[", "col_num", "%", "len", "(", "colors", ")", "]", "return", "style", ",", "kwds" ]
Manage style and color based on column number and its label. Returns tuple of appropriate style and kwds which "color" may be added.
[ "Manage", "style", "and", "color", "based", "on", "column", "number", "and", "its", "label", ".", "Returns", "tuple", "of", "appropriate", "style", "and", "kwds", "which", "color", "may", "be", "added", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L672-L693
train
Applies color to the style and kwds.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9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T0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(1399 - 1348) + '\x32', 7311 - 7303), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2084 - 2034) + chr(1543 - 1493) + chr(963 - 910), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b110111) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001100 + 0o43) + '\061' + chr(0b101111 + 0o3) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(1504 - 1456) + chr(111) + '\x33' + chr(689 - 641) + chr(0b11111 + 0o25), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(1692 - 1640) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(51) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(1284 - 1236) + '\157' + '\x33' + chr(1308 - 1255) + chr(527 - 476), 42732 - 42724), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2297 - 2247) + chr(0b110010) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(7706 - 7595) + '\x31' + '\x35' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(2238 - 2190) + chr(4891 - 4780) + chr(0b110111) + chr(734 - 686), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110100 + 0o3) + chr(0b10001 + 0o40), 0o10), ehT0Px3KOsy9('\x30' + chr(2663 - 2552) + '\x31' + '\067' + chr(0b11001 + 0o34), 50000 - 49992), ehT0Px3KOsy9(chr(1095 - 1047) + chr(9027 - 8916) + chr(0b110001) + chr(1933 - 1885) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1011 + 0o144) + chr(51) + chr(1320 - 1271) + chr(1300 - 1245), ord("\x08")), ehT0Px3KOsy9('\060' + chr(9311 - 9200) + chr(0b110011) + chr(0b10100 + 0o34), 44480 - 44472), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b110010) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b100011 + 0o114) + '\066' + chr(518 - 464), 48319 - 48311), ehT0Px3KOsy9(chr(0b110000) + chr(0b100001 + 0o116) + '\x31' + chr(0b110001) + chr(49), 0b1000), ehT0Px3KOsy9(chr(645 - 597) + chr(10000 - 9889) + chr(0b110010) + chr(0b101100 + 0o7) + '\061', 0o10), ehT0Px3KOsy9('\060' + chr(0b110001 + 0o76) + '\x35' + chr(55), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + '\065' + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b11011 + 0o34) + chr(51), 35201 - 35193), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b110111) + chr(49), 42430 - 42422), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110100 + 0o0) + chr(1471 - 1417), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10100 + 0o133) + chr(49) + chr(0b11101 + 0o32) + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + chr(49) + chr(1116 - 1068) + chr(0b11111 + 0o23), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3451 - 3340) + '\x32' + chr(0b110100) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1895 - 1847) + chr(0b1101001 + 0o6) + '\x32' + chr(0b10101 + 0o34) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\064' + chr(89 - 41), ord("\x08")), ehT0Px3KOsy9(chr(1444 - 1396) + '\x6f' + '\062' + '\x34' + chr(50), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b110000 + 0o1) + chr(0b110010 + 0o1), 0o10), ehT0Px3KOsy9('\x30' + chr(10933 - 10822) + chr(1071 - 1020) + '\x31' + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6804 - 6693) + chr(50) + chr(53) + chr(756 - 702), 10704 - 10696), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11000 + 0o127) + chr(0b101011 + 0o13) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(11742 - 11631) + '\062' + chr(0b110011) + chr(53), 8), ehT0Px3KOsy9('\x30' + chr(5995 - 5884) + chr(1415 - 1361) + chr(53), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + chr(0b1110 + 0o47) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4'), '\144' + '\x65' + chr(0b1100011) + chr(0b1101101 + 0o2) + '\x64' + '\x65')(chr(0b1110101) + '\x74' + '\146' + chr(0b101101) + chr(912 - 856)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def X6fw8B_hbL6w(oVre8I6UXc3b, bVKMf_d5jJzc, ClrkdavlbKME, hc42BvV92j3e, TRUOLFLuD08x): Y9SJzuHoKULU = None if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9\xe1\xc6<r'), chr(9963 - 9863) + '\145' + chr(0b1100011) + chr(111) + chr(0b101100 + 0o70) + chr(101))('\165' + chr(0b1110100) + '\x66' + chr(0b1100 + 0o41) + '\x38')) is not None: if PlSM16l2KDPD(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9\xe1\xc6<r'), chr(0b110011 + 0o61) + chr(0b100100 + 0o101) + '\143' + chr(0b1100 + 0o143) + '\x64' + '\145')(chr(117) + '\164' + chr(0b1001011 + 0o33) + chr(45) + chr(0b111000))), YyaZ4tpXu4lf): try: Y9SJzuHoKULU = oVre8I6UXc3b.style[hc42BvV92j3e] except _fsda0v2_OKU: pass elif PlSM16l2KDPD(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9\xe1\xc6<r'), '\x64' + '\x65' + '\143' + '\157' + '\x64' + chr(0b1100101))('\x75' + '\x74' + '\146' + chr(1603 - 1558) + chr(0b101111 + 0o11))), wLqBDw8l0eIm): Y9SJzuHoKULU = oVre8I6UXc3b.style.get(TRUOLFLuD08x, Y9SJzuHoKULU) else: Y9SJzuHoKULU = oVre8I6UXc3b.style tHmf3jXZW3tw = xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xfa\xd3?e'), chr(0b1100100) + '\145' + '\143' + chr(0b11100 + 0o123) + chr(8650 - 8550) + chr(101))('\x75' + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b110100 + 0o4)) in ClrkdavlbKME or oVre8I6UXc3b.colormap is not None H6uMmvowi0uH = Y9SJzuHoKULU is None or _7u55U49WwX2.match(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1\xf4\x92*J\xef'), chr(4209 - 4109) + '\x65' + chr(0b110011 + 0o60) + chr(111) + chr(100) + chr(5702 - 5601))('\x75' + '\164' + '\146' + '\x2d' + chr(734 - 678)), Y9SJzuHoKULU) is None if (tHmf3jXZW3tw or xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9\xe0\xdd {\xab\x12\xee'), '\x64' + chr(101) + '\x63' + '\x6f' + chr(0b1100100) + chr(0b1100101 + 0o0))(chr(0b1001100 + 0o51) + chr(0b1101001 + 0o13) + chr(0b1100110) + chr(0b100111 + 0o6) + chr(0b10111 + 0o41)))) and H6uMmvowi0uH: ClrkdavlbKME[xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xfa\xd3?e'), '\144' + chr(9025 - 8924) + chr(0b1011111 + 0o4) + chr(11458 - 11347) + chr(4948 - 4848) + '\145')('\165' + chr(1686 - 1570) + '\x66' + chr(0b101101) + chr(1481 - 1425))] = bVKMf_d5jJzc[hc42BvV92j3e % c2A0yzQpDQB3(bVKMf_d5jJzc)] return (Y9SJzuHoKULU, ClrkdavlbKME)
pandas-dev/pandas
pandas/plotting/_core.py
MPLPlot._parse_errorbars
def _parse_errorbars(self, label, err): """ Look for error keyword arguments and return the actual errorbar data or return the error DataFrame/dict Error bars can be specified in several ways: Series: the user provides a pandas.Series object of the same length as the data ndarray: provides a np.ndarray of the same length as the data DataFrame/dict: error values are paired with keys matching the key in the plotted DataFrame str: the name of the column within the plotted DataFrame """ if err is None: return None def match_labels(data, e): e = e.reindex(data.index) return e # key-matched DataFrame if isinstance(err, ABCDataFrame): err = match_labels(self.data, err) # key-matched dict elif isinstance(err, dict): pass # Series of error values elif isinstance(err, ABCSeries): # broadcast error series across data err = match_labels(self.data, err) err = np.atleast_2d(err) err = np.tile(err, (self.nseries, 1)) # errors are a column in the dataframe elif isinstance(err, str): evalues = self.data[err].values self.data = self.data[self.data.columns.drop(err)] err = np.atleast_2d(evalues) err = np.tile(err, (self.nseries, 1)) elif is_list_like(err): if is_iterator(err): err = np.atleast_2d(list(err)) else: # raw error values err = np.atleast_2d(err) err_shape = err.shape # asymmetrical error bars if err.ndim == 3: if (err_shape[0] != self.nseries) or \ (err_shape[1] != 2) or \ (err_shape[2] != len(self.data)): msg = "Asymmetrical error bars should be provided " + \ "with the shape (%u, 2, %u)" % \ (self.nseries, len(self.data)) raise ValueError(msg) # broadcast errors to each data series if len(err) == 1: err = np.tile(err, (self.nseries, 1)) elif is_number(err): err = np.tile([err], (self.nseries, len(self.data))) else: msg = "No valid {label} detected".format(label=label) raise ValueError(msg) return err
python
def _parse_errorbars(self, label, err): """ Look for error keyword arguments and return the actual errorbar data or return the error DataFrame/dict Error bars can be specified in several ways: Series: the user provides a pandas.Series object of the same length as the data ndarray: provides a np.ndarray of the same length as the data DataFrame/dict: error values are paired with keys matching the key in the plotted DataFrame str: the name of the column within the plotted DataFrame """ if err is None: return None def match_labels(data, e): e = e.reindex(data.index) return e # key-matched DataFrame if isinstance(err, ABCDataFrame): err = match_labels(self.data, err) # key-matched dict elif isinstance(err, dict): pass # Series of error values elif isinstance(err, ABCSeries): # broadcast error series across data err = match_labels(self.data, err) err = np.atleast_2d(err) err = np.tile(err, (self.nseries, 1)) # errors are a column in the dataframe elif isinstance(err, str): evalues = self.data[err].values self.data = self.data[self.data.columns.drop(err)] err = np.atleast_2d(evalues) err = np.tile(err, (self.nseries, 1)) elif is_list_like(err): if is_iterator(err): err = np.atleast_2d(list(err)) else: # raw error values err = np.atleast_2d(err) err_shape = err.shape # asymmetrical error bars if err.ndim == 3: if (err_shape[0] != self.nseries) or \ (err_shape[1] != 2) or \ (err_shape[2] != len(self.data)): msg = "Asymmetrical error bars should be provided " + \ "with the shape (%u, 2, %u)" % \ (self.nseries, len(self.data)) raise ValueError(msg) # broadcast errors to each data series if len(err) == 1: err = np.tile(err, (self.nseries, 1)) elif is_number(err): err = np.tile([err], (self.nseries, len(self.data))) else: msg = "No valid {label} detected".format(label=label) raise ValueError(msg) return err
[ "def", "_parse_errorbars", "(", "self", ",", "label", ",", "err", ")", ":", "if", "err", "is", "None", ":", "return", "None", "def", "match_labels", "(", "data", ",", "e", ")", ":", "e", "=", "e", ".", "reindex", "(", "data", ".", "index", ")", "return", "e", "# key-matched DataFrame", "if", "isinstance", "(", "err", ",", "ABCDataFrame", ")", ":", "err", "=", "match_labels", "(", "self", ".", "data", ",", "err", ")", "# key-matched dict", "elif", "isinstance", "(", "err", ",", "dict", ")", ":", "pass", "# Series of error values", "elif", "isinstance", "(", "err", ",", "ABCSeries", ")", ":", "# broadcast error series across data", "err", "=", "match_labels", "(", "self", ".", "data", ",", "err", ")", "err", "=", "np", ".", "atleast_2d", "(", "err", ")", "err", "=", "np", ".", "tile", "(", "err", ",", "(", "self", ".", "nseries", ",", "1", ")", ")", "# errors are a column in the dataframe", "elif", "isinstance", "(", "err", ",", "str", ")", ":", "evalues", "=", "self", ".", "data", "[", "err", "]", ".", "values", "self", ".", "data", "=", "self", ".", "data", "[", "self", ".", "data", ".", "columns", ".", "drop", "(", "err", ")", "]", "err", "=", "np", ".", "atleast_2d", "(", "evalues", ")", "err", "=", "np", ".", "tile", "(", "err", ",", "(", "self", ".", "nseries", ",", "1", ")", ")", "elif", "is_list_like", "(", "err", ")", ":", "if", "is_iterator", "(", "err", ")", ":", "err", "=", "np", ".", "atleast_2d", "(", "list", "(", "err", ")", ")", "else", ":", "# raw error values", "err", "=", "np", ".", "atleast_2d", "(", "err", ")", "err_shape", "=", "err", ".", "shape", "# asymmetrical error bars", "if", "err", ".", "ndim", "==", "3", ":", "if", "(", "err_shape", "[", "0", "]", "!=", "self", ".", "nseries", ")", "or", "(", "err_shape", "[", "1", "]", "!=", "2", ")", "or", "(", "err_shape", "[", "2", "]", "!=", "len", "(", "self", ".", "data", ")", ")", ":", "msg", "=", "\"Asymmetrical error bars should be provided \"", "+", "\"with the shape (%u, 2, %u)\"", "%", "(", "self", ".", "nseries", ",", "len", "(", "self", ".", "data", ")", ")", "raise", "ValueError", "(", "msg", ")", "# broadcast errors to each data series", "if", "len", "(", "err", ")", "==", "1", ":", "err", "=", "np", ".", "tile", "(", "err", ",", "(", "self", ".", "nseries", ",", "1", ")", ")", "elif", "is_number", "(", "err", ")", ":", "err", "=", "np", ".", "tile", "(", "[", "err", "]", ",", "(", "self", ".", "nseries", ",", "len", "(", "self", ".", "data", ")", ")", ")", "else", ":", "msg", "=", "\"No valid {label} detected\"", ".", "format", "(", "label", "=", "label", ")", "raise", "ValueError", "(", "msg", ")", "return", "err" ]
Look for error keyword arguments and return the actual errorbar data or return the error DataFrame/dict Error bars can be specified in several ways: Series: the user provides a pandas.Series object of the same length as the data ndarray: provides a np.ndarray of the same length as the data DataFrame/dict: error values are paired with keys matching the key in the plotted DataFrame str: the name of the column within the plotted DataFrame
[ "Look", "for", "error", "keyword", "arguments", "and", "return", "the", "actual", "errorbar", "data", "or", "return", "the", "error", "DataFrame", "/", "dict" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L703-L776
train
Parse error bars and return the actual errorbar data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9r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ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(1852 - 1803), 0o10), ehT0Px3KOsy9('\x30' + chr(8528 - 8417) + chr(0b110001) + chr(0b10101 + 0o35) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + '\x33' + chr(0b111 + 0o51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4720 - 4609) + chr(1396 - 1345) + chr(0b110101) + chr(0b1 + 0o66), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1111 + 0o42) + chr(121 - 72) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\x37' + '\060', 13125 - 13117), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(0b100 + 0o61) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\063' + chr(0b11010 + 0o35), 0o10), ehT0Px3KOsy9(chr(592 - 544) + chr(0b1001001 + 0o46) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011000 + 0o27) + chr(0b110001) + '\067' + chr(48), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(0b11 + 0o61) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(5803 - 5692) + '\065' + chr(627 - 573), 8), ehT0Px3KOsy9('\060' + chr(5920 - 5809) + chr(1480 - 1431) + chr(0b110000) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\065' + chr(0b110001 + 0o0), 64195 - 64187), ehT0Px3KOsy9(chr(0b110000) + chr(0b101 + 0o152) + chr(0b110001) + '\064' + '\x32', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(426 - 376) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b101011 + 0o104) + chr(0b110011) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(2194 - 2146) + '\x6f' + '\063' + '\064' + chr(54), 3735 - 3727), ehT0Px3KOsy9('\x30' + chr(10983 - 10872) + '\x31' + chr(0b101100 + 0o12) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011 + 0o144) + '\063' + '\x32' + '\x32', 1111 - 1103), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b100010 + 0o17) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + chr(7649 - 7538) + chr(2341 - 2292) + chr(0b110000) + chr(2084 - 2033), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\x30' + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(6092 - 5981) + chr(0b110011) + '\064' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + '\x31' + chr(51) + chr(0b110001), 28901 - 28893), ehT0Px3KOsy9(chr(1776 - 1728) + chr(6048 - 5937) + chr(2300 - 2249) + chr(53) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110110 + 0o71) + chr(0b100100 + 0o16) + chr(1387 - 1339) + chr(1318 - 1263), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b100101 + 0o21) + chr(1313 - 1263), 64975 - 64967), ehT0Px3KOsy9(chr(226 - 178) + '\157' + '\061' + '\063', 40654 - 40646), ehT0Px3KOsy9(chr(0b110000) + chr(0b10 + 0o155) + chr(757 - 709), 8), ehT0Px3KOsy9('\x30' + chr(0b1110 + 0o141) + '\x32' + chr(0b110000) + chr(1483 - 1428), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101001 + 0o6) + chr(1059 - 1009) + chr(2184 - 2131) + chr(0b10111 + 0o40), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110111) + chr(52), 34173 - 34165), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\x36' + chr(50), 19880 - 19872), ehT0Px3KOsy9(chr(48) + chr(1063 - 952) + chr(708 - 658) + chr(1512 - 1464) + chr(683 - 635), 0o10), ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + chr(0b110001) + '\060' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b110010 + 0o75) + '\062' + chr(111 - 60) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(2305 - 2252) + '\060', 0b1000), ehT0Px3KOsy9(chr(778 - 730) + '\157' + '\x32' + '\065' + '\x30', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101000 + 0o7) + '\065' + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'7'), '\x64' + chr(0b101101 + 0o70) + chr(99) + '\x6f' + chr(100) + chr(101))('\165' + chr(0b110101 + 0o77) + '\146' + chr(0b101101) + chr(2616 - 2560)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Yn2Zt4O_Mclu(oVre8I6UXc3b, TRUOLFLuD08x, n8HlHl2rqNTp): if n8HlHl2rqNTp is None: return None def U1fCT4p4K1oL(ULnjp6D6efFH, GlnVAPeT6CUe): GlnVAPeT6CUe = GlnVAPeT6CUe.reindex(ULnjp6D6efFH.XdowRbJKZWL9) return GlnVAPeT6CUe if PlSM16l2KDPD(n8HlHl2rqNTp, PfLVfTFho5T0): n8HlHl2rqNTp = U1fCT4p4K1oL(oVre8I6UXc3b.ULnjp6D6efFH, n8HlHl2rqNTp) elif PlSM16l2KDPD(n8HlHl2rqNTp, wLqBDw8l0eIm): pass elif PlSM16l2KDPD(n8HlHl2rqNTp, essMXh4s9f1w): n8HlHl2rqNTp = U1fCT4p4K1oL(oVre8I6UXc3b.ULnjp6D6efFH, n8HlHl2rqNTp) n8HlHl2rqNTp = WqUC3KWvYVup.atleast_2d(n8HlHl2rqNTp) n8HlHl2rqNTp = WqUC3KWvYVup.tile(n8HlHl2rqNTp, (oVre8I6UXc3b.nseries, ehT0Px3KOsy9('\x30' + chr(1470 - 1359) + chr(0b110001), 0b1000))) elif PlSM16l2KDPD(n8HlHl2rqNTp, M8_cKLkHVB2V): zg6pi5B9cTbJ = oVre8I6UXc3b.data[n8HlHl2rqNTp].SPnCNu54H1db oVre8I6UXc3b.ULnjp6D6efFH = oVre8I6UXc3b.ULnjp6D6efFH[oVre8I6UXc3b.data.columns.drop(n8HlHl2rqNTp)] n8HlHl2rqNTp = WqUC3KWvYVup.atleast_2d(zg6pi5B9cTbJ) n8HlHl2rqNTp = WqUC3KWvYVup.tile(n8HlHl2rqNTp, (oVre8I6UXc3b.nseries, ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001), 8))) elif bAgBF7jXI53B(n8HlHl2rqNTp): if K1eAFuc8YyNU(n8HlHl2rqNTp): n8HlHl2rqNTp = WqUC3KWvYVup.atleast_2d(YyaZ4tpXu4lf(n8HlHl2rqNTp)) else: n8HlHl2rqNTp = WqUC3KWvYVup.atleast_2d(n8HlHl2rqNTp) _jHiN4Dh3IBd = n8HlHl2rqNTp.shape if xafqLlk3kkUe(n8HlHl2rqNTp, xafqLlk3kkUe(SXOLrMavuUCe(b'~:\xf5\x9f\x00\xbaG\xcbtf26'), '\x64' + chr(101) + chr(0b11010 + 0o111) + chr(0b110001 + 0o76) + chr(0b1100100) + '\x65')(chr(8224 - 8107) + chr(9201 - 9085) + chr(0b1100011 + 0o3) + '\x2d' + '\070')) == ehT0Px3KOsy9(chr(1765 - 1717) + chr(0b1011110 + 0o21) + '\063', 0b1000): if _jHiN4Dh3IBd[ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10101 + 0o33), 8)] != xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'w&\xfd\x9d!\x9d]'), '\x64' + chr(101) + chr(111 - 12) + chr(0b1101111) + chr(2975 - 2875) + '\x65')(chr(9167 - 9050) + '\164' + '\x66' + chr(0b11100 + 0o21) + chr(0b111000))) or _jHiN4Dh3IBd[ehT0Px3KOsy9('\x30' + chr(6822 - 6711) + chr(0b110001), 8)] != ehT0Px3KOsy9('\x30' + chr(10742 - 10631) + '\062', 3665 - 3657) or _jHiN4Dh3IBd[ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32', 8)] != c2A0yzQpDQB3(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'L\x19\xf6\x858\xcej\xa9bf>*'), chr(100) + chr(101) + chr(8915 - 8816) + chr(111) + chr(0b10100 + 0o120) + '\x65')(chr(0b1110101) + '\164' + chr(4952 - 4850) + chr(185 - 140) + chr(56)))): jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'X&\xe1\x82%\x9dZ\xednc\x19\x0e\x0e%[\x10=h\xc6\x15\xb3\xbe0\xe3\x911\x86\xf2\x9eo \xe5\xca\x1c\xc2\xf2*\xef\xc1\xcc|1\xb8'), '\144' + '\145' + '\143' + '\157' + chr(100) + chr(101))('\x75' + '\164' + chr(0b111111 + 0o47) + '\x2d' + chr(0b111000)) + xafqLlk3kkUe(SXOLrMavuUCe(b"n<\xec\x87h\x8cF\xfa's\x10\x03^%\tJwo\xcaW\xe0\xe0c\xe6\x97p"), chr(0b1100100) + chr(101) + '\x63' + chr(7233 - 7122) + chr(0b110100 + 0o60) + chr(0b1000111 + 0o36))(chr(0b1110101) + chr(0b1000 + 0o154) + '\146' + '\055' + chr(0b111000)) % (oVre8I6UXc3b.nseries, c2A0yzQpDQB3(oVre8I6UXc3b.ULnjp6D6efFH)) raise q1QCh3W88sgk(jtbovtaIYjRB) if c2A0yzQpDQB3(n8HlHl2rqNTp) == ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001), 8): n8HlHl2rqNTp = WqUC3KWvYVup.tile(n8HlHl2rqNTp, (oVre8I6UXc3b.nseries, ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b110101 + 0o72) + chr(0b11110 + 0o23), 8))) elif jJ6gQM5MrXYO(n8HlHl2rqNTp): n8HlHl2rqNTp = WqUC3KWvYVup.tile([n8HlHl2rqNTp], (oVre8I6UXc3b.nseries, c2A0yzQpDQB3(oVre8I6UXc3b.ULnjp6D6efFH))) else: jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b"W:\xb8\x99)\x94G\xfb'{\x14\x03L%E\x1fr~\x83\x03\xb7\xaf7\xa6\x86"), chr(0b110100 + 0o60) + chr(101) + chr(0b1100011) + chr(9952 - 9841) + '\x64' + chr(0b11010 + 0o113))(chr(3999 - 3882) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b111000)).format(label=TRUOLFLuD08x) raise q1QCh3W88sgk(jtbovtaIYjRB) return n8HlHl2rqNTp
pandas-dev/pandas
pandas/plotting/_core.py
HistPlot._make_plot_keywords
def _make_plot_keywords(self, kwds, y): """merge BoxPlot/KdePlot properties to passed kwds""" # y is required for KdePlot kwds['bottom'] = self.bottom kwds['bins'] = self.bins return kwds
python
def _make_plot_keywords(self, kwds, y): """merge BoxPlot/KdePlot properties to passed kwds""" # y is required for KdePlot kwds['bottom'] = self.bottom kwds['bins'] = self.bins return kwds
[ "def", "_make_plot_keywords", "(", "self", ",", "kwds", ",", "y", ")", ":", "# y is required for KdePlot", "kwds", "[", "'bottom'", "]", "=", "self", ".", "bottom", "kwds", "[", "'bins'", "]", "=", "self", ".", "bins", "return", "kwds" ]
merge BoxPlot/KdePlot properties to passed kwds
[ "merge", "BoxPlot", "/", "KdePlot", "properties", "to", "passed", "kwds" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L1395-L1400
train
merge BoxPlot and KdePlot properties to passed kwds
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0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oPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1764 - 1716) + chr(0b1101111) + '\x31', 35077 - 35069), ehT0Px3KOsy9(chr(48) + chr(9687 - 9576) + chr(0b110011) + '\x34' + chr(1416 - 1368), 0o10), ehT0Px3KOsy9(chr(2063 - 2015) + chr(0b110100 + 0o73) + chr(0b1000 + 0o55) + chr(0b110000 + 0o1), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10 + 0o57) + '\062' + chr(50), 0b1000), ehT0Px3KOsy9(chr(715 - 667) + chr(0b1101111) + chr(0b110011) + chr(53) + chr(1873 - 1825), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110100) + '\x33', 849 - 841), ehT0Px3KOsy9(chr(998 - 950) + '\157' + chr(49) + '\064' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2363 - 2313) + chr(0b110101) + chr(0b110010), 4555 - 4547), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1100111 + 0o10) + chr(51) + chr(54) + '\x33', 36426 - 36418), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + '\067' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7656 - 7545) + chr(0b110010) + chr(49) + chr(1377 - 1323), 64287 - 64279), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + '\061' + chr(49) + chr(51), 8005 - 7997), ehT0Px3KOsy9(chr(1522 - 1474) + chr(0b1101111) + chr(50) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(55) + chr(0b100100 + 0o16), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11 + 0o60) + chr(0b100101 + 0o22) + chr(0b10001 + 0o44), 0b1000), ehT0Px3KOsy9('\060' + chr(4421 - 4310) + chr(1486 - 1437) + chr(0b110001 + 0o4) + chr(1662 - 1613), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(481 - 427) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100111 + 0o12) + chr(0b110001) + chr(2549 - 2495), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\x36' + chr(132 - 77), 0b1000), ehT0Px3KOsy9(chr(1461 - 1413) + chr(3978 - 3867) + '\x33' + chr(0b1111 + 0o47), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111011 + 0o64) + '\062' + '\x33' + '\x31', 0o10), ehT0Px3KOsy9(chr(1316 - 1268) + chr(111) + '\065' + chr(50), 39326 - 39318), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31', 8), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(3537 - 3426) + chr(50) + chr(55) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1473 - 1419) + chr(0b11101 + 0o23), 8), ehT0Px3KOsy9(chr(48) + chr(0b11010 + 0o125) + chr(49) + chr(0b101000 + 0o11) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1010 + 0o50) + chr(562 - 510) + chr(1916 - 1862), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(1722 - 1674) + '\061', 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(2162 - 2112) + chr(0b110101) + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10000 + 0o43) + chr(0b110011) + chr(0b10 + 0o65), 0b1000), ehT0Px3KOsy9(chr(505 - 457) + chr(0b101100 + 0o103) + chr(0b110010) + chr(235 - 184) + chr(0b100110 + 0o12), 0o10), ehT0Px3KOsy9(chr(313 - 265) + '\x6f' + chr(0b1 + 0o61) + chr(0b110110) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(51) + chr(55) + chr(0b11001 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(1172 - 1124) + chr(0b10001 + 0o136) + chr(1179 - 1130) + chr(0b10011 + 0o41), 0o10), ehT0Px3KOsy9(chr(48) + chr(6237 - 6126) + chr(0b110011) + chr(48) + '\064', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(1674 - 1620) + chr(1799 - 1746), ord("\x08")), ehT0Px3KOsy9(chr(1950 - 1902) + chr(0b1101111) + chr(1541 - 1492) + chr(0b110001), 52073 - 52065), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1892 - 1842) + chr(0b1011 + 0o52) + chr(813 - 760), 8), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(1811 - 1700) + '\067' + chr(0b110 + 0o61), 63644 - 63636)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + '\065' + chr(223 - 175), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'/'), '\144' + '\x65' + chr(0b1001101 + 0o26) + chr(0b110001 + 0o76) + chr(100) + chr(0b110011 + 0o62))(chr(117) + '\x74' + chr(0b1100110) + chr(45) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def X6TgCyKlyOui(oVre8I6UXc3b, ClrkdavlbKME, SqiSOtYOqOJH): ClrkdavlbKME[xafqLlk3kkUe(SXOLrMavuUCe(b'c\x8f]&\x87N'), '\x64' + chr(5683 - 5582) + chr(0b1100011) + chr(111) + '\x64' + '\145')(chr(0b1100101 + 0o20) + '\x74' + '\x66' + chr(0b101101) + chr(0b111000))] = oVre8I6UXc3b.bottom ClrkdavlbKME[xafqLlk3kkUe(SXOLrMavuUCe(b'c\x89G!'), chr(9489 - 9389) + '\x65' + '\x63' + chr(0b1101111) + '\144' + chr(0b11001 + 0o114))('\165' + '\164' + chr(102) + chr(0b10110 + 0o27) + chr(56))] = oVre8I6UXc3b.bins return ClrkdavlbKME
pandas-dev/pandas
pandas/plotting/_core.py
FramePlotMethods.line
def line(self, x=None, y=None, **kwds): """ Plot DataFrame columns as lines. This function is useful to plot lines using DataFrame's values as coordinates. Parameters ---------- x : int or str, optional Columns to use for the horizontal axis. Either the location or the label of the columns to be used. By default, it will use the DataFrame indices. y : int, str, or list of them, optional The values to be plotted. Either the location or the label of the columns to be used. By default, it will use the remaining DataFrame numeric columns. **kwds Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns ------- :class:`matplotlib.axes.Axes` or :class:`numpy.ndarray` Return an ndarray when ``subplots=True``. See Also -------- matplotlib.pyplot.plot : Plot y versus x as lines and/or markers. Examples -------- .. plot:: :context: close-figs The following example shows the populations for some animals over the years. >>> df = pd.DataFrame({ ... 'pig': [20, 18, 489, 675, 1776], ... 'horse': [4, 25, 281, 600, 1900] ... }, index=[1990, 1997, 2003, 2009, 2014]) >>> lines = df.plot.line() .. plot:: :context: close-figs An example with subplots, so an array of axes is returned. >>> axes = df.plot.line(subplots=True) >>> type(axes) <class 'numpy.ndarray'> .. plot:: :context: close-figs The following example shows the relationship between both populations. >>> lines = df.plot.line(x='pig', y='horse') """ return self(kind='line', x=x, y=y, **kwds)
python
def line(self, x=None, y=None, **kwds): """ Plot DataFrame columns as lines. This function is useful to plot lines using DataFrame's values as coordinates. Parameters ---------- x : int or str, optional Columns to use for the horizontal axis. Either the location or the label of the columns to be used. By default, it will use the DataFrame indices. y : int, str, or list of them, optional The values to be plotted. Either the location or the label of the columns to be used. By default, it will use the remaining DataFrame numeric columns. **kwds Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns ------- :class:`matplotlib.axes.Axes` or :class:`numpy.ndarray` Return an ndarray when ``subplots=True``. See Also -------- matplotlib.pyplot.plot : Plot y versus x as lines and/or markers. Examples -------- .. plot:: :context: close-figs The following example shows the populations for some animals over the years. >>> df = pd.DataFrame({ ... 'pig': [20, 18, 489, 675, 1776], ... 'horse': [4, 25, 281, 600, 1900] ... }, index=[1990, 1997, 2003, 2009, 2014]) >>> lines = df.plot.line() .. plot:: :context: close-figs An example with subplots, so an array of axes is returned. >>> axes = df.plot.line(subplots=True) >>> type(axes) <class 'numpy.ndarray'> .. plot:: :context: close-figs The following example shows the relationship between both populations. >>> lines = df.plot.line(x='pig', y='horse') """ return self(kind='line', x=x, y=y, **kwds)
[ "def", "line", "(", "self", ",", "x", "=", "None", ",", "y", "=", "None", ",", "*", "*", "kwds", ")", ":", "return", "self", "(", "kind", "=", "'line'", ",", "x", "=", "x", ",", "y", "=", "y", ",", "*", "*", "kwds", ")" ]
Plot DataFrame columns as lines. This function is useful to plot lines using DataFrame's values as coordinates. Parameters ---------- x : int or str, optional Columns to use for the horizontal axis. Either the location or the label of the columns to be used. By default, it will use the DataFrame indices. y : int, str, or list of them, optional The values to be plotted. Either the location or the label of the columns to be used. By default, it will use the remaining DataFrame numeric columns. **kwds Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns ------- :class:`matplotlib.axes.Axes` or :class:`numpy.ndarray` Return an ndarray when ``subplots=True``. See Also -------- matplotlib.pyplot.plot : Plot y versus x as lines and/or markers. Examples -------- .. plot:: :context: close-figs The following example shows the populations for some animals over the years. >>> df = pd.DataFrame({ ... 'pig': [20, 18, 489, 675, 1776], ... 'horse': [4, 25, 281, 600, 1900] ... }, index=[1990, 1997, 2003, 2009, 2014]) >>> lines = df.plot.line() .. plot:: :context: close-figs An example with subplots, so an array of axes is returned. >>> axes = df.plot.line(subplots=True) >>> type(axes) <class 'numpy.ndarray'> .. plot:: :context: close-figs The following example shows the relationship between both populations. >>> lines = df.plot.line(x='pig', y='horse')
[ "Plot", "DataFrame", "columns", "as", "lines", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L2970-L3031
train
Plot a line of the entry for a specific language.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bd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PkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + '\x30' + chr(0b11111 + 0o21), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b100100 + 0o23) + chr(0b110101), 25429 - 25421), ehT0Px3KOsy9(chr(0b110000) + chr(9421 - 9310) + chr(0b10011 + 0o36) + chr(0b101101 + 0o7) + chr(0b1101 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b110010 + 0o75) + chr(0b110011) + chr(51) + chr(1053 - 1004), 0o10), ehT0Px3KOsy9(chr(48) + chr(8254 - 8143) + chr(1000 - 951) + '\x34' + chr(0b110001), 58280 - 58272), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1010011 + 0o34) + chr(54) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7244 - 7133) + chr(0b1000 + 0o51) + chr(0b110011) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(1021 - 973) + chr(0b101 + 0o152) + chr(49) + chr(1179 - 1127) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + '\062' + chr(2195 - 2146), 44344 - 44336), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + chr(0b10000 + 0o43) + chr(1016 - 964), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b101101 + 0o11) + '\063', 0o10), ehT0Px3KOsy9(chr(1950 - 1902) + chr(0b1100010 + 0o15) + chr(1238 - 1189) + '\063' + chr(197 - 149), ord("\x08")), ehT0Px3KOsy9('\060' + chr(518 - 407) + chr(1177 - 1127) + chr(0b110001) + '\065', 0o10), ehT0Px3KOsy9(chr(1855 - 1807) + chr(7991 - 7880) + chr(50) + '\x31' + chr(0b1101 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + '\x33' + chr(0b10010 + 0o36) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110000 + 0o77) + chr(0b11011 + 0o26) + '\067' + chr(0b11111 + 0o30), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + '\x37' + chr(1779 - 1730), 36823 - 36815), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11 + 0o57) + chr(49) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(0b110101) + chr(1214 - 1159), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + '\061' + chr(616 - 568) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\x33' + '\064', 0b1000), ehT0Px3KOsy9(chr(920 - 872) + chr(111) + chr(375 - 324) + '\064' + '\066', 0o10), ehT0Px3KOsy9(chr(784 - 736) + '\157' + chr(50) + '\060' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b10010 + 0o37), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(852 - 801) + '\060' + chr(48), 8), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(53) + chr(0b110011), 35253 - 35245), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(509 - 460) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(0b100100 + 0o15) + chr(0b110011 + 0o4), 0o10), ehT0Px3KOsy9('\060' + chr(7081 - 6970) + '\063' + chr(0b10110 + 0o40) + '\x34', 0b1000), ehT0Px3KOsy9(chr(221 - 173) + chr(111) + '\x33' + chr(55) + '\x33', 52940 - 52932), ehT0Px3KOsy9('\060' + chr(0b1001 + 0o146) + chr(0b110001) + '\067' + chr(2590 - 2538), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(55) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1023 - 973) + chr(0b100111 + 0o15), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(0b110111) + '\063', 0o10), ehT0Px3KOsy9('\x30' + chr(0b110110 + 0o71) + '\061' + chr(0b1011 + 0o53) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b10 + 0o57) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101010 + 0o11) + chr(1078 - 1026) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1261 - 1150) + chr(0b1100 + 0o50) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(0b110001) + chr(49), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + '\060', 48139 - 48131)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xee'), chr(0b1100100) + chr(0b10100 + 0o121) + '\143' + chr(0b110111 + 0o70) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(2561 - 2445) + '\x66' + '\055' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def LycYkDpyelF6(oVre8I6UXc3b, OeWW0F1dBPRQ=None, SqiSOtYOqOJH=None, **ClrkdavlbKME): return oVre8I6UXc3b(kind=xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\x14\n\xbc'), chr(0b1100100) + '\145' + chr(99) + chr(0b100110 + 0o111) + chr(4078 - 3978) + '\145')(chr(117) + chr(0b110100 + 0o100) + chr(0b1100110) + '\055' + chr(0b1 + 0o67)), x=OeWW0F1dBPRQ, y=SqiSOtYOqOJH, **ClrkdavlbKME)
pandas-dev/pandas
pandas/plotting/_core.py
FramePlotMethods.bar
def bar(self, x=None, y=None, **kwds): """ Vertical bar plot. A bar plot is a plot that presents categorical data with rectangular bars with lengths proportional to the values that they represent. A bar plot shows comparisons among discrete categories. One axis of the plot shows the specific categories being compared, and the other axis represents a measured value. Parameters ---------- x : label or position, optional Allows plotting of one column versus another. If not specified, the index of the DataFrame is used. y : label or position, optional Allows plotting of one column versus another. If not specified, all numerical columns are used. **kwds Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- matplotlib.axes.Axes or np.ndarray of them An ndarray is returned with one :class:`matplotlib.axes.Axes` per column when ``subplots=True``. See Also -------- DataFrame.plot.barh : Horizontal bar plot. DataFrame.plot : Make plots of a DataFrame. matplotlib.pyplot.bar : Make a bar plot with matplotlib. Examples -------- Basic plot. .. plot:: :context: close-figs >>> df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]}) >>> ax = df.plot.bar(x='lab', y='val', rot=0) Plot a whole dataframe to a bar plot. Each column is assigned a distinct color, and each row is nested in a group along the horizontal axis. .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.bar(rot=0) Instead of nesting, the figure can be split by column with ``subplots=True``. In this case, a :class:`numpy.ndarray` of :class:`matplotlib.axes.Axes` are returned. .. plot:: :context: close-figs >>> axes = df.plot.bar(rot=0, subplots=True) >>> axes[1].legend(loc=2) # doctest: +SKIP Plot a single column. .. plot:: :context: close-figs >>> ax = df.plot.bar(y='speed', rot=0) Plot only selected categories for the DataFrame. .. plot:: :context: close-figs >>> ax = df.plot.bar(x='lifespan', rot=0) """ return self(kind='bar', x=x, y=y, **kwds)
python
def bar(self, x=None, y=None, **kwds): """ Vertical bar plot. A bar plot is a plot that presents categorical data with rectangular bars with lengths proportional to the values that they represent. A bar plot shows comparisons among discrete categories. One axis of the plot shows the specific categories being compared, and the other axis represents a measured value. Parameters ---------- x : label or position, optional Allows plotting of one column versus another. If not specified, the index of the DataFrame is used. y : label or position, optional Allows plotting of one column versus another. If not specified, all numerical columns are used. **kwds Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- matplotlib.axes.Axes or np.ndarray of them An ndarray is returned with one :class:`matplotlib.axes.Axes` per column when ``subplots=True``. See Also -------- DataFrame.plot.barh : Horizontal bar plot. DataFrame.plot : Make plots of a DataFrame. matplotlib.pyplot.bar : Make a bar plot with matplotlib. Examples -------- Basic plot. .. plot:: :context: close-figs >>> df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]}) >>> ax = df.plot.bar(x='lab', y='val', rot=0) Plot a whole dataframe to a bar plot. Each column is assigned a distinct color, and each row is nested in a group along the horizontal axis. .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.bar(rot=0) Instead of nesting, the figure can be split by column with ``subplots=True``. In this case, a :class:`numpy.ndarray` of :class:`matplotlib.axes.Axes` are returned. .. plot:: :context: close-figs >>> axes = df.plot.bar(rot=0, subplots=True) >>> axes[1].legend(loc=2) # doctest: +SKIP Plot a single column. .. plot:: :context: close-figs >>> ax = df.plot.bar(y='speed', rot=0) Plot only selected categories for the DataFrame. .. plot:: :context: close-figs >>> ax = df.plot.bar(x='lifespan', rot=0) """ return self(kind='bar', x=x, y=y, **kwds)
[ "def", "bar", "(", "self", ",", "x", "=", "None", ",", "y", "=", "None", ",", "*", "*", "kwds", ")", ":", "return", "self", "(", "kind", "=", "'bar'", ",", "x", "=", "x", ",", "y", "=", "y", ",", "*", "*", "kwds", ")" ]
Vertical bar plot. A bar plot is a plot that presents categorical data with rectangular bars with lengths proportional to the values that they represent. A bar plot shows comparisons among discrete categories. One axis of the plot shows the specific categories being compared, and the other axis represents a measured value. Parameters ---------- x : label or position, optional Allows plotting of one column versus another. If not specified, the index of the DataFrame is used. y : label or position, optional Allows plotting of one column versus another. If not specified, all numerical columns are used. **kwds Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- matplotlib.axes.Axes or np.ndarray of them An ndarray is returned with one :class:`matplotlib.axes.Axes` per column when ``subplots=True``. See Also -------- DataFrame.plot.barh : Horizontal bar plot. DataFrame.plot : Make plots of a DataFrame. matplotlib.pyplot.bar : Make a bar plot with matplotlib. Examples -------- Basic plot. .. plot:: :context: close-figs >>> df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]}) >>> ax = df.plot.bar(x='lab', y='val', rot=0) Plot a whole dataframe to a bar plot. Each column is assigned a distinct color, and each row is nested in a group along the horizontal axis. .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.bar(rot=0) Instead of nesting, the figure can be split by column with ``subplots=True``. In this case, a :class:`numpy.ndarray` of :class:`matplotlib.axes.Axes` are returned. .. plot:: :context: close-figs >>> axes = df.plot.bar(rot=0, subplots=True) >>> axes[1].legend(loc=2) # doctest: +SKIP Plot a single column. .. plot:: :context: close-figs >>> ax = df.plot.bar(y='speed', rot=0) Plot only selected categories for the DataFrame. .. plot:: :context: close-figs >>> ax = df.plot.bar(x='lifespan', rot=0)
[ "Vertical", "bar", "plot", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L3033-L3116
train
A function that plots a vertical bar plot of the specific categories of the current entry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,Q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9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(1185 - 1074) + chr(0b110010) + chr(0b110001) + '\x36', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b110000 + 0o5) + chr(145 - 93), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(0b110001) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(55) + '\x35', 63037 - 63029), ehT0Px3KOsy9('\x30' + chr(111) + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x37' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(7082 - 6971) + chr(0b101001 + 0o11) + '\x33' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\066' + chr(49), 0o10), ehT0Px3KOsy9(chr(1012 - 964) + chr(0b111110 + 0o61) + chr(0b110001) + chr(0b110110) + chr(0b101100 + 0o6), ord("\x08")), ehT0Px3KOsy9(chr(694 - 646) + chr(0b1010010 + 0o35) + chr(1900 - 1851) + chr(0b10011 + 0o35), 26425 - 26417), ehT0Px3KOsy9(chr(1742 - 1694) + chr(0b1101111) + chr(0b110011) + chr(0b11010 + 0o27) + chr(1937 - 1885), 0b1000), ehT0Px3KOsy9(chr(582 - 534) + '\157' + chr(55) + '\065', 8), ehT0Px3KOsy9('\x30' + '\157' + '\064', 35033 - 35025), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b1 + 0o65) + chr(252 - 200), 38740 - 38732), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1100 + 0o143) + chr(51) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b100010 + 0o21) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + chr(49) + chr(0b110010) + '\062', 20371 - 20363), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(0b100100 + 0o16) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(0b110001) + chr(0b11000 + 0o30) + chr(398 - 348), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + '\063' + chr(55) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(629 - 581) + chr(0b110101 + 0o72) + chr(49) + '\067' + '\x35', 0b1000), ehT0Px3KOsy9(chr(942 - 894) + chr(7283 - 7172) + '\x31' + '\067' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + chr(50) + chr(0b110001 + 0o4) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(1668 - 1618) + chr(0b11001 + 0o30) + '\061', 5096 - 5088), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(482 - 431) + chr(0b11001 + 0o31) + chr(54), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101000 + 0o7) + chr(0b10111 + 0o33) + '\063' + '\x33', 56487 - 56479), ehT0Px3KOsy9('\060' + chr(0b1100101 + 0o12) + chr(1673 - 1623) + chr(1952 - 1901) + '\060', 0o10), ehT0Px3KOsy9(chr(843 - 795) + chr(0b1101111) + '\061' + chr(0b110100) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b10110 + 0o33) + chr(996 - 945), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b111 + 0o53) + chr(1332 - 1278) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\060' + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10 + 0o155) + chr(0b110111) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(3094 - 2983) + chr(1790 - 1741) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10000 + 0o45) + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10010 + 0o37) + chr(1505 - 1456) + chr(51), 8), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + '\061' + chr(348 - 295), 53988 - 53980), ehT0Px3KOsy9(chr(483 - 435) + chr(0b100010 + 0o115) + chr(50) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(0b10111 + 0o33) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1 + 0o60) + chr(1544 - 1494) + chr(0b101001 + 0o7), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1320 - 1272) + chr(0b1101111) + chr(53) + chr(0b100011 + 0o15), 53768 - 53760)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0'), chr(8114 - 8014) + chr(0b1100101) + chr(7051 - 6952) + '\x6f' + chr(1142 - 1042) + chr(0b1100101))(chr(4890 - 4773) + '\x74' + chr(0b1100110) + chr(45) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def PaA969Wc_xg_(oVre8I6UXc3b, OeWW0F1dBPRQ=None, SqiSOtYOqOJH=None, **ClrkdavlbKME): return oVre8I6UXc3b(kind=xafqLlk3kkUe(SXOLrMavuUCe(b'\xec\r~'), chr(3266 - 3166) + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(0b1100011 + 0o1) + chr(0b1100101))(chr(117) + chr(1416 - 1300) + chr(9274 - 9172) + chr(1742 - 1697) + chr(56)), x=OeWW0F1dBPRQ, y=SqiSOtYOqOJH, **ClrkdavlbKME)
pandas-dev/pandas
pandas/plotting/_core.py
FramePlotMethods.barh
def barh(self, x=None, y=None, **kwds): """ Make a horizontal bar plot. A horizontal bar plot is a plot that presents quantitative data with rectangular bars with lengths proportional to the values that they represent. A bar plot shows comparisons among discrete categories. One axis of the plot shows the specific categories being compared, and the other axis represents a measured value. Parameters ---------- x : label or position, default DataFrame.index Column to be used for categories. y : label or position, default All numeric columns in dataframe Columns to be plotted from the DataFrame. **kwds Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns ------- :class:`matplotlib.axes.Axes` or numpy.ndarray of them See Also -------- DataFrame.plot.bar: Vertical bar plot. DataFrame.plot : Make plots of DataFrame using matplotlib. matplotlib.axes.Axes.bar : Plot a vertical bar plot using matplotlib. Examples -------- Basic example .. plot:: :context: close-figs >>> df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]}) >>> ax = df.plot.barh(x='lab', y='val') Plot a whole DataFrame to a horizontal bar plot .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.barh() Plot a column of the DataFrame to a horizontal bar plot .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.barh(y='speed') Plot DataFrame versus the desired column .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.barh(x='lifespan') """ return self(kind='barh', x=x, y=y, **kwds)
python
def barh(self, x=None, y=None, **kwds): """ Make a horizontal bar plot. A horizontal bar plot is a plot that presents quantitative data with rectangular bars with lengths proportional to the values that they represent. A bar plot shows comparisons among discrete categories. One axis of the plot shows the specific categories being compared, and the other axis represents a measured value. Parameters ---------- x : label or position, default DataFrame.index Column to be used for categories. y : label or position, default All numeric columns in dataframe Columns to be plotted from the DataFrame. **kwds Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns ------- :class:`matplotlib.axes.Axes` or numpy.ndarray of them See Also -------- DataFrame.plot.bar: Vertical bar plot. DataFrame.plot : Make plots of DataFrame using matplotlib. matplotlib.axes.Axes.bar : Plot a vertical bar plot using matplotlib. Examples -------- Basic example .. plot:: :context: close-figs >>> df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]}) >>> ax = df.plot.barh(x='lab', y='val') Plot a whole DataFrame to a horizontal bar plot .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.barh() Plot a column of the DataFrame to a horizontal bar plot .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.barh(y='speed') Plot DataFrame versus the desired column .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.barh(x='lifespan') """ return self(kind='barh', x=x, y=y, **kwds)
[ "def", "barh", "(", "self", ",", "x", "=", "None", ",", "y", "=", "None", ",", "*", "*", "kwds", ")", ":", "return", "self", "(", "kind", "=", "'barh'", ",", "x", "=", "x", ",", "y", "=", "y", ",", "*", "*", "kwds", ")" ]
Make a horizontal bar plot. A horizontal bar plot is a plot that presents quantitative data with rectangular bars with lengths proportional to the values that they represent. A bar plot shows comparisons among discrete categories. One axis of the plot shows the specific categories being compared, and the other axis represents a measured value. Parameters ---------- x : label or position, default DataFrame.index Column to be used for categories. y : label or position, default All numeric columns in dataframe Columns to be plotted from the DataFrame. **kwds Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns ------- :class:`matplotlib.axes.Axes` or numpy.ndarray of them See Also -------- DataFrame.plot.bar: Vertical bar plot. DataFrame.plot : Make plots of DataFrame using matplotlib. matplotlib.axes.Axes.bar : Plot a vertical bar plot using matplotlib. Examples -------- Basic example .. plot:: :context: close-figs >>> df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]}) >>> ax = df.plot.barh(x='lab', y='val') Plot a whole DataFrame to a horizontal bar plot .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.barh() Plot a column of the DataFrame to a horizontal bar plot .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.barh(y='speed') Plot DataFrame versus the desired column .. plot:: :context: close-figs >>> speed = [0.1, 17.5, 40, 48, 52, 69, 88] >>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] >>> index = ['snail', 'pig', 'elephant', ... 'rabbit', 'giraffe', 'coyote', 'horse'] >>> df = pd.DataFrame({'speed': speed, ... 'lifespan': lifespan}, index=index) >>> ax = df.plot.barh(x='lifespan')
[ "Make", "a", "horizontal", "bar", "plot", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L3118-L3196
train
Make a horizontal bar plot of the information for the current entry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR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0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(0b110011) + '\062', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x36' + chr(914 - 864), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2416 - 2365) + '\x33' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(0b11001 + 0o34) + chr(0b10100 + 0o36), 36135 - 36127), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(1615 - 1563) + '\067', 62600 - 62592), ehT0Px3KOsy9(chr(0b110000) + chr(187 - 76) + chr(0b110010) + chr(98 - 46), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b110110) + chr(0b1010 + 0o53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(3299 - 3188) + chr(54) + chr(52), 53414 - 53406), ehT0Px3KOsy9('\060' + '\157' + chr(0b10011 + 0o36) + '\x34' + chr(1468 - 1414), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(0b110011 + 0o0) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(532 - 484) + chr(0b1100001 + 0o16) + chr(0b100110 + 0o15) + chr(52) + chr(0b101001 + 0o15), 13033 - 13025), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + '\063' + chr(0b100101 + 0o14) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\065' + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\066' + chr(0b110 + 0o61), ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(0b110011) + chr(1128 - 1074), ord("\x08")), ehT0Px3KOsy9(chr(2203 - 2155) + '\x6f' + chr(0b110000 + 0o2) + chr(0b110000 + 0o5) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1001000 + 0o47) + '\x32' + '\x34' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1000 + 0o52) + chr(0b100101 + 0o20) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + '\060' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + '\060' + '\067', 63625 - 63617), ehT0Px3KOsy9(chr(48) + chr(0b1101100 + 0o3) + '\x32' + '\067', 0b1000), ehT0Px3KOsy9('\060' + chr(2324 - 2213) + chr(51) + chr(0b110111) + chr(1391 - 1342), 64012 - 64004), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2500 - 2445) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(774 - 726) + chr(111) + chr(1358 - 1308) + '\067' + chr(54), 4697 - 4689), ehT0Px3KOsy9(chr(288 - 240) + chr(0b11110 + 0o121) + '\063' + '\x32' + chr(0b1001 + 0o54), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(49) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + '\x34' + chr(0b110 + 0o60), 491 - 483), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1464 - 1413) + chr(2242 - 2187) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(2480 - 2429) + chr(0b110010) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b10100 + 0o133) + chr(0b101 + 0o54) + chr(0b110100) + chr(2578 - 2527), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\x30' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1313 - 1263) + chr(0b1001 + 0o52) + chr(0b110110), 33649 - 33641), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + '\x33' + '\x37' + '\061', 8), ehT0Px3KOsy9(chr(2245 - 2197) + chr(1488 - 1377) + chr(49) + chr(49) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(727 - 675) + chr(0b10100 + 0o42), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b100010 + 0o17) + chr(1670 - 1615), 8), ehT0Px3KOsy9('\060' + chr(3822 - 3711) + '\062' + chr(0b111 + 0o56) + chr(49), 53305 - 53297), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(55) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + chr(51) + chr(1110 - 1056) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(51) + '\061', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(10992 - 10881) + chr(0b110101) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'4'), chr(0b100101 + 0o77) + chr(101) + chr(1879 - 1780) + '\157' + '\144' + '\x65')(chr(0b1001010 + 0o53) + chr(116) + chr(0b1100110) + chr(45) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def SeO5d3FZVnC5(oVre8I6UXc3b, OeWW0F1dBPRQ=None, SqiSOtYOqOJH=None, **ClrkdavlbKME): return oVre8I6UXc3b(kind=xafqLlk3kkUe(SXOLrMavuUCe(b'xS\xaaB'), chr(100) + '\x65' + chr(99) + '\x6f' + chr(0b100 + 0o140) + chr(0b1100101))(chr(0b1110101) + '\164' + '\146' + chr(45) + chr(154 - 98)), x=OeWW0F1dBPRQ, y=SqiSOtYOqOJH, **ClrkdavlbKME)
pandas-dev/pandas
pandas/plotting/_core.py
FramePlotMethods.hist
def hist(self, by=None, bins=10, **kwds): """ Draw one histogram of the DataFrame's columns. A histogram is a representation of the distribution of data. This function groups the values of all given Series in the DataFrame into bins and draws all bins in one :class:`matplotlib.axes.Axes`. This is useful when the DataFrame's Series are in a similar scale. Parameters ---------- by : str or sequence, optional Column in the DataFrame to group by. bins : int, default 10 Number of histogram bins to be used. **kwds Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- class:`matplotlib.AxesSubplot` Return a histogram plot. See Also -------- DataFrame.hist : Draw histograms per DataFrame's Series. Series.hist : Draw a histogram with Series' data. Examples -------- When we draw a dice 6000 times, we expect to get each value around 1000 times. But when we draw two dices and sum the result, the distribution is going to be quite different. A histogram illustrates those distributions. .. plot:: :context: close-figs >>> df = pd.DataFrame( ... np.random.randint(1, 7, 6000), ... columns = ['one']) >>> df['two'] = df['one'] + np.random.randint(1, 7, 6000) >>> ax = df.plot.hist(bins=12, alpha=0.5) """ return self(kind='hist', by=by, bins=bins, **kwds)
python
def hist(self, by=None, bins=10, **kwds): """ Draw one histogram of the DataFrame's columns. A histogram is a representation of the distribution of data. This function groups the values of all given Series in the DataFrame into bins and draws all bins in one :class:`matplotlib.axes.Axes`. This is useful when the DataFrame's Series are in a similar scale. Parameters ---------- by : str or sequence, optional Column in the DataFrame to group by. bins : int, default 10 Number of histogram bins to be used. **kwds Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- class:`matplotlib.AxesSubplot` Return a histogram plot. See Also -------- DataFrame.hist : Draw histograms per DataFrame's Series. Series.hist : Draw a histogram with Series' data. Examples -------- When we draw a dice 6000 times, we expect to get each value around 1000 times. But when we draw two dices and sum the result, the distribution is going to be quite different. A histogram illustrates those distributions. .. plot:: :context: close-figs >>> df = pd.DataFrame( ... np.random.randint(1, 7, 6000), ... columns = ['one']) >>> df['two'] = df['one'] + np.random.randint(1, 7, 6000) >>> ax = df.plot.hist(bins=12, alpha=0.5) """ return self(kind='hist', by=by, bins=bins, **kwds)
[ "def", "hist", "(", "self", ",", "by", "=", "None", ",", "bins", "=", "10", ",", "*", "*", "kwds", ")", ":", "return", "self", "(", "kind", "=", "'hist'", ",", "by", "=", "by", ",", "bins", "=", "bins", ",", "*", "*", "kwds", ")" ]
Draw one histogram of the DataFrame's columns. A histogram is a representation of the distribution of data. This function groups the values of all given Series in the DataFrame into bins and draws all bins in one :class:`matplotlib.axes.Axes`. This is useful when the DataFrame's Series are in a similar scale. Parameters ---------- by : str or sequence, optional Column in the DataFrame to group by. bins : int, default 10 Number of histogram bins to be used. **kwds Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- class:`matplotlib.AxesSubplot` Return a histogram plot. See Also -------- DataFrame.hist : Draw histograms per DataFrame's Series. Series.hist : Draw a histogram with Series' data. Examples -------- When we draw a dice 6000 times, we expect to get each value around 1000 times. But when we draw two dices and sum the result, the distribution is going to be quite different. A histogram illustrates those distributions. .. plot:: :context: close-figs >>> df = pd.DataFrame( ... np.random.randint(1, 7, 6000), ... columns = ['one']) >>> df['two'] = df['one'] + np.random.randint(1, 7, 6000) >>> ax = df.plot.hist(bins=12, alpha=0.5)
[ "Draw", "one", "histogram", "of", "the", "DataFrame", "s", "columns", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L3248-L3293
train
Draw one histogram of the DataFrame s columns.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrO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T,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1100100 + 0o13) + '\063' + chr(0b101001 + 0o7) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10011 + 0o40) + chr(52) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1 + 0o156) + chr(2301 - 2246) + chr(0b11100 + 0o27), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b101100 + 0o10) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(996 - 942) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b110101) + chr(0b11010 + 0o35), 40278 - 40270), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(775 - 727) + '\065', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b10001 + 0o43) + chr(2088 - 2037), 24575 - 24567), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b110110) + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(48) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(1319 - 1271) + chr(0b1001 + 0o146) + chr(1779 - 1730) + chr(49) + '\067', 37200 - 37192), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + '\x32' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(1741 - 1693) + '\x6f' + chr(0b110010) + chr(0b110010) + chr(50), 12727 - 12719), ehT0Px3KOsy9(chr(330 - 282) + chr(0b1001110 + 0o41) + chr(49) + chr(0b1101 + 0o43), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b110010) + chr(917 - 863), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b10011 + 0o42) + '\064', 0o10), ehT0Px3KOsy9(chr(1961 - 1913) + '\x6f' + chr(0b100110 + 0o15) + '\065' + chr(1343 - 1293), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10001 + 0o42) + '\x36' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(1520 - 1472) + chr(8703 - 8592) + chr(50) + chr(809 - 759) + '\x33', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\x33' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110000 + 0o4) + '\x36', 8), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b1000 + 0o51) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b11011 + 0o27), 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(0b101101 + 0o6) + '\x33' + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010 + 0o1) + chr(1143 - 1088) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10110 + 0o131) + chr(0b110100) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110110 + 0o71) + chr(0b110111) + chr(0b110001), 14050 - 14042), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101101 + 0o2) + chr(49) + chr(55), 8), ehT0Px3KOsy9('\060' + chr(10114 - 10003) + chr(50) + '\x32' + '\x32', 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + '\061' + chr(662 - 614), ord("\x08")), ehT0Px3KOsy9('\060' + chr(5707 - 5596) + '\x33' + chr(0b110111) + chr(516 - 461), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + '\067' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(0b110011) + chr(481 - 429), 8), ehT0Px3KOsy9(chr(872 - 824) + '\x6f' + chr(0b110010) + chr(53) + chr(195 - 141), 24035 - 24027), ehT0Px3KOsy9(chr(48) + chr(0b1100 + 0o143) + chr(0b110001) + chr(0b110110) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(9046 - 8935) + chr(2096 - 2045) + chr(0b110010 + 0o0) + chr(267 - 218), 19372 - 19364), ehT0Px3KOsy9(chr(2206 - 2158) + chr(7841 - 7730) + chr(0b110011) + chr(1721 - 1670) + chr(1336 - 1285), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2768 - 2713) + chr(1866 - 1811), 8), ehT0Px3KOsy9(chr(0b110000) + chr(2576 - 2465) + chr(1966 - 1916) + chr(1758 - 1705) + chr(52), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\065' + chr(0b110100), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(4939 - 4828) + '\x35' + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xed'), chr(100) + chr(973 - 872) + chr(0b1010101 + 0o16) + chr(0b1101111) + '\144' + chr(1468 - 1367))(chr(604 - 487) + chr(116) + chr(102) + '\x2d' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def GM2WEs99GoH3(oVre8I6UXc3b, KPtq2czfwPS6=None, KQ4BDFoY4RVo=ehT0Px3KOsy9(chr(1107 - 1059) + '\x6f' + chr(0b110001) + chr(0b110010), 61982 - 61974), **ClrkdavlbKME): return oVre8I6UXc3b(kind=xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\x8fH\x95'), '\x64' + chr(101) + chr(0b1000 + 0o133) + chr(111) + '\x64' + '\145')(chr(0b111111 + 0o66) + chr(0b1000001 + 0o63) + chr(0b10110 + 0o120) + '\055' + chr(83 - 27)), by=KPtq2czfwPS6, bins=KQ4BDFoY4RVo, **ClrkdavlbKME)
pandas-dev/pandas
pandas/plotting/_core.py
FramePlotMethods.area
def area(self, x=None, y=None, **kwds): """ Draw a stacked area plot. An area plot displays quantitative data visually. This function wraps the matplotlib area function. Parameters ---------- x : label or position, optional Coordinates for the X axis. By default uses the index. y : label or position, optional Column to plot. By default uses all columns. stacked : bool, default True Area plots are stacked by default. Set to False to create a unstacked plot. **kwds : optional Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- matplotlib.axes.Axes or numpy.ndarray Area plot, or array of area plots if subplots is True. See Also -------- DataFrame.plot : Make plots of DataFrame using matplotlib / pylab. Examples -------- Draw an area plot based on basic business metrics: .. plot:: :context: close-figs >>> df = pd.DataFrame({ ... 'sales': [3, 2, 3, 9, 10, 6], ... 'signups': [5, 5, 6, 12, 14, 13], ... 'visits': [20, 42, 28, 62, 81, 50], ... }, index=pd.date_range(start='2018/01/01', end='2018/07/01', ... freq='M')) >>> ax = df.plot.area() Area plots are stacked by default. To produce an unstacked plot, pass ``stacked=False``: .. plot:: :context: close-figs >>> ax = df.plot.area(stacked=False) Draw an area plot for a single column: .. plot:: :context: close-figs >>> ax = df.plot.area(y='sales') Draw with a different `x`: .. plot:: :context: close-figs >>> df = pd.DataFrame({ ... 'sales': [3, 2, 3], ... 'visits': [20, 42, 28], ... 'day': [1, 2, 3], ... }) >>> ax = df.plot.area(x='day') """ return self(kind='area', x=x, y=y, **kwds)
python
def area(self, x=None, y=None, **kwds): """ Draw a stacked area plot. An area plot displays quantitative data visually. This function wraps the matplotlib area function. Parameters ---------- x : label or position, optional Coordinates for the X axis. By default uses the index. y : label or position, optional Column to plot. By default uses all columns. stacked : bool, default True Area plots are stacked by default. Set to False to create a unstacked plot. **kwds : optional Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- matplotlib.axes.Axes or numpy.ndarray Area plot, or array of area plots if subplots is True. See Also -------- DataFrame.plot : Make plots of DataFrame using matplotlib / pylab. Examples -------- Draw an area plot based on basic business metrics: .. plot:: :context: close-figs >>> df = pd.DataFrame({ ... 'sales': [3, 2, 3, 9, 10, 6], ... 'signups': [5, 5, 6, 12, 14, 13], ... 'visits': [20, 42, 28, 62, 81, 50], ... }, index=pd.date_range(start='2018/01/01', end='2018/07/01', ... freq='M')) >>> ax = df.plot.area() Area plots are stacked by default. To produce an unstacked plot, pass ``stacked=False``: .. plot:: :context: close-figs >>> ax = df.plot.area(stacked=False) Draw an area plot for a single column: .. plot:: :context: close-figs >>> ax = df.plot.area(y='sales') Draw with a different `x`: .. plot:: :context: close-figs >>> df = pd.DataFrame({ ... 'sales': [3, 2, 3], ... 'visits': [20, 42, 28], ... 'day': [1, 2, 3], ... }) >>> ax = df.plot.area(x='day') """ return self(kind='area', x=x, y=y, **kwds)
[ "def", "area", "(", "self", ",", "x", "=", "None", ",", "y", "=", "None", ",", "*", "*", "kwds", ")", ":", "return", "self", "(", "kind", "=", "'area'", ",", "x", "=", "x", ",", "y", "=", "y", ",", "*", "*", "kwds", ")" ]
Draw a stacked area plot. An area plot displays quantitative data visually. This function wraps the matplotlib area function. Parameters ---------- x : label or position, optional Coordinates for the X axis. By default uses the index. y : label or position, optional Column to plot. By default uses all columns. stacked : bool, default True Area plots are stacked by default. Set to False to create a unstacked plot. **kwds : optional Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- matplotlib.axes.Axes or numpy.ndarray Area plot, or array of area plots if subplots is True. See Also -------- DataFrame.plot : Make plots of DataFrame using matplotlib / pylab. Examples -------- Draw an area plot based on basic business metrics: .. plot:: :context: close-figs >>> df = pd.DataFrame({ ... 'sales': [3, 2, 3, 9, 10, 6], ... 'signups': [5, 5, 6, 12, 14, 13], ... 'visits': [20, 42, 28, 62, 81, 50], ... }, index=pd.date_range(start='2018/01/01', end='2018/07/01', ... freq='M')) >>> ax = df.plot.area() Area plots are stacked by default. To produce an unstacked plot, pass ``stacked=False``: .. plot:: :context: close-figs >>> ax = df.plot.area(stacked=False) Draw an area plot for a single column: .. plot:: :context: close-figs >>> ax = df.plot.area(y='sales') Draw with a different `x`: .. plot:: :context: close-figs >>> df = pd.DataFrame({ ... 'sales': [3, 2, 3], ... 'visits': [20, 42, 28], ... 'day': [1, 2, 3], ... }) >>> ax = df.plot.area(x='day')
[ "Draw", "a", "stacked", "area", "plot", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L3341-L3412
train
This function creates an area plot showing quantitative data visually.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24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YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\157' + chr(2584 - 2529) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + chr(0b10101 + 0o132) + chr(49) + '\x36' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b110000 + 0o0), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(2034 - 1980) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(654 - 605) + chr(0b110100) + chr(693 - 641), 0b1000), ehT0Px3KOsy9('\060' + chr(10907 - 10796) + chr(0b100011 + 0o17) + chr(1495 - 1443) + chr(0b110100), 32212 - 32204), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(8567 - 8456) + chr(1680 - 1629) + '\x36' + chr(0b11000 + 0o35), 49438 - 49430), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\x35' + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110010) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(600 - 551) + chr(1393 - 1345), 2128 - 2120), ehT0Px3KOsy9('\x30' + chr(722 - 611) + chr(0b110011) + chr(0b10110 + 0o32) + '\x36', 64143 - 64135), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1010 + 0o50) + chr(51) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(1856 - 1808) + chr(0b1101111) + chr(0b110011) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4436 - 4325) + '\063' + '\x32' + '\063', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x35' + chr(0b110100), 56431 - 56423), ehT0Px3KOsy9(chr(453 - 405) + chr(0b1101111) + '\063' + chr(0b110001) + chr(0b110011), 28285 - 28277), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + '\x36' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(2197 - 2149) + chr(0b1100001 + 0o16) + chr(49) + '\060' + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(8144 - 8033) + chr(49) + chr(2539 - 2484) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + chr(0b1111 + 0o44) + chr(0b10010 + 0o42) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b1100 + 0o45) + '\061', 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(53) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(0b110111) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100101 + 0o15) + chr(49) + chr(702 - 654), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b101101 + 0o7) + chr(48), 20178 - 20170), ehT0Px3KOsy9('\060' + '\x6f' + '\066' + chr(803 - 749), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\060' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(1435 - 1387) + '\x6f' + '\064' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b100101 + 0o15), 0o10), ehT0Px3KOsy9(chr(675 - 627) + '\x6f' + chr(0b110001) + chr(49) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + '\x31' + '\x32' + '\064', 45045 - 45037), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(0b110100 + 0o1) + '\x35', 0o10), ehT0Px3KOsy9('\060' + chr(0b1011 + 0o144) + chr(0b110011) + '\061' + '\060', 0o10), ehT0Px3KOsy9(chr(1712 - 1664) + chr(0b1101111) + chr(0b10101 + 0o36) + chr(0b100000 + 0o20) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10110 + 0o34) + chr(0b100110 + 0o13) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1740 - 1692) + chr(111) + chr(0b110011) + chr(0b110110) + chr(0b110101), 8), ehT0Px3KOsy9(chr(0b110000) + chr(12138 - 12027) + chr(1155 - 1106) + chr(1880 - 1826) + '\067', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1777 - 1724) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(64 - 16) + chr(0b100110 + 0o111) + chr(2292 - 2238) + chr(55), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1001 + 0o146) + '\065' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x11'), chr(100) + '\145' + chr(1096 - 997) + '\x6f' + '\x64' + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(0b10010 + 0o124) + '\x2d' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def WABECtcYvOwd(oVre8I6UXc3b, OeWW0F1dBPRQ=None, SqiSOtYOqOJH=None, **ClrkdavlbKME): return oVre8I6UXc3b(kind=xafqLlk3kkUe(SXOLrMavuUCe(b'^\x05m\x95'), '\x64' + chr(7154 - 7053) + chr(1626 - 1527) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(117) + '\164' + chr(0b1100110) + chr(1132 - 1087) + chr(0b111000)), x=OeWW0F1dBPRQ, y=SqiSOtYOqOJH, **ClrkdavlbKME)
pandas-dev/pandas
pandas/plotting/_core.py
FramePlotMethods.scatter
def scatter(self, x, y, s=None, c=None, **kwds): """ Create a scatter plot with varying marker point size and color. The coordinates of each point are defined by two dataframe columns and filled circles are used to represent each point. This kind of plot is useful to see complex correlations between two variables. Points could be for instance natural 2D coordinates like longitude and latitude in a map or, in general, any pair of metrics that can be plotted against each other. Parameters ---------- x : int or str The column name or column position to be used as horizontal coordinates for each point. y : int or str The column name or column position to be used as vertical coordinates for each point. s : scalar or array_like, optional The size of each point. Possible values are: - A single scalar so all points have the same size. - A sequence of scalars, which will be used for each point's size recursively. For instance, when passing [2,14] all points size will be either 2 or 14, alternatively. c : str, int or array_like, optional The color of each point. Possible values are: - A single color string referred to by name, RGB or RGBA code, for instance 'red' or '#a98d19'. - A sequence of color strings referred to by name, RGB or RGBA code, which will be used for each point's color recursively. For instance ['green','yellow'] all points will be filled in green or yellow, alternatively. - A column name or position whose values will be used to color the marker points according to a colormap. **kwds Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns ------- :class:`matplotlib.axes.Axes` or numpy.ndarray of them See Also -------- matplotlib.pyplot.scatter : Scatter plot using multiple input data formats. Examples -------- Let's see how to draw a scatter plot using coordinates from the values in a DataFrame's columns. .. plot:: :context: close-figs >>> df = pd.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1], ... [6.4, 3.2, 1], [5.9, 3.0, 2]], ... columns=['length', 'width', 'species']) >>> ax1 = df.plot.scatter(x='length', ... y='width', ... c='DarkBlue') And now with the color determined by a column as well. .. plot:: :context: close-figs >>> ax2 = df.plot.scatter(x='length', ... y='width', ... c='species', ... colormap='viridis') """ return self(kind='scatter', x=x, y=y, c=c, s=s, **kwds)
python
def scatter(self, x, y, s=None, c=None, **kwds): """ Create a scatter plot with varying marker point size and color. The coordinates of each point are defined by two dataframe columns and filled circles are used to represent each point. This kind of plot is useful to see complex correlations between two variables. Points could be for instance natural 2D coordinates like longitude and latitude in a map or, in general, any pair of metrics that can be plotted against each other. Parameters ---------- x : int or str The column name or column position to be used as horizontal coordinates for each point. y : int or str The column name or column position to be used as vertical coordinates for each point. s : scalar or array_like, optional The size of each point. Possible values are: - A single scalar so all points have the same size. - A sequence of scalars, which will be used for each point's size recursively. For instance, when passing [2,14] all points size will be either 2 or 14, alternatively. c : str, int or array_like, optional The color of each point. Possible values are: - A single color string referred to by name, RGB or RGBA code, for instance 'red' or '#a98d19'. - A sequence of color strings referred to by name, RGB or RGBA code, which will be used for each point's color recursively. For instance ['green','yellow'] all points will be filled in green or yellow, alternatively. - A column name or position whose values will be used to color the marker points according to a colormap. **kwds Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns ------- :class:`matplotlib.axes.Axes` or numpy.ndarray of them See Also -------- matplotlib.pyplot.scatter : Scatter plot using multiple input data formats. Examples -------- Let's see how to draw a scatter plot using coordinates from the values in a DataFrame's columns. .. plot:: :context: close-figs >>> df = pd.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1], ... [6.4, 3.2, 1], [5.9, 3.0, 2]], ... columns=['length', 'width', 'species']) >>> ax1 = df.plot.scatter(x='length', ... y='width', ... c='DarkBlue') And now with the color determined by a column as well. .. plot:: :context: close-figs >>> ax2 = df.plot.scatter(x='length', ... y='width', ... c='species', ... colormap='viridis') """ return self(kind='scatter', x=x, y=y, c=c, s=s, **kwds)
[ "def", "scatter", "(", "self", ",", "x", ",", "y", ",", "s", "=", "None", ",", "c", "=", "None", ",", "*", "*", "kwds", ")", ":", "return", "self", "(", "kind", "=", "'scatter'", ",", "x", "=", "x", ",", "y", "=", "y", ",", "c", "=", "c", ",", "s", "=", "s", ",", "*", "*", "kwds", ")" ]
Create a scatter plot with varying marker point size and color. The coordinates of each point are defined by two dataframe columns and filled circles are used to represent each point. This kind of plot is useful to see complex correlations between two variables. Points could be for instance natural 2D coordinates like longitude and latitude in a map or, in general, any pair of metrics that can be plotted against each other. Parameters ---------- x : int or str The column name or column position to be used as horizontal coordinates for each point. y : int or str The column name or column position to be used as vertical coordinates for each point. s : scalar or array_like, optional The size of each point. Possible values are: - A single scalar so all points have the same size. - A sequence of scalars, which will be used for each point's size recursively. For instance, when passing [2,14] all points size will be either 2 or 14, alternatively. c : str, int or array_like, optional The color of each point. Possible values are: - A single color string referred to by name, RGB or RGBA code, for instance 'red' or '#a98d19'. - A sequence of color strings referred to by name, RGB or RGBA code, which will be used for each point's color recursively. For instance ['green','yellow'] all points will be filled in green or yellow, alternatively. - A column name or position whose values will be used to color the marker points according to a colormap. **kwds Keyword arguments to pass on to :meth:`DataFrame.plot`. Returns ------- :class:`matplotlib.axes.Axes` or numpy.ndarray of them See Also -------- matplotlib.pyplot.scatter : Scatter plot using multiple input data formats. Examples -------- Let's see how to draw a scatter plot using coordinates from the values in a DataFrame's columns. .. plot:: :context: close-figs >>> df = pd.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1], ... [6.4, 3.2, 1], [5.9, 3.0, 2]], ... columns=['length', 'width', 'species']) >>> ax1 = df.plot.scatter(x='length', ... y='width', ... c='DarkBlue') And now with the color determined by a column as well. .. plot:: :context: close-figs >>> ax2 = df.plot.scatter(x='length', ... y='width', ... c='species', ... colormap='viridis')
[ "Create", "a", "scatter", "plot", "with", "varying", "marker", "point", "size", "and", "color", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core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j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1000001 + 0o56) + chr(0b110010) + chr(49) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10110 + 0o35) + chr(53) + '\060', 0o10), ehT0Px3KOsy9(chr(1542 - 1494) + chr(0b110001 + 0o76) + chr(148 - 98) + chr(253 - 200) + '\060', 0o10), ehT0Px3KOsy9(chr(1725 - 1677) + chr(8813 - 8702) + '\062' + chr(0b110000) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111111 + 0o60) + chr(0b110011) + chr(51) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b110000) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x35' + '\062', 35753 - 35745), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(48) + chr(0b10101 + 0o40), 56402 - 56394), ehT0Px3KOsy9('\060' + chr(0b100010 + 0o115) + chr(52) + chr(1609 - 1559), 0o10), ehT0Px3KOsy9(chr(2055 - 2007) + chr(0b1101100 + 0o3) + chr(0b110100) + chr(0b100110 + 0o14), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + '\x34' + '\x35', 0o10), ehT0Px3KOsy9(chr(1005 - 957) + chr(0b1000000 + 0o57) + chr(0b110010) + chr(0b0 + 0o66) + '\x30', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(1669 - 1620) + chr(0b101111 + 0o6) + chr(100 - 48), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + '\x33' + chr(48) + chr(0b100000 + 0o26), ord("\x08")), ehT0Px3KOsy9('\060' + chr(7679 - 7568) + chr(49) + chr(1390 - 1342) + '\x33', 8), ehT0Px3KOsy9(chr(262 - 214) + chr(0b1101010 + 0o5) + chr(0b110011) + chr(806 - 752) + chr(173 - 120), 0o10), ehT0Px3KOsy9(chr(1255 - 1207) + chr(6411 - 6300) + chr(1502 - 1451) + '\060' + '\x31', 15786 - 15778), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(49) + chr(0b101101 + 0o3), 11043 - 11035), ehT0Px3KOsy9(chr(1906 - 1858) + chr(111) + '\061' + chr(2578 - 2523) + chr(0b110010), 19599 - 19591), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010 + 0o1) + chr(1376 - 1323) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b110001) + chr(0b110010), 8627 - 8619), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(844 - 794) + '\066' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + chr(385 - 335) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(1134 - 1079) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o22) + chr(0b110100), 9600 - 9592), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b110101) + '\065', 8), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + chr(0b110001) + chr(0b110001) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(54) + chr(54), 57463 - 57455), ehT0Px3KOsy9('\x30' + '\157' + '\063' + chr(0b110100) + chr(265 - 210), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b110101) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(8355 - 8244) + '\x32' + chr(0b110101) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x36' + '\065', 51373 - 51365), ehT0Px3KOsy9(chr(387 - 339) + chr(111) + '\063' + chr(0b100011 + 0o22) + '\065', 8), ehT0Px3KOsy9(chr(48) + chr(0b1000011 + 0o54) + '\x32' + '\x32' + chr(119 - 68), 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1100 + 0o143) + chr(980 - 931) + '\067' + '\x37', 0b1000), ehT0Px3KOsy9('\060' + chr(0b110011 + 0o74) + '\x32' + chr(52), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(51) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(1035 - 924) + chr(0b11110 + 0o30) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111 + 0o0) + chr(51) + chr(53) + chr(680 - 632), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + '\065' + chr(48), 36139 - 36131)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7'), '\144' + chr(101) + chr(99) + '\157' + chr(100) + '\x65')('\165' + '\x74' + chr(1398 - 1296) + chr(0b111 + 0o46) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def m0cIOEVV8stJ(oVre8I6UXc3b, OeWW0F1dBPRQ, SqiSOtYOqOJH, vGrByMSYMp9h=None, qzn1Ctg9WgNh=None, **ClrkdavlbKME): return oVre8I6UXc3b(kind=xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa\x8b\xc9\xf0\xa8&X'), chr(0b10001 + 0o123) + '\x65' + '\x63' + chr(0b11001 + 0o126) + '\x64' + '\x65')('\165' + chr(10619 - 10503) + '\x66' + '\x2d' + chr(1622 - 1566)), x=OeWW0F1dBPRQ, y=SqiSOtYOqOJH, c=qzn1Ctg9WgNh, s=vGrByMSYMp9h, **ClrkdavlbKME)
pandas-dev/pandas
pandas/plotting/_core.py
FramePlotMethods.hexbin
def hexbin(self, x, y, C=None, reduce_C_function=None, gridsize=None, **kwds): """ Generate a hexagonal binning plot. Generate a hexagonal binning plot of `x` versus `y`. If `C` is `None` (the default), this is a histogram of the number of occurrences of the observations at ``(x[i], y[i])``. If `C` is specified, specifies values at given coordinates ``(x[i], y[i])``. These values are accumulated for each hexagonal bin and then reduced according to `reduce_C_function`, having as default the NumPy's mean function (:meth:`numpy.mean`). (If `C` is specified, it must also be a 1-D sequence of the same length as `x` and `y`, or a column label.) Parameters ---------- x : int or str The column label or position for x points. y : int or str The column label or position for y points. C : int or str, optional The column label or position for the value of `(x, y)` point. reduce_C_function : callable, default `np.mean` Function of one argument that reduces all the values in a bin to a single number (e.g. `np.mean`, `np.max`, `np.sum`, `np.std`). gridsize : int or tuple of (int, int), default 100 The number of hexagons in the x-direction. The corresponding number of hexagons in the y-direction is chosen in a way that the hexagons are approximately regular. Alternatively, gridsize can be a tuple with two elements specifying the number of hexagons in the x-direction and the y-direction. **kwds Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- matplotlib.AxesSubplot The matplotlib ``Axes`` on which the hexbin is plotted. See Also -------- DataFrame.plot : Make plots of a DataFrame. matplotlib.pyplot.hexbin : Hexagonal binning plot using matplotlib, the matplotlib function that is used under the hood. Examples -------- The following examples are generated with random data from a normal distribution. .. plot:: :context: close-figs >>> n = 10000 >>> df = pd.DataFrame({'x': np.random.randn(n), ... 'y': np.random.randn(n)}) >>> ax = df.plot.hexbin(x='x', y='y', gridsize=20) The next example uses `C` and `np.sum` as `reduce_C_function`. Note that `'observations'` values ranges from 1 to 5 but the result plot shows values up to more than 25. This is because of the `reduce_C_function`. .. plot:: :context: close-figs >>> n = 500 >>> df = pd.DataFrame({ ... 'coord_x': np.random.uniform(-3, 3, size=n), ... 'coord_y': np.random.uniform(30, 50, size=n), ... 'observations': np.random.randint(1,5, size=n) ... }) >>> ax = df.plot.hexbin(x='coord_x', ... y='coord_y', ... C='observations', ... reduce_C_function=np.sum, ... gridsize=10, ... cmap="viridis") """ if reduce_C_function is not None: kwds['reduce_C_function'] = reduce_C_function if gridsize is not None: kwds['gridsize'] = gridsize return self(kind='hexbin', x=x, y=y, C=C, **kwds)
python
def hexbin(self, x, y, C=None, reduce_C_function=None, gridsize=None, **kwds): """ Generate a hexagonal binning plot. Generate a hexagonal binning plot of `x` versus `y`. If `C` is `None` (the default), this is a histogram of the number of occurrences of the observations at ``(x[i], y[i])``. If `C` is specified, specifies values at given coordinates ``(x[i], y[i])``. These values are accumulated for each hexagonal bin and then reduced according to `reduce_C_function`, having as default the NumPy's mean function (:meth:`numpy.mean`). (If `C` is specified, it must also be a 1-D sequence of the same length as `x` and `y`, or a column label.) Parameters ---------- x : int or str The column label or position for x points. y : int or str The column label or position for y points. C : int or str, optional The column label or position for the value of `(x, y)` point. reduce_C_function : callable, default `np.mean` Function of one argument that reduces all the values in a bin to a single number (e.g. `np.mean`, `np.max`, `np.sum`, `np.std`). gridsize : int or tuple of (int, int), default 100 The number of hexagons in the x-direction. The corresponding number of hexagons in the y-direction is chosen in a way that the hexagons are approximately regular. Alternatively, gridsize can be a tuple with two elements specifying the number of hexagons in the x-direction and the y-direction. **kwds Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- matplotlib.AxesSubplot The matplotlib ``Axes`` on which the hexbin is plotted. See Also -------- DataFrame.plot : Make plots of a DataFrame. matplotlib.pyplot.hexbin : Hexagonal binning plot using matplotlib, the matplotlib function that is used under the hood. Examples -------- The following examples are generated with random data from a normal distribution. .. plot:: :context: close-figs >>> n = 10000 >>> df = pd.DataFrame({'x': np.random.randn(n), ... 'y': np.random.randn(n)}) >>> ax = df.plot.hexbin(x='x', y='y', gridsize=20) The next example uses `C` and `np.sum` as `reduce_C_function`. Note that `'observations'` values ranges from 1 to 5 but the result plot shows values up to more than 25. This is because of the `reduce_C_function`. .. plot:: :context: close-figs >>> n = 500 >>> df = pd.DataFrame({ ... 'coord_x': np.random.uniform(-3, 3, size=n), ... 'coord_y': np.random.uniform(30, 50, size=n), ... 'observations': np.random.randint(1,5, size=n) ... }) >>> ax = df.plot.hexbin(x='coord_x', ... y='coord_y', ... C='observations', ... reduce_C_function=np.sum, ... gridsize=10, ... cmap="viridis") """ if reduce_C_function is not None: kwds['reduce_C_function'] = reduce_C_function if gridsize is not None: kwds['gridsize'] = gridsize return self(kind='hexbin', x=x, y=y, C=C, **kwds)
[ "def", "hexbin", "(", "self", ",", "x", ",", "y", ",", "C", "=", "None", ",", "reduce_C_function", "=", "None", ",", "gridsize", "=", "None", ",", "*", "*", "kwds", ")", ":", "if", "reduce_C_function", "is", "not", "None", ":", "kwds", "[", "'reduce_C_function'", "]", "=", "reduce_C_function", "if", "gridsize", "is", "not", "None", ":", "kwds", "[", "'gridsize'", "]", "=", "gridsize", "return", "self", "(", "kind", "=", "'hexbin'", ",", "x", "=", "x", ",", "y", "=", "y", ",", "C", "=", "C", ",", "*", "*", "kwds", ")" ]
Generate a hexagonal binning plot. Generate a hexagonal binning plot of `x` versus `y`. If `C` is `None` (the default), this is a histogram of the number of occurrences of the observations at ``(x[i], y[i])``. If `C` is specified, specifies values at given coordinates ``(x[i], y[i])``. These values are accumulated for each hexagonal bin and then reduced according to `reduce_C_function`, having as default the NumPy's mean function (:meth:`numpy.mean`). (If `C` is specified, it must also be a 1-D sequence of the same length as `x` and `y`, or a column label.) Parameters ---------- x : int or str The column label or position for x points. y : int or str The column label or position for y points. C : int or str, optional The column label or position for the value of `(x, y)` point. reduce_C_function : callable, default `np.mean` Function of one argument that reduces all the values in a bin to a single number (e.g. `np.mean`, `np.max`, `np.sum`, `np.std`). gridsize : int or tuple of (int, int), default 100 The number of hexagons in the x-direction. The corresponding number of hexagons in the y-direction is chosen in a way that the hexagons are approximately regular. Alternatively, gridsize can be a tuple with two elements specifying the number of hexagons in the x-direction and the y-direction. **kwds Additional keyword arguments are documented in :meth:`DataFrame.plot`. Returns ------- matplotlib.AxesSubplot The matplotlib ``Axes`` on which the hexbin is plotted. See Also -------- DataFrame.plot : Make plots of a DataFrame. matplotlib.pyplot.hexbin : Hexagonal binning plot using matplotlib, the matplotlib function that is used under the hood. Examples -------- The following examples are generated with random data from a normal distribution. .. plot:: :context: close-figs >>> n = 10000 >>> df = pd.DataFrame({'x': np.random.randn(n), ... 'y': np.random.randn(n)}) >>> ax = df.plot.hexbin(x='x', y='y', gridsize=20) The next example uses `C` and `np.sum` as `reduce_C_function`. Note that `'observations'` values ranges from 1 to 5 but the result plot shows values up to more than 25. This is because of the `reduce_C_function`. .. plot:: :context: close-figs >>> n = 500 >>> df = pd.DataFrame({ ... 'coord_x': np.random.uniform(-3, 3, size=n), ... 'coord_y': np.random.uniform(30, 50, size=n), ... 'observations': np.random.randint(1,5, size=n) ... }) >>> ax = df.plot.hexbin(x='coord_x', ... y='coord_y', ... C='observations', ... reduce_C_function=np.sum, ... gridsize=10, ... cmap="viridis")
[ "Generate", "a", "hexagonal", "binning", "plot", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_core.py#L3544-L3631
train
Generates a hexagonal binning plot of the given x and y points.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7w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hgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b10010 + 0o45), 15603 - 15595), ehT0Px3KOsy9(chr(114 - 66) + '\157' + chr(0b110110) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(828 - 780) + '\157' + chr(0b110001) + chr(0b110111) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011011 + 0o24) + chr(49) + '\067' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1001011 + 0o44) + chr(0b100101 + 0o14) + chr(49) + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9189 - 9078) + '\061' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + chr(1535 - 1486) + chr(726 - 674) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(793 - 745) + chr(111) + chr(49) + chr(55) + chr(813 - 760), 41432 - 41424), ehT0Px3KOsy9('\x30' + chr(111) + chr(592 - 542) + chr(0b110111) + chr(0b10010 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(1600 - 1489) + chr(55) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100 + 0o57) + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(0b110111 + 0o70) + '\x31' + chr(0b110101) + chr(0b1000 + 0o57), 0o10), ehT0Px3KOsy9(chr(787 - 739) + chr(10162 - 10051) + chr(0b110001) + '\062' + '\063', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + '\065' + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1001 + 0o53) + chr(0b11101 + 0o24), 51804 - 51796), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2204 - 2155) + '\066' + chr(2395 - 2345), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + '\x31' + chr(50), 11202 - 11194), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111) + chr(0b110101) + chr(282 - 230), ord("\x08")), ehT0Px3KOsy9(chr(380 - 332) + '\157' + '\061' + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(825 - 774) + '\x32', 8), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1010 + 0o145) + chr(897 - 846) + chr(0b110100) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(52) + '\x31', 20050 - 20042), ehT0Px3KOsy9(chr(48) + chr(111) + chr(52) + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(398 - 344) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1138 - 1027) + chr(0b110001) + '\x30' + chr(1694 - 1642), 39288 - 39280), ehT0Px3KOsy9(chr(1487 - 1439) + chr(0b1101111) + '\061' + '\061' + chr(0b110110), 32575 - 32567), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(2211 - 2163) + chr(0b1101111) + chr(0b110001) + chr(0b110101) + chr(2454 - 2399), 8), ehT0Px3KOsy9('\x30' + chr(0b111000 + 0o67) + chr(49) + chr(0b110101) + chr(53), 10139 - 10131), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(50) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(2243 - 2195) + chr(0b1100010 + 0o15) + chr(527 - 478) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101000 + 0o107) + chr(0b100000 + 0o21) + chr(0b110110) + chr(935 - 886), ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + '\x32' + chr(52) + '\061', 8), ehT0Px3KOsy9('\x30' + chr(0b100100 + 0o113) + '\065' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1757 - 1707) + '\065' + chr(49), 8), ehT0Px3KOsy9(chr(90 - 42) + chr(6181 - 6070) + chr(0b110001) + chr(932 - 884) + '\062', 52392 - 52384), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(2013 - 1964) + chr(2050 - 1999), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(0b11101 + 0o27) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(1931 - 1882) + chr(0b110000 + 0o1), 16853 - 16845), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(1646 - 1598) + chr(0b10011 + 0o42), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(0b110101) + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'9'), '\x64' + chr(2098 - 1997) + chr(0b1100011) + '\x6f' + '\x64' + '\x65')(chr(117) + chr(10433 - 10317) + '\x66' + chr(45) + chr(377 - 321)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def C_AhoSHYi3xd(oVre8I6UXc3b, OeWW0F1dBPRQ, SqiSOtYOqOJH, GjrcPZV7TjBn=None, jaxUsQ93gAf3=None, mKXW36uCtalY=None, **ClrkdavlbKME): if jaxUsQ93gAf3 is not None: ClrkdavlbKME[xafqLlk3kkUe(SXOLrMavuUCe(b'eP\x18\n,m<>\xe3Xo\x010\xddH\x1d\xe4'), chr(100) + chr(0b110111 + 0o56) + '\143' + '\x6f' + '\x64' + chr(4521 - 4420))(chr(117) + chr(0b1000100 + 0o60) + chr(9791 - 9689) + chr(1547 - 1502) + chr(56))] = jaxUsQ93gAf3 if mKXW36uCtalY is not None: ClrkdavlbKME[xafqLlk3kkUe(SXOLrMavuUCe(b'pG\x15\x1b<a\x19\x18'), '\x64' + chr(4709 - 4608) + '\143' + chr(1444 - 1333) + chr(100) + chr(0b1011011 + 0o12))(chr(0b100000 + 0o125) + chr(0b1110100) + chr(7623 - 7521) + chr(45) + chr(422 - 366))] = mKXW36uCtalY return oVre8I6UXc3b(kind=xafqLlk3kkUe(SXOLrMavuUCe(b'\x7fP\x04\x1d&f'), '\144' + '\x65' + chr(99) + chr(0b1101111) + chr(100) + '\x65')(chr(117) + chr(9843 - 9727) + chr(0b1001010 + 0o34) + '\055' + '\x38'), x=OeWW0F1dBPRQ, y=SqiSOtYOqOJH, C=GjrcPZV7TjBn, **ClrkdavlbKME)
pandas-dev/pandas
pandas/core/indexes/api.py
_get_objs_combined_axis
def _get_objs_combined_axis(objs, intersect=False, axis=0, sort=True): """ Extract combined index: return intersection or union (depending on the value of "intersect") of indexes on given axis, or None if all objects lack indexes (e.g. they are numpy arrays). Parameters ---------- objs : list of objects Each object will only be considered if it has a _get_axis attribute. intersect : bool, default False If True, calculate the intersection between indexes. Otherwise, calculate the union. axis : {0 or 'index', 1 or 'outer'}, default 0 The axis to extract indexes from. sort : bool, default True Whether the result index should come out sorted or not. Returns ------- Index """ obs_idxes = [obj._get_axis(axis) for obj in objs if hasattr(obj, '_get_axis')] if obs_idxes: return _get_combined_index(obs_idxes, intersect=intersect, sort=sort)
python
def _get_objs_combined_axis(objs, intersect=False, axis=0, sort=True): """ Extract combined index: return intersection or union (depending on the value of "intersect") of indexes on given axis, or None if all objects lack indexes (e.g. they are numpy arrays). Parameters ---------- objs : list of objects Each object will only be considered if it has a _get_axis attribute. intersect : bool, default False If True, calculate the intersection between indexes. Otherwise, calculate the union. axis : {0 or 'index', 1 or 'outer'}, default 0 The axis to extract indexes from. sort : bool, default True Whether the result index should come out sorted or not. Returns ------- Index """ obs_idxes = [obj._get_axis(axis) for obj in objs if hasattr(obj, '_get_axis')] if obs_idxes: return _get_combined_index(obs_idxes, intersect=intersect, sort=sort)
[ "def", "_get_objs_combined_axis", "(", "objs", ",", "intersect", "=", "False", ",", "axis", "=", "0", ",", "sort", "=", "True", ")", ":", "obs_idxes", "=", "[", "obj", ".", "_get_axis", "(", "axis", ")", "for", "obj", "in", "objs", "if", "hasattr", "(", "obj", ",", "'_get_axis'", ")", "]", "if", "obs_idxes", ":", "return", "_get_combined_index", "(", "obs_idxes", ",", "intersect", "=", "intersect", ",", "sort", "=", "sort", ")" ]
Extract combined index: return intersection or union (depending on the value of "intersect") of indexes on given axis, or None if all objects lack indexes (e.g. they are numpy arrays). Parameters ---------- objs : list of objects Each object will only be considered if it has a _get_axis attribute. intersect : bool, default False If True, calculate the intersection between indexes. Otherwise, calculate the union. axis : {0 or 'index', 1 or 'outer'}, default 0 The axis to extract indexes from. sort : bool, default True Whether the result index should come out sorted or not. Returns ------- Index
[ "Extract", "combined", "index", ":", "return", "intersection", "or", "union", "(", "depending", "on", "the", "value", "of", "intersect", ")", "of", "indexes", "on", "given", "axis", "or", "None", "if", "all", "objects", "lack", "indexes", "(", "e", ".", "g", ".", "they", "are", "numpy", "arrays", ")", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb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HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1101111) + chr(0b110011) + chr(52) + '\064', 44334 - 44326), ehT0Px3KOsy9(chr(592 - 544) + chr(111) + chr(54) + chr(0b110010), 10422 - 10414), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1000010 + 0o55) + '\063' + '\x35' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(48) + '\066', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110111) + chr(0b10101 + 0o34), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100011 + 0o20) + chr(0b110010) + chr(702 - 650), 43033 - 43025), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b110 + 0o54), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1110 + 0o141) + chr(49) + '\061' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(49) + chr(2113 - 2065) + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(8984 - 8873) + chr(0b101100 + 0o5) + '\x32' + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b110100) + chr(243 - 195), 28462 - 28454), ehT0Px3KOsy9(chr(0b110000) + chr(0b100000 + 0o117) + '\x32' + chr(0b110111) + chr(0b1001 + 0o47), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(574 - 522), 0b1000), ehT0Px3KOsy9('\060' + chr(9350 - 9239) + '\061' + chr(0b110101) + chr(0b101010 + 0o14), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8964 - 8853) + '\062' + '\x34' + chr(1659 - 1611), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(6894 - 6783) + chr(0b110010) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110110) + '\060', 48119 - 48111), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + chr(1423 - 1373) + chr(53) + chr(1056 - 1007), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100110 + 0o13) + chr(0b110110) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b100100 + 0o113) + chr(0b1100 + 0o45) + '\063' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(1811 - 1763) + chr(111) + '\063' + chr(0b110010) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(6889 - 6778) + chr(2059 - 2009) + '\065', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(0b100001 + 0o21) + '\061', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(0b1111 + 0o43) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b10110 + 0o32), 20190 - 20182), ehT0Px3KOsy9(chr(1263 - 1215) + '\157' + '\062' + '\062', 8), ehT0Px3KOsy9(chr(48) + chr(9091 - 8980) + '\063' + '\064' + '\067', 50014 - 50006), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(0b110001) + chr(0b110000) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(52) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b101 + 0o55), 8), ehT0Px3KOsy9(chr(48) + chr(0b110 + 0o151) + '\062' + chr(0b10 + 0o57) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + '\x32' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1010 + 0o51) + chr(53) + chr(0b100110 + 0o13), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(0b101110 + 0o5) + '\x35' + chr(1561 - 1509), 57485 - 57477), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b110001) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + chr(895 - 844) + chr(0b0 + 0o61) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4884 - 4773) + '\x33' + chr(0b0 + 0o62) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(1906 - 1856) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(55) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + '\x32' + '\061' + chr(389 - 338), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(53) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xca'), chr(100) + chr(7043 - 6942) + chr(99) + chr(0b1101111) + chr(100) + chr(0b1000100 + 0o41))(chr(0b111000 + 0o75) + chr(0b111111 + 0o65) + '\x66' + chr(907 - 862) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def S4SPHwx6J5po(RPf1nbYRQtES, LvuFd8jNQc6v=ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + chr(48), 10705 - 10697), cRTh61qyvi24=ehT0Px3KOsy9(chr(579 - 531) + '\157' + '\x30', 8), tlxzdTw4q2JZ=ehT0Px3KOsy9('\x30' + chr(533 - 422) + chr(0b110001), 0o10)): RdvE_ymzTi4Q = [mDuDykdz0pcm._get_axis(cRTh61qyvi24) for mDuDykdz0pcm in RPf1nbYRQtES if lot1PSoAwYhj(mDuDykdz0pcm, xafqLlk3kkUe(SXOLrMavuUCe(b"\xbbU\x8f\xf2\xe6\xb5j'6"), chr(0b1100100) + chr(0b1100101) + '\x63' + '\157' + chr(0b1011111 + 0o5) + '\x65')(chr(7590 - 7473) + chr(0b1110100) + '\146' + chr(0b110 + 0o47) + '\070'))] if RdvE_ymzTi4Q: return mxPOK6rvE_Bi(RdvE_ymzTi4Q, intersect=LvuFd8jNQc6v, sort=tlxzdTw4q2JZ)
pandas-dev/pandas
pandas/core/indexes/api.py
_get_distinct_objs
def _get_distinct_objs(objs): """ Return a list with distinct elements of "objs" (different ids). Preserves order. """ ids = set() res = [] for obj in objs: if not id(obj) in ids: ids.add(id(obj)) res.append(obj) return res
python
def _get_distinct_objs(objs): """ Return a list with distinct elements of "objs" (different ids). Preserves order. """ ids = set() res = [] for obj in objs: if not id(obj) in ids: ids.add(id(obj)) res.append(obj) return res
[ "def", "_get_distinct_objs", "(", "objs", ")", ":", "ids", "=", "set", "(", ")", "res", "=", "[", "]", "for", "obj", "in", "objs", ":", "if", "not", "id", "(", "obj", ")", "in", "ids", ":", "ids", ".", "add", "(", "id", "(", "obj", ")", ")", "res", ".", "append", "(", "obj", ")", "return", "res" ]
Return a list with distinct elements of "objs" (different ids). Preserves order.
[ "Return", "a", "list", "with", "distinct", "elements", "of", "objs", "(", "different", "ids", ")", ".", "Preserves", "order", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/api.py#L73-L84
train
Return a list with distinct elements of objs. Preserves order.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQ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Wzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(48) + chr(2154 - 2101), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b10110 + 0o33) + chr(0b110101), 46881 - 46873), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\067' + chr(0b100010 + 0o24), 0b1000), ehT0Px3KOsy9('\060' + chr(6611 - 6500) + chr(50) + '\x34' + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100110 + 0o111) + chr(256 - 207) + chr(50) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(0b11010 + 0o33) + chr(48), 1685 - 1677), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(0b110001) + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010110 + 0o31) + chr(53) + chr(0b1 + 0o66), 4952 - 4944), ehT0Px3KOsy9(chr(1298 - 1250) + chr(8037 - 7926) + chr(721 - 672) + '\066' + chr(0b10100 + 0o43), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\x36' + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(2117 - 2006) + chr(0b1111 + 0o43) + '\x37' + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101100 + 0o7) + chr(2207 - 2158), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + '\x31' + '\x33' + chr(0b110 + 0o53), 28618 - 28610), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(3854 - 3743) + chr(49) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b111101 + 0o62) + chr(0b110100), 34399 - 34391), ehT0Px3KOsy9('\060' + chr(809 - 698) + chr(685 - 634) + chr(0b11011 + 0o32) + chr(834 - 779), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111) + '\064' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(8814 - 8703) + chr(50) + chr(932 - 878) + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(8675 - 8564) + chr(51) + chr(2579 - 2524) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(1119 - 1071) + chr(111) + '\062' + chr(1014 - 965) + chr(513 - 462), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(5035 - 4924) + '\063' + chr(0b110100) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + chr(50) + chr(48) + '\065', 26282 - 26274), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110110) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1100 + 0o143) + chr(49) + chr(0b110110) + chr(640 - 591), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(2431 - 2376) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(0b110011) + '\x32' + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101011 + 0o7) + chr(0b110011 + 0o3) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10111 + 0o36) + '\x37', 8), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\157' + chr(50) + chr(571 - 523) + '\x33', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(55) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(11882 - 11771) + chr(0b1000 + 0o53) + '\x30' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b101001 + 0o10) + chr(1690 - 1639) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(0b100010 + 0o22) + '\x30', 8), ehT0Px3KOsy9('\x30' + chr(0b100001 + 0o116) + chr(0b110011) + '\x31' + chr(2791 - 2737), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b1011 + 0o45) + chr(1232 - 1180), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + '\x31' + chr(0b110110), 18142 - 18134), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(50) + chr(0b110001), 8), ehT0Px3KOsy9(chr(48) + chr(12229 - 12118) + '\x33' + '\062' + chr(2227 - 2178), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(1439 - 1386) + chr(0b1001 + 0o47), 38461 - 38453)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'k'), '\x64' + '\145' + chr(4222 - 4123) + chr(0b1010000 + 0o37) + '\144' + chr(0b1100101))(chr(0b1110100 + 0o1) + chr(116) + '\146' + chr(1353 - 1308) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def WLXWf4DuIU18(RPf1nbYRQtES): zdjj2pRemk_P = MVEN8G6CxlvR() MsbwfslwLjRO = [] for mDuDykdz0pcm in RPf1nbYRQtES: if not z8EhBlYI2Bx4(mDuDykdz0pcm) in zdjj2pRemk_P: xafqLlk3kkUe(zdjj2pRemk_P, xafqLlk3kkUe(SXOLrMavuUCe(b'$\xa9\xda'), '\x64' + chr(494 - 393) + '\x63' + '\x6f' + chr(100) + chr(101))('\165' + chr(116) + chr(0b1011011 + 0o13) + '\x2d' + chr(0b111000)))(z8EhBlYI2Bx4(mDuDykdz0pcm)) xafqLlk3kkUe(MsbwfslwLjRO, xafqLlk3kkUe(SXOLrMavuUCe(b'$\xbd\xce\xc5;\x8c'), chr(100) + '\145' + chr(99) + '\157' + chr(0b1100100) + chr(0b1011001 + 0o14))('\x75' + '\x74' + chr(0b1100110) + chr(0b100010 + 0o13) + chr(1933 - 1877)))(mDuDykdz0pcm) return MsbwfslwLjRO
pandas-dev/pandas
pandas/core/indexes/api.py
_get_combined_index
def _get_combined_index(indexes, intersect=False, sort=False): """ Return the union or intersection of indexes. Parameters ---------- indexes : list of Index or list objects When intersect=True, do not accept list of lists. intersect : bool, default False If True, calculate the intersection between indexes. Otherwise, calculate the union. sort : bool, default False Whether the result index should come out sorted or not. Returns ------- Index """ # TODO: handle index names! indexes = _get_distinct_objs(indexes) if len(indexes) == 0: index = Index([]) elif len(indexes) == 1: index = indexes[0] elif intersect: index = indexes[0] for other in indexes[1:]: index = index.intersection(other) else: index = _union_indexes(indexes, sort=sort) index = ensure_index(index) if sort: try: index = index.sort_values() except TypeError: pass return index
python
def _get_combined_index(indexes, intersect=False, sort=False): """ Return the union or intersection of indexes. Parameters ---------- indexes : list of Index or list objects When intersect=True, do not accept list of lists. intersect : bool, default False If True, calculate the intersection between indexes. Otherwise, calculate the union. sort : bool, default False Whether the result index should come out sorted or not. Returns ------- Index """ # TODO: handle index names! indexes = _get_distinct_objs(indexes) if len(indexes) == 0: index = Index([]) elif len(indexes) == 1: index = indexes[0] elif intersect: index = indexes[0] for other in indexes[1:]: index = index.intersection(other) else: index = _union_indexes(indexes, sort=sort) index = ensure_index(index) if sort: try: index = index.sort_values() except TypeError: pass return index
[ "def", "_get_combined_index", "(", "indexes", ",", "intersect", "=", "False", ",", "sort", "=", "False", ")", ":", "# TODO: handle index names!", "indexes", "=", "_get_distinct_objs", "(", "indexes", ")", "if", "len", "(", "indexes", ")", "==", "0", ":", "index", "=", "Index", "(", "[", "]", ")", "elif", "len", "(", "indexes", ")", "==", "1", ":", "index", "=", "indexes", "[", "0", "]", "elif", "intersect", ":", "index", "=", "indexes", "[", "0", "]", "for", "other", "in", "indexes", "[", "1", ":", "]", ":", "index", "=", "index", ".", "intersection", "(", "other", ")", "else", ":", "index", "=", "_union_indexes", "(", "indexes", ",", "sort", "=", "sort", ")", "index", "=", "ensure_index", "(", "index", ")", "if", "sort", ":", "try", ":", "index", "=", "index", ".", "sort_values", "(", ")", "except", "TypeError", ":", "pass", "return", "index" ]
Return the union or intersection of indexes. Parameters ---------- indexes : list of Index or list objects When intersect=True, do not accept list of lists. intersect : bool, default False If True, calculate the intersection between indexes. Otherwise, calculate the union. sort : bool, default False Whether the result index should come out sorted or not. Returns ------- Index
[ "Return", "the", "union", "or", "intersection", "of", "indexes", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/api.py#L87-L125
train
Returns the union or intersection of the given list of indexes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,LgE_IO_tHXvM,Kk1hd194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ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110111) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(1976 - 1928) + '\157' + chr(0b100110 + 0o13) + chr(616 - 566) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + chr(0b110010) + chr(0b110110) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b11101 + 0o27) + chr(1956 - 1905), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100011 + 0o114) + chr(474 - 424) + '\067' + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(0b110110) + chr(1292 - 1243), 30139 - 30131), ehT0Px3KOsy9(chr(932 - 884) + chr(9740 - 9629) + chr(2301 - 2251) + '\x37' + '\066', 28189 - 28181), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(51) + chr(0b111 + 0o60), 63333 - 63325), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(0b110011) + '\x37' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + '\x35' + chr(1890 - 1841), 34744 - 34736), ehT0Px3KOsy9(chr(2223 - 2175) + chr(0b10001 + 0o136) + chr(0b110111) + chr(0b110010), 2306 - 2298), ehT0Px3KOsy9('\x30' + chr(111) + chr(1961 - 1912) + chr(0b110110) + '\061', 4088 - 4080), ehT0Px3KOsy9(chr(1634 - 1586) + '\x6f' + chr(589 - 539) + chr(54) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011010 + 0o25) + '\062' + chr(0b110001) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1000 + 0o147) + '\x32' + '\067' + '\x30', 6222 - 6214), ehT0Px3KOsy9(chr(1862 - 1814) + chr(0b1101111) + chr(565 - 516) + chr(0b110110 + 0o1), 0o10), ehT0Px3KOsy9(chr(1472 - 1424) + '\x6f' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10101 + 0o34) + chr(0b11000 + 0o32) + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(1029 - 918) + chr(0b10000 + 0o42) + '\062' + '\x31', 0o10), ehT0Px3KOsy9(chr(1073 - 1025) + '\x6f' + chr(0b110001) + chr(0b1 + 0o57) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063', 0o10), ehT0Px3KOsy9(chr(2161 - 2113) + chr(0b1101111) + '\x33' + '\x33' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2476 - 2425) + chr(54) + chr(588 - 533), 63715 - 63707), ehT0Px3KOsy9('\060' + '\x6f' + chr(2306 - 2256) + '\062' + chr(710 - 657), 0o10), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + '\x33' + chr(2121 - 2067), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + chr(1809 - 1760) + chr(0b110011) + chr(0b11100 + 0o30), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x37' + chr(50), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10101 + 0o36), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101010 + 0o14) + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(263 - 152) + chr(0b110001) + chr(49) + chr(0b110000), 12322 - 12314), ehT0Px3KOsy9(chr(2131 - 2083) + chr(0b1101111) + '\x35' + chr(0b11101 + 0o30), 0o10), ehT0Px3KOsy9(chr(2020 - 1972) + '\x6f' + chr(0b1 + 0o60) + chr(0b1101 + 0o52) + chr(50), 23056 - 23048), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(111) + chr(0b110001) + chr(0b1111 + 0o46) + chr(1995 - 1941), 0o10), ehT0Px3KOsy9(chr(1827 - 1779) + '\157' + '\x32' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101000 + 0o11) + chr(0b1 + 0o65), 560 - 552), ehT0Px3KOsy9(chr(48) + chr(1904 - 1793) + chr(902 - 851) + chr(0b110110) + chr(0b11011 + 0o26), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11110 + 0o27) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + chr(745 - 634) + '\062' + chr(905 - 854), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(111) + chr(0b110001) + '\063' + chr(0b100110 + 0o16), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(0b100 + 0o61) + '\060', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x11'), '\x64' + chr(0b1000010 + 0o43) + chr(6005 - 5906) + chr(111) + chr(321 - 221) + '\145')('\165' + chr(0b1110100) + chr(102) + chr(45) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def mxPOK6rvE_Bi(AjrnLNzw5Jx9, LvuFd8jNQc6v=ehT0Px3KOsy9(chr(219 - 171) + '\157' + chr(0b110000), 0b1000), tlxzdTw4q2JZ=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x30', 8)): AjrnLNzw5Jx9 = WLXWf4DuIU18(AjrnLNzw5Jx9) if c2A0yzQpDQB3(AjrnLNzw5Jx9) == ehT0Px3KOsy9('\060' + chr(7387 - 7276) + chr(0b110000), 8): XdowRbJKZWL9 = EJkE1Nx1bysb([]) elif c2A0yzQpDQB3(AjrnLNzw5Jx9) == ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001), ord("\x08")): XdowRbJKZWL9 = AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(0b110000) + chr(10909 - 10798) + chr(0b10001 + 0o37), 8)] elif LvuFd8jNQc6v: XdowRbJKZWL9 = AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(2185 - 2137) + chr(0b1001111 + 0o40) + chr(286 - 238), 8)] for KK0ERS7DqYrY in AjrnLNzw5Jx9[ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101110 + 0o3), 8):]: XdowRbJKZWL9 = XdowRbJKZWL9.intersection(KK0ERS7DqYrY) else: XdowRbJKZWL9 = ZcF4seQtcWcJ(AjrnLNzw5Jx9, sort=tlxzdTw4q2JZ) XdowRbJKZWL9 = KFvEC5zbP6VW(XdowRbJKZWL9) if tlxzdTw4q2JZ: try: XdowRbJKZWL9 = XdowRbJKZWL9.sort_values() except sznFqDbNBHlx: pass return XdowRbJKZWL9
pandas-dev/pandas
pandas/core/indexes/api.py
_union_indexes
def _union_indexes(indexes, sort=True): """ Return the union of indexes. The behavior of sort and names is not consistent. Parameters ---------- indexes : list of Index or list objects sort : bool, default True Whether the result index should come out sorted or not. Returns ------- Index """ if len(indexes) == 0: raise AssertionError('Must have at least 1 Index to union') if len(indexes) == 1: result = indexes[0] if isinstance(result, list): result = Index(sorted(result)) return result indexes, kind = _sanitize_and_check(indexes) def _unique_indices(inds): """ Convert indexes to lists and concatenate them, removing duplicates. The final dtype is inferred. Parameters ---------- inds : list of Index or list objects Returns ------- Index """ def conv(i): if isinstance(i, Index): i = i.tolist() return i return Index( lib.fast_unique_multiple_list([conv(i) for i in inds], sort=sort)) if kind == 'special': result = indexes[0] if hasattr(result, 'union_many'): return result.union_many(indexes[1:]) else: for other in indexes[1:]: result = result.union(other) return result elif kind == 'array': index = indexes[0] for other in indexes[1:]: if not index.equals(other): if sort is None: # TODO: remove once pd.concat sort default changes warnings.warn(_sort_msg, FutureWarning, stacklevel=8) sort = True return _unique_indices(indexes) name = _get_consensus_names(indexes)[0] if name != index.name: index = index._shallow_copy(name=name) return index else: # kind='list' return _unique_indices(indexes)
python
def _union_indexes(indexes, sort=True): """ Return the union of indexes. The behavior of sort and names is not consistent. Parameters ---------- indexes : list of Index or list objects sort : bool, default True Whether the result index should come out sorted or not. Returns ------- Index """ if len(indexes) == 0: raise AssertionError('Must have at least 1 Index to union') if len(indexes) == 1: result = indexes[0] if isinstance(result, list): result = Index(sorted(result)) return result indexes, kind = _sanitize_and_check(indexes) def _unique_indices(inds): """ Convert indexes to lists and concatenate them, removing duplicates. The final dtype is inferred. Parameters ---------- inds : list of Index or list objects Returns ------- Index """ def conv(i): if isinstance(i, Index): i = i.tolist() return i return Index( lib.fast_unique_multiple_list([conv(i) for i in inds], sort=sort)) if kind == 'special': result = indexes[0] if hasattr(result, 'union_many'): return result.union_many(indexes[1:]) else: for other in indexes[1:]: result = result.union(other) return result elif kind == 'array': index = indexes[0] for other in indexes[1:]: if not index.equals(other): if sort is None: # TODO: remove once pd.concat sort default changes warnings.warn(_sort_msg, FutureWarning, stacklevel=8) sort = True return _unique_indices(indexes) name = _get_consensus_names(indexes)[0] if name != index.name: index = index._shallow_copy(name=name) return index else: # kind='list' return _unique_indices(indexes)
[ "def", "_union_indexes", "(", "indexes", ",", "sort", "=", "True", ")", ":", "if", "len", "(", "indexes", ")", "==", "0", ":", "raise", "AssertionError", "(", "'Must have at least 1 Index to union'", ")", "if", "len", "(", "indexes", ")", "==", "1", ":", "result", "=", "indexes", "[", "0", "]", "if", "isinstance", "(", "result", ",", "list", ")", ":", "result", "=", "Index", "(", "sorted", "(", "result", ")", ")", "return", "result", "indexes", ",", "kind", "=", "_sanitize_and_check", "(", "indexes", ")", "def", "_unique_indices", "(", "inds", ")", ":", "\"\"\"\n Convert indexes to lists and concatenate them, removing duplicates.\n\n The final dtype is inferred.\n\n Parameters\n ----------\n inds : list of Index or list objects\n\n Returns\n -------\n Index\n \"\"\"", "def", "conv", "(", "i", ")", ":", "if", "isinstance", "(", "i", ",", "Index", ")", ":", "i", "=", "i", ".", "tolist", "(", ")", "return", "i", "return", "Index", "(", "lib", ".", "fast_unique_multiple_list", "(", "[", "conv", "(", "i", ")", "for", "i", "in", "inds", "]", ",", "sort", "=", "sort", ")", ")", "if", "kind", "==", "'special'", ":", "result", "=", "indexes", "[", "0", "]", "if", "hasattr", "(", "result", ",", "'union_many'", ")", ":", "return", "result", ".", "union_many", "(", "indexes", "[", "1", ":", "]", ")", "else", ":", "for", "other", "in", "indexes", "[", "1", ":", "]", ":", "result", "=", "result", ".", "union", "(", "other", ")", "return", "result", "elif", "kind", "==", "'array'", ":", "index", "=", "indexes", "[", "0", "]", "for", "other", "in", "indexes", "[", "1", ":", "]", ":", "if", "not", "index", ".", "equals", "(", "other", ")", ":", "if", "sort", "is", "None", ":", "# TODO: remove once pd.concat sort default changes", "warnings", ".", "warn", "(", "_sort_msg", ",", "FutureWarning", ",", "stacklevel", "=", "8", ")", "sort", "=", "True", "return", "_unique_indices", "(", "indexes", ")", "name", "=", "_get_consensus_names", "(", "indexes", ")", "[", "0", "]", "if", "name", "!=", "index", ".", "name", ":", "index", "=", "index", ".", "_shallow_copy", "(", "name", "=", "name", ")", "return", "index", "else", ":", "# kind='list'", "return", "_unique_indices", "(", "indexes", ")" ]
Return the union of indexes. The behavior of sort and names is not consistent. Parameters ---------- indexes : list of Index or list objects sort : bool, default True Whether the result index should come out sorted or not. Returns ------- Index
[ "Return", "the", "union", "of", "indexes", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/api.py#L128-L202
train
Returns the union of the given list of indexes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,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6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\x37' + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(1097 - 1048) + chr(53) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(53) + '\067', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(0b110111) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1101111) + '\x33' + chr(2153 - 2104) + chr(0b100100 + 0o16), 56353 - 56345), ehT0Px3KOsy9(chr(953 - 905) + chr(0b1101111) + chr(0b110010) + chr(0b110000) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1011 + 0o52) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\064' + chr(497 - 447), 0b1000), ehT0Px3KOsy9('\x30' + chr(11269 - 11158) + chr(50) + chr(2588 - 2534) + chr(0b11001 + 0o34), 38288 - 38280), ehT0Px3KOsy9(chr(483 - 435) + chr(12120 - 12009) + '\062' + chr(55) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b110 + 0o151) + chr(0b110010) + chr(51) + chr(0b110111), 48126 - 48118), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + '\x35' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + chr(49) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b1000 + 0o52) + '\x33' + chr(0b11110 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + chr(0b110001) + chr(0b101100 + 0o13) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10100 + 0o35) + chr(2053 - 2005) + chr(2636 - 2581), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(0b101 + 0o53) + chr(0b1110 + 0o45), 28090 - 28082), ehT0Px3KOsy9(chr(813 - 765) + '\x6f' + chr(0b11101 + 0o26) + '\x36' + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(106 - 52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(142 - 92) + chr(0b110111) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011 + 0o144) + chr(0b110010) + '\x31' + chr(50), 8), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + chr(408 - 356) + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b110001) + chr(275 - 221), ord("\x08")), ehT0Px3KOsy9(chr(119 - 71) + chr(4596 - 4485) + '\x31' + chr(0b110010) + '\065', 0o10), ehT0Px3KOsy9(chr(2082 - 2034) + chr(0b1101111) + '\063' + chr(49) + chr(0b110010), 8), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1001111 + 0o40) + chr(0b110011) + chr(0b1101 + 0o43) + '\066', 60044 - 60036), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(53) + '\x33', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10111 + 0o36) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(2594 - 2483) + chr(0b111 + 0o53) + chr(51) + '\063', 8), ehT0Px3KOsy9(chr(412 - 364) + chr(7345 - 7234) + '\066' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1010100 + 0o33) + '\062' + chr(2028 - 1973) + chr(0b100010 + 0o22), 8), ehT0Px3KOsy9(chr(1319 - 1271) + chr(0b111111 + 0o60) + '\x33' + chr(0b1001 + 0o47) + chr(1629 - 1575), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110000 + 0o3) + '\061' + chr(52), 58231 - 58223), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + '\062' + chr(0b110000) + chr(1822 - 1771), 38406 - 38398), ehT0Px3KOsy9(chr(0b110000) + chr(12144 - 12033) + chr(0b1111 + 0o42) + chr(0b101001 + 0o12) + chr(0b110110), 6427 - 6419), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(0b110010) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6892 - 6781) + chr(0b11000 + 0o32) + '\x32' + chr(153 - 99), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b110101), 35693 - 35685), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(525 - 476) + '\x34' + chr(0b1011 + 0o53), 0o10), ehT0Px3KOsy9(chr(1753 - 1705) + chr(111) + chr(0b110001) + chr(0b100011 + 0o22) + chr(0b110110), 34071 - 34063)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(7619 - 7508) + chr(2242 - 2189) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd1'), chr(100) + chr(7002 - 6901) + '\x63' + '\157' + chr(9670 - 9570) + chr(101))('\x75' + '\x74' + chr(102) + chr(45) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ZcF4seQtcWcJ(AjrnLNzw5Jx9, tlxzdTw4q2JZ=ehT0Px3KOsy9(chr(48) + chr(111) + chr(2376 - 2327), ord("\x08"))): if c2A0yzQpDQB3(AjrnLNzw5Jx9) == ehT0Px3KOsy9(chr(0b110000) + chr(0b1011111 + 0o20) + '\x30', 0b1000): raise vcEHXBQXuDuh(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2\x1c\xdc\x0b\xea\xecO\xd4\xd0\x9b\xfe\x1c\xaa\xf7\x1b&0\x86&\x8d\xaal 1\xaf\xbe\x0b]\xf4\x14\xc9\xa8\xa5\xec0'), chr(0b1100100) + '\x65' + chr(3123 - 3024) + chr(0b100101 + 0o112) + chr(100) + '\x65')('\165' + chr(0b1110100) + chr(4600 - 4498) + chr(0b1000 + 0o45) + '\x38')) if c2A0yzQpDQB3(AjrnLNzw5Jx9) == ehT0Px3KOsy9('\x30' + chr(111) + '\x31', 8): ShZmEKfTkAOZ = AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1011001 + 0o26) + '\060', 8)] if PlSM16l2KDPD(ShZmEKfTkAOZ, YyaZ4tpXu4lf): ShZmEKfTkAOZ = EJkE1Nx1bysb(vUlqIvNSaRMa(ShZmEKfTkAOZ)) return ShZmEKfTkAOZ (AjrnLNzw5Jx9, el8JiuKFoeai) = SSZUcObFZuSr(AjrnLNzw5Jx9) def M3Dh72AQhWnu(HP9YF4VVcIuY): def m1sWr00SVpVY(WVxHKyX45z_L): if PlSM16l2KDPD(WVxHKyX45z_L, EJkE1Nx1bysb): WVxHKyX45z_L = WVxHKyX45z_L.tolist() return WVxHKyX45z_L return EJkE1Nx1bysb(xafqLlk3kkUe(JiWVXlj3BjzT, xafqLlk3kkUe(SXOLrMavuUCe(b"\x99\x08\xdc\x0b\x95\xf1@\xcb\xc4\xce\xfa7\xe7\xee\x123*\x82j\xd9\xd5I'&\xbe"), chr(100) + chr(101) + '\x63' + chr(1601 - 1490) + chr(0b1100100) + chr(101))('\165' + chr(0b1110100) + chr(102) + '\x2d' + chr(56)))([m1sWr00SVpVY(WVxHKyX45z_L) for WVxHKyX45z_L in HP9YF4VVcIuY], sort=tlxzdTw4q2JZ)) if el8JiuKFoeai == xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c\x19\xca\x1c\xa3\xe5B'), '\144' + '\145' + '\143' + chr(12124 - 12013) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b101101) + '\x38'): ShZmEKfTkAOZ = AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(48) + chr(0b100110 + 0o111) + '\x30', 8)] if lot1PSoAwYhj(ShZmEKfTkAOZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a\x07\xc6\x10\xa4\xdbC\xc3\xdb\xc2'), '\144' + chr(101) + '\x63' + chr(0b1101111) + chr(100) + '\145')('\x75' + '\x74' + '\146' + '\x2d' + chr(0b111000))): return xafqLlk3kkUe(ShZmEKfTkAOZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a\x07\xc6\x10\xa4\xdbC\xc3\xdb\xc2'), chr(0b1001110 + 0o26) + chr(0b10010 + 0o123) + chr(0b1000110 + 0o35) + chr(111) + chr(0b1100100) + chr(0b101001 + 0o74))(chr(117) + chr(8031 - 7915) + '\x66' + chr(0b101101) + '\x38'))(AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(0b110000) + chr(0b1101011 + 0o4) + chr(49), 8):]) else: for KK0ERS7DqYrY in AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(2320 - 2271), 8):]: ShZmEKfTkAOZ = ShZmEKfTkAOZ.union(KK0ERS7DqYrY) return ShZmEKfTkAOZ elif el8JiuKFoeai == xafqLlk3kkUe(SXOLrMavuUCe(b'\x9e\x1b\xdd\x1e\xb3'), chr(6329 - 6229) + '\145' + '\143' + '\x6f' + chr(100) + chr(101))(chr(1235 - 1118) + '\164' + '\x66' + chr(45) + '\x38'): XdowRbJKZWL9 = AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + chr(1398 - 1350), 8)] for KK0ERS7DqYrY in AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(238 - 190) + chr(0b1101111) + '\061', 8):]: if not xafqLlk3kkUe(XdowRbJKZWL9, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9a\x18\xda\x1e\xa6\xf7'), chr(0b1100100) + chr(101) + '\143' + chr(0b1101111) + '\x64' + '\145')('\x75' + chr(1746 - 1630) + '\146' + chr(0b101101) + '\x38'))(KK0ERS7DqYrY): if tlxzdTw4q2JZ is None: xafqLlk3kkUe(fJoTPf8D_opC, xafqLlk3kkUe(SXOLrMavuUCe(b'\x88\x08\xdd\x11'), '\x64' + '\145' + chr(0b100011 + 0o100) + chr(0b11110 + 0o121) + '\144' + chr(7172 - 7071))(chr(0b1110101) + '\164' + '\146' + chr(45) + chr(2023 - 1967)))(g2mEWSdTYt7Q, VHAt7CcYKC2T, stacklevel=ehT0Px3KOsy9(chr(793 - 745) + chr(111) + '\061' + chr(0b110000), 17661 - 17653)) tlxzdTw4q2JZ = ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001), 8) return M3Dh72AQhWnu(AjrnLNzw5Jx9) AIvJRzLdDfgF = znvfqcl2Li30(AjrnLNzw5Jx9)[ehT0Px3KOsy9('\x30' + chr(9951 - 9840) + chr(48), 8)] if AIvJRzLdDfgF != xafqLlk3kkUe(XdowRbJKZWL9, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe \xd95\x98\xfeb\xc6\xf1\xdd\xf8.'), '\x64' + '\145' + chr(99) + chr(0b1101111) + chr(0b1010000 + 0o24) + chr(0b1100101))(chr(11176 - 11059) + chr(0b1110100) + '\x66' + '\055' + '\x38')): XdowRbJKZWL9 = XdowRbJKZWL9._shallow_copy(name=AIvJRzLdDfgF) return XdowRbJKZWL9 else: return M3Dh72AQhWnu(AjrnLNzw5Jx9)
pandas-dev/pandas
pandas/core/indexes/api.py
_sanitize_and_check
def _sanitize_and_check(indexes): """ Verify the type of indexes and convert lists to Index. Cases: - [list, list, ...]: Return ([list, list, ...], 'list') - [list, Index, ...]: Return _sanitize_and_check([Index, Index, ...]) Lists are sorted and converted to Index. - [Index, Index, ...]: Return ([Index, Index, ...], TYPE) TYPE = 'special' if at least one special type, 'array' otherwise. Parameters ---------- indexes : list of Index or list objects Returns ------- sanitized_indexes : list of Index or list objects type : {'list', 'array', 'special'} """ kinds = list({type(index) for index in indexes}) if list in kinds: if len(kinds) > 1: indexes = [Index(com.try_sort(x)) if not isinstance(x, Index) else x for x in indexes] kinds.remove(list) else: return indexes, 'list' if len(kinds) > 1 or Index not in kinds: return indexes, 'special' else: return indexes, 'array'
python
def _sanitize_and_check(indexes): """ Verify the type of indexes and convert lists to Index. Cases: - [list, list, ...]: Return ([list, list, ...], 'list') - [list, Index, ...]: Return _sanitize_and_check([Index, Index, ...]) Lists are sorted and converted to Index. - [Index, Index, ...]: Return ([Index, Index, ...], TYPE) TYPE = 'special' if at least one special type, 'array' otherwise. Parameters ---------- indexes : list of Index or list objects Returns ------- sanitized_indexes : list of Index or list objects type : {'list', 'array', 'special'} """ kinds = list({type(index) for index in indexes}) if list in kinds: if len(kinds) > 1: indexes = [Index(com.try_sort(x)) if not isinstance(x, Index) else x for x in indexes] kinds.remove(list) else: return indexes, 'list' if len(kinds) > 1 or Index not in kinds: return indexes, 'special' else: return indexes, 'array'
[ "def", "_sanitize_and_check", "(", "indexes", ")", ":", "kinds", "=", "list", "(", "{", "type", "(", "index", ")", "for", "index", "in", "indexes", "}", ")", "if", "list", "in", "kinds", ":", "if", "len", "(", "kinds", ")", ">", "1", ":", "indexes", "=", "[", "Index", "(", "com", ".", "try_sort", "(", "x", ")", ")", "if", "not", "isinstance", "(", "x", ",", "Index", ")", "else", "x", "for", "x", "in", "indexes", "]", "kinds", ".", "remove", "(", "list", ")", "else", ":", "return", "indexes", ",", "'list'", "if", "len", "(", "kinds", ")", ">", "1", "or", "Index", "not", "in", "kinds", ":", "return", "indexes", ",", "'special'", "else", ":", "return", "indexes", ",", "'array'" ]
Verify the type of indexes and convert lists to Index. Cases: - [list, list, ...]: Return ([list, list, ...], 'list') - [list, Index, ...]: Return _sanitize_and_check([Index, Index, ...]) Lists are sorted and converted to Index. - [Index, Index, ...]: Return ([Index, Index, ...], TYPE) TYPE = 'special' if at least one special type, 'array' otherwise. Parameters ---------- indexes : list of Index or list objects Returns ------- sanitized_indexes : list of Index or list objects type : {'list', 'array', 'special'}
[ "Verify", "the", "type", "of", "indexes", "and", "convert", "lists", "to", "Index", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/api.py#L205-L240
train
Verify the type of indexes and convert lists to Index.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S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VJsrp8,tzcpInYwBvYW,iDQ_gSK8V7h0,Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(8249 - 8138) + chr(49) + chr(92 - 40) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(1007 - 896) + chr(1259 - 1209) + chr(50) + chr(2367 - 2318), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b101011 + 0o104) + chr(0b110111), 28575 - 28567), ehT0Px3KOsy9('\x30' + chr(111) + chr(1065 - 1012) + '\x34', 0b1000), ehT0Px3KOsy9(chr(247 - 199) + chr(111) + chr(50) + chr(54) + chr(0b110000), 24930 - 24922), ehT0Px3KOsy9('\x30' + chr(5868 - 5757) + '\061' + '\x34' + chr(0b101011 + 0o7), 44587 - 44579), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b110111) + '\x35', 62757 - 62749), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000101 + 0o52) + chr(50) + chr(0b110010), 7815 - 7807), ehT0Px3KOsy9('\x30' + '\157' + chr(2217 - 2167), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(0b110001) + chr(0b100101 + 0o14) + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b110101) + chr(52), 12132 - 12124), ehT0Px3KOsy9('\x30' + chr(0b1001 + 0o146) + chr(0b1111 + 0o44) + '\x34' + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b110000 + 0o77) + '\062' + chr(53) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(7919 - 7808) + '\x32' + chr(50) + chr(0b1111 + 0o44), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110000 + 0o1), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5240 - 5129) + chr(2078 - 2029) + chr(50) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + '\x33' + '\x37' + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(9240 - 9129) + chr(51) + '\x35' + chr(0b111 + 0o52), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + '\064' + chr(0b110001), 1195 - 1187), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + '\x36' + chr(668 - 619), ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(0b11000 + 0o31) + chr(0b110000) + chr(0b1111 + 0o45), 55402 - 55394), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110111) + '\060', 19732 - 19724), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2269 - 2219) + '\065' + chr(1732 - 1682), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001000 + 0o47) + '\062' + chr(0b1001 + 0o56) + chr(143 - 95), ord("\x08")), ehT0Px3KOsy9(chr(236 - 188) + chr(0b1101111) + chr(866 - 816) + chr(2143 - 2090) + '\063', 8), ehT0Px3KOsy9(chr(63 - 15) + '\x6f' + '\x37' + chr(0b1101 + 0o47), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\066' + chr(929 - 876), 0b1000), ehT0Px3KOsy9(chr(323 - 275) + chr(0b111010 + 0o65) + chr(50) + chr(0b110110), 9579 - 9571), ehT0Px3KOsy9('\060' + '\157' + chr(2152 - 2099) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + chr(0b1100 + 0o53) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10100 + 0o36) + chr(0b110100 + 0o2) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011 + 0o144) + '\x31' + chr(923 - 870) + chr(0b110101), 48629 - 48621), ehT0Px3KOsy9(chr(48) + chr(0b100101 + 0o112) + chr(50) + '\062' + '\061', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(0b110101) + chr(522 - 468), 45230 - 45222), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + '\x36', 8), ehT0Px3KOsy9(chr(0b110000) + chr(6772 - 6661) + chr(0b11101 + 0o24) + chr(0b10011 + 0o40) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + '\061' + '\x32' + chr(0b100111 + 0o13), 0b1000), ehT0Px3KOsy9(chr(935 - 887) + '\157' + chr(2298 - 2248) + chr(587 - 534) + chr(523 - 473), 8), ehT0Px3KOsy9(chr(1139 - 1091) + chr(3380 - 3269) + chr(0b110001) + chr(0b101110 + 0o4), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + '\061' + chr(49) + '\063', 30846 - 30838)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(10386 - 10275) + chr(53) + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'K'), '\144' + chr(3297 - 3196) + chr(0b100010 + 0o101) + chr(0b11100 + 0o123) + '\x64' + chr(0b1100101))('\165' + chr(326 - 210) + chr(6696 - 6594) + chr(899 - 854) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def SSZUcObFZuSr(AjrnLNzw5Jx9): deTKmlCBZ4cX = YyaZ4tpXu4lf({wmQmyeWBmUpv(XdowRbJKZWL9) for XdowRbJKZWL9 in AjrnLNzw5Jx9}) if YyaZ4tpXu4lf in deTKmlCBZ4cX: if c2A0yzQpDQB3(deTKmlCBZ4cX) > ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001), 8): AjrnLNzw5Jx9 = [EJkE1Nx1bysb(CDQ27PYjPxZQ.try_sort(OeWW0F1dBPRQ)) if not PlSM16l2KDPD(OeWW0F1dBPRQ, EJkE1Nx1bysb) else OeWW0F1dBPRQ for OeWW0F1dBPRQ in AjrnLNzw5Jx9] xafqLlk3kkUe(deTKmlCBZ4cX, xafqLlk3kkUe(SXOLrMavuUCe(b'\x17\xf4jC\xc6\x07'), chr(0b1100100) + chr(0b110110 + 0o57) + chr(0b1100011) + '\x6f' + chr(100) + chr(0b1100101))('\x75' + chr(7338 - 7222) + chr(0b1100000 + 0o6) + chr(0b11000 + 0o25) + '\x38'))(YyaZ4tpXu4lf) else: return (AjrnLNzw5Jx9, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xf8tX'), chr(0b1011111 + 0o5) + '\x65' + '\x63' + chr(0b110100 + 0o73) + chr(0b1100100) + chr(0b1100101))(chr(0b1011001 + 0o34) + chr(0b1110100) + '\146' + '\x2d' + '\x38')) if c2A0yzQpDQB3(deTKmlCBZ4cX) > ehT0Px3KOsy9('\060' + '\157' + '\x31', 8) or EJkE1Nx1bysb not in deTKmlCBZ4cX: return (AjrnLNzw5Jx9, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\xe1bO\xd9\x03\x11'), chr(0b1100100 + 0o0) + chr(5249 - 5148) + chr(0b1011011 + 0o10) + chr(11698 - 11587) + chr(0b101010 + 0o72) + chr(5043 - 4942))(chr(0b1110101) + chr(8961 - 8845) + '\x66' + chr(842 - 797) + '\070')) else: return (AjrnLNzw5Jx9, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\xe3uM\xc9'), '\x64' + chr(0b1100101) + chr(652 - 553) + '\157' + '\144' + '\145')('\165' + chr(116) + chr(102) + chr(0b101101) + '\070'))
pandas-dev/pandas
pandas/core/indexes/api.py
_get_consensus_names
def _get_consensus_names(indexes): """ Give a consensus 'names' to indexes. If there's exactly one non-empty 'names', return this, otherwise, return empty. Parameters ---------- indexes : list of Index objects Returns ------- list A list representing the consensus 'names' found. """ # find the non-none names, need to tupleify to make # the set hashable, then reverse on return consensus_names = {tuple(i.names) for i in indexes if com._any_not_none(*i.names)} if len(consensus_names) == 1: return list(list(consensus_names)[0]) return [None] * indexes[0].nlevels
python
def _get_consensus_names(indexes): """ Give a consensus 'names' to indexes. If there's exactly one non-empty 'names', return this, otherwise, return empty. Parameters ---------- indexes : list of Index objects Returns ------- list A list representing the consensus 'names' found. """ # find the non-none names, need to tupleify to make # the set hashable, then reverse on return consensus_names = {tuple(i.names) for i in indexes if com._any_not_none(*i.names)} if len(consensus_names) == 1: return list(list(consensus_names)[0]) return [None] * indexes[0].nlevels
[ "def", "_get_consensus_names", "(", "indexes", ")", ":", "# find the non-none names, need to tupleify to make", "# the set hashable, then reverse on return", "consensus_names", "=", "{", "tuple", "(", "i", ".", "names", ")", "for", "i", "in", "indexes", "if", "com", ".", "_any_not_none", "(", "*", "i", ".", "names", ")", "}", "if", "len", "(", "consensus_names", ")", "==", "1", ":", "return", "list", "(", "list", "(", "consensus_names", ")", "[", "0", "]", ")", "return", "[", "None", "]", "*", "indexes", "[", "0", "]", ".", "nlevels" ]
Give a consensus 'names' to indexes. If there's exactly one non-empty 'names', return this, otherwise, return empty. Parameters ---------- indexes : list of Index objects Returns ------- list A list representing the consensus 'names' found.
[ "Give", "a", "consensus", "names", "to", "indexes", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/api.py#L243-L266
train
Returns a list of consensus names for the given indexes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9Y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B3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10101 + 0o36) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(0b110011) + '\065' + chr(776 - 722), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(1379 - 1326) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(54) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + '\061' + '\x30', 9751 - 9743), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(53) + chr(0b110010 + 0o2), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(54) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110000 + 0o2) + chr(54) + chr(0b11011 + 0o32), 5345 - 5337), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\x31' + chr(997 - 942), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b110100) + chr(906 - 855), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(48) + chr(1693 - 1643), ord("\x08")), ehT0Px3KOsy9(chr(1968 - 1920) + '\x6f' + chr(0b10110 + 0o35) + chr(49) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(0b11110 + 0o25) + '\x32', 0o10), ehT0Px3KOsy9(chr(2184 - 2136) + chr(111) + chr(49) + chr(2090 - 2039) + '\x31', 1616 - 1608), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2647 - 2592) + chr(49), 31152 - 31144), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b110100 + 0o73) + '\x32' + chr(51) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(1310 - 1261) + chr(1072 - 1019), 47963 - 47955), ehT0Px3KOsy9(chr(1221 - 1173) + chr(287 - 176) + chr(0b10100 + 0o37) + '\063' + chr(0b110110), 18202 - 18194), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b1101 + 0o45) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1000 + 0o147) + chr(2520 - 2469) + '\064', 28986 - 28978), ehT0Px3KOsy9('\060' + '\x6f' + chr(1726 - 1676) + chr(0b10010 + 0o44) + '\065', 8), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101 + 0o55) + chr(0b11010 + 0o26) + chr(2303 - 2251), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(473 - 421) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b110011) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(673 - 625) + chr(0b1101111) + chr(579 - 528) + chr(0b110111) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(0b101100 + 0o103) + chr(49) + chr(2051 - 1996) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(661 - 613) + chr(0b1101111) + chr(0b110010) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1777 - 1729) + '\157' + chr(0b110101) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b111101 + 0o62) + chr(50) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(0b100010 + 0o115) + '\063' + chr(1916 - 1868) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\065' + chr(0b110000), 28120 - 28112), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + chr(0b110001) + chr(0b110100) + chr(0b110100), 29028 - 29020), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2033 - 1983) + '\060', 0o10), ehT0Px3KOsy9(chr(750 - 702) + chr(111) + chr(831 - 777) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(1891 - 1842) + chr(0b110111) + '\x36', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b101000 + 0o14) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(0b110100) + chr(0b1 + 0o63), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100111 + 0o14) + '\060' + chr(0b11000 + 0o34), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(176 - 127) + chr(51) + chr(0b100 + 0o63), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(55) + chr(275 - 223), 40418 - 40410)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b111010 + 0o65) + '\x35' + '\x30', 62787 - 62779)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'0'), chr(0b1100100) + chr(101) + chr(99) + '\157' + chr(100) + chr(0b1100101))('\165' + '\164' + chr(3863 - 3761) + '\x2d' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def znvfqcl2Li30(AjrnLNzw5Jx9): AwO1_ufKquKM = {KNyTy8rYcwji(WVxHKyX45z_L.OcnR1hZ7pGdr) for WVxHKyX45z_L in AjrnLNzw5Jx9 if CDQ27PYjPxZQ._any_not_none(*WVxHKyX45z_L.OcnR1hZ7pGdr)} if c2A0yzQpDQB3(AwO1_ufKquKM) == ehT0Px3KOsy9('\x30' + '\157' + chr(49), 37504 - 37496): return YyaZ4tpXu4lf(YyaZ4tpXu4lf(AwO1_ufKquKM)[ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110000), 0o10)]) return [None] * xafqLlk3kkUe(AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + chr(1062 - 1014), 8)], xafqLlk3kkUe(SXOLrMavuUCe(b'p\x82\x0bE\xad\x00\x84'), chr(0b1100100) + chr(0b1100101) + chr(99) + '\x6f' + '\144' + chr(101))('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b10011 + 0o32) + '\x38'))
pandas-dev/pandas
pandas/core/indexes/api.py
_all_indexes_same
def _all_indexes_same(indexes): """ Determine if all indexes contain the same elements. Parameters ---------- indexes : list of Index objects Returns ------- bool True if all indexes contain the same elements, False otherwise. """ first = indexes[0] for index in indexes[1:]: if not first.equals(index): return False return True
python
def _all_indexes_same(indexes): """ Determine if all indexes contain the same elements. Parameters ---------- indexes : list of Index objects Returns ------- bool True if all indexes contain the same elements, False otherwise. """ first = indexes[0] for index in indexes[1:]: if not first.equals(index): return False return True
[ "def", "_all_indexes_same", "(", "indexes", ")", ":", "first", "=", "indexes", "[", "0", "]", "for", "index", "in", "indexes", "[", "1", ":", "]", ":", "if", "not", "first", ".", "equals", "(", "index", ")", ":", "return", "False", "return", "True" ]
Determine if all indexes contain the same elements. Parameters ---------- indexes : list of Index objects Returns ------- bool True if all indexes contain the same elements, False otherwise.
[ "Determine", "if", "all", "indexes", "contain", "the", "same", "elements", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/api.py#L269-L286
train
Determines if all indexes contain the same elements.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEO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mQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101111 + 0o3) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2550 - 2499) + chr(0b110110) + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(8886 - 8775) + chr(0b101000 + 0o14) + chr(768 - 717), 0b1000), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + chr(2052 - 2003) + '\060' + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(51) + chr(1578 - 1530), 0b1000), ehT0Px3KOsy9(chr(1537 - 1489) + chr(3778 - 3667) + chr(0b110100) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10 + 0o155) + chr(0b110011) + '\065' + chr(2139 - 2087), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11 + 0o57) + chr(528 - 478) + chr(53), 6152 - 6144), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1166 - 1116) + chr(49) + chr(0b101100 + 0o5), 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1101111) + chr(51) + '\x36' + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\x33' + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001 + 0o2) + chr(1900 - 1847) + chr(2682 - 2629), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1010100 + 0o33) + '\061' + chr(2299 - 2250) + '\065', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b110100 + 0o73) + chr(1718 - 1668) + chr(0b110000) + chr(1218 - 1165), ord("\x08")), ehT0Px3KOsy9(chr(1620 - 1572) + chr(7691 - 7580) + chr(1046 - 997) + '\067' + chr(49), 52675 - 52667), ehT0Px3KOsy9('\x30' + chr(0b1011101 + 0o22) + '\061' + chr(0b101111 + 0o7) + '\064', 13346 - 13338), ehT0Px3KOsy9(chr(0b110000) + chr(1869 - 1758) + '\063' + chr(766 - 718) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4488 - 4377) + chr(0b110001) + chr(1081 - 1031) + chr(0b10 + 0o65), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b101001 + 0o106) + chr(0b110011) + chr(543 - 494) + '\x33', 59987 - 59979), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(54) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100010 + 0o21) + '\063' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(2378 - 2329) + '\x30' + chr(2250 - 2201), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b110100) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(1552 - 1504) + chr(2728 - 2617) + chr(0b100001 + 0o21) + chr(51) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011000 + 0o27) + '\061' + chr(0b1000 + 0o52) + '\x37', 8), ehT0Px3KOsy9(chr(2037 - 1989) + chr(9699 - 9588) + '\x31' + chr(53) + '\x37', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(0b101000 + 0o10) + chr(0b1010 + 0o47), 8), ehT0Px3KOsy9('\x30' + chr(0b1010 + 0o145) + '\063' + chr(0b101 + 0o60) + chr(740 - 691), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + '\067' + chr(2602 - 2547), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110 + 0o53) + chr(1076 - 1022), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11001 + 0o35) + chr(0b100100 + 0o22), 0o10), ehT0Px3KOsy9('\x30' + chr(0b11111 + 0o120) + chr(238 - 189) + chr(0b10101 + 0o40) + '\065', 0o10), ehT0Px3KOsy9('\x30' + chr(0b100 + 0o153) + chr(158 - 103), 13693 - 13685), ehT0Px3KOsy9(chr(0b110000) + chr(8070 - 7959) + chr(575 - 520) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(1402 - 1353) + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(0b1000111 + 0o50) + '\x32' + chr(0b110001) + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(0b110001) + chr(2224 - 2176), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b11101 + 0o24) + chr(2257 - 2205), 57815 - 57807), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + chr(51) + chr(0b110000) + chr(0b11010 + 0o34), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + '\062' + chr(662 - 614), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10010 + 0o43) + chr(0b11000 + 0o30), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'='), chr(0b1100 + 0o130) + chr(101) + chr(0b1100011) + chr(0b110110 + 0o71) + chr(0b1100100) + '\x65')(chr(117) + chr(116) + '\146' + chr(45) + chr(0b110110 + 0o2)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ATmrh0suWvUi(AjrnLNzw5Jx9): It1LJs8swHZQ = AjrnLNzw5Jx9[ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1000011 + 0o54) + '\x30', 9117 - 9109)] for XdowRbJKZWL9 in AjrnLNzw5Jx9[ehT0Px3KOsy9('\060' + '\x6f' + '\061', ord("\x08")):]: if not xafqLlk3kkUe(It1LJs8swHZQ, xafqLlk3kkUe(SXOLrMavuUCe(b'v\x86V$4W'), chr(0b11110 + 0o106) + '\x65' + '\143' + chr(0b101001 + 0o106) + chr(0b110 + 0o136) + chr(5487 - 5386))(chr(117) + chr(10610 - 10494) + chr(102) + chr(0b1010 + 0o43) + '\x38'))(XdowRbJKZWL9): return ehT0Px3KOsy9(chr(0b110000) + chr(0b1000000 + 0o57) + '\060', 8) return ehT0Px3KOsy9(chr(0b110000) + chr(0b110110 + 0o71) + chr(0b110001), 8)
pandas-dev/pandas
pandas/io/sql.py
_convert_params
def _convert_params(sql, params): """Convert SQL and params args to DBAPI2.0 compliant format.""" args = [sql] if params is not None: if hasattr(params, 'keys'): # test if params is a mapping args += [params] else: args += [list(params)] return args
python
def _convert_params(sql, params): """Convert SQL and params args to DBAPI2.0 compliant format.""" args = [sql] if params is not None: if hasattr(params, 'keys'): # test if params is a mapping args += [params] else: args += [list(params)] return args
[ "def", "_convert_params", "(", "sql", ",", "params", ")", ":", "args", "=", "[", "sql", "]", "if", "params", "is", "not", "None", ":", "if", "hasattr", "(", "params", ",", "'keys'", ")", ":", "# test if params is a mapping", "args", "+=", "[", "params", "]", "else", ":", "args", "+=", "[", "list", "(", "params", ")", "]", "return", "args" ]
Convert SQL and params args to DBAPI2.0 compliant format.
[ "Convert", "SQL", "and", "params", "args", "to", "DBAPI2", ".", "0", "compliant", "format", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L57-L65
train
Convert SQL and params args to DBAPI2. 0 compliant format.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb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h,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\157' + chr(0b110001 + 0o4) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(997 - 949) + chr(5922 - 5811) + chr(0b10011 + 0o36) + chr(0b11000 + 0o33) + '\067', 0o10), ehT0Px3KOsy9(chr(1454 - 1406) + chr(2893 - 2782) + chr(0b110001) + '\x30' + chr(0b11001 + 0o32), 46584 - 46576), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b110001) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10001 + 0o136) + chr(50) + chr(1249 - 1198) + chr(0b11101 + 0o27), 56765 - 56757), ehT0Px3KOsy9(chr(331 - 283) + chr(111) + chr(51) + chr(0b101101 + 0o12) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100010 + 0o115) + '\x33' + chr(50) + chr(0b11000 + 0o30), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(1728 - 1680) + chr(53), 16553 - 16545), ehT0Px3KOsy9(chr(445 - 397) + chr(8611 - 8500) + '\x31' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b10000 + 0o43) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3548 - 3437) + chr(0b110001) + '\062' + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\061' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + '\062' + chr(204 - 151), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b100000 + 0o117) + '\x31' + '\x32' + chr(0b110010), 8), ehT0Px3KOsy9('\x30' + '\157' + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(4053 - 3942) + chr(54) + '\x37', 61947 - 61939), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1001 + 0o146) + chr(815 - 765) + chr(2356 - 2305) + chr(930 - 877), 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(293 - 243) + chr(270 - 216) + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1 + 0o63) + chr(0b100011 + 0o17), 38942 - 38934), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(1289 - 1240) + chr(0b101111 + 0o3), 8), ehT0Px3KOsy9('\060' + chr(0b1000 + 0o147) + '\061' + chr(0b1 + 0o60), 0o10), ehT0Px3KOsy9(chr(1113 - 1065) + '\157' + chr(0b101 + 0o60) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + '\x32' + chr(0b110101) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010101 + 0o32) + '\067' + chr(285 - 237), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(794 - 746) + '\065', 9473 - 9465), ehT0Px3KOsy9(chr(227 - 179) + '\x6f' + '\067' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + '\x32' + '\065' + chr(0b11 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(7370 - 7259) + '\x33' + '\x34' + chr(1608 - 1554), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(0b110 + 0o55) + chr(0b110010) + chr(0b101111 + 0o2), 52325 - 52317), ehT0Px3KOsy9(chr(0b110000) + chr(0b1110 + 0o141) + chr(0b110001) + chr(54), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\x32' + chr(48), 58028 - 58020), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(1258 - 1203) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(12082 - 11971) + chr(0b101000 + 0o12) + chr(1798 - 1746) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(0b11000 + 0o127) + chr(0b110001) + '\x34' + chr(103 - 53), 6472 - 6464), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111 + 0o0) + '\061' + '\x32' + chr(0b1010 + 0o51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3784 - 3673) + chr(0b110100) + chr(1483 - 1435), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101010 + 0o7) + chr(54) + '\063', 0b1000), ehT0Px3KOsy9(chr(1143 - 1095) + '\x6f' + chr(0b11 + 0o63) + chr(0b101000 + 0o11), ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + chr(0b110011) + '\x34' + chr(0b110001), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(53) + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x03'), chr(0b100111 + 0o75) + chr(0b1100101) + '\x63' + chr(0b1101111) + '\x64' + '\145')(chr(117) + chr(0b1100001 + 0o23) + chr(0b1100110) + chr(0b1010 + 0o43) + chr(0b10 + 0o66)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Q7IKiRWSu9En(GWXd4kBaViZK, nEbJZ4wfte2w): kJDRfRhcZHjS = [GWXd4kBaViZK] if nEbJZ4wfte2w is not None: if lot1PSoAwYhj(nEbJZ4wfte2w, xafqLlk3kkUe(SXOLrMavuUCe(b'F::\xf9'), '\144' + chr(0b110101 + 0o60) + chr(812 - 713) + chr(0b1111 + 0o140) + chr(0b1100100) + '\145')(chr(117) + chr(0b101000 + 0o114) + '\x66' + '\x2d' + chr(2942 - 2886))): kJDRfRhcZHjS += [nEbJZ4wfte2w] else: kJDRfRhcZHjS += [YyaZ4tpXu4lf(nEbJZ4wfte2w)] return kJDRfRhcZHjS
pandas-dev/pandas
pandas/io/sql.py
_process_parse_dates_argument
def _process_parse_dates_argument(parse_dates): """Process parse_dates argument for read_sql functions""" # handle non-list entries for parse_dates gracefully if parse_dates is True or parse_dates is None or parse_dates is False: parse_dates = [] elif not hasattr(parse_dates, '__iter__'): parse_dates = [parse_dates] return parse_dates
python
def _process_parse_dates_argument(parse_dates): """Process parse_dates argument for read_sql functions""" # handle non-list entries for parse_dates gracefully if parse_dates is True or parse_dates is None or parse_dates is False: parse_dates = [] elif not hasattr(parse_dates, '__iter__'): parse_dates = [parse_dates] return parse_dates
[ "def", "_process_parse_dates_argument", "(", "parse_dates", ")", ":", "# handle non-list entries for parse_dates gracefully", "if", "parse_dates", "is", "True", "or", "parse_dates", "is", "None", "or", "parse_dates", "is", "False", ":", "parse_dates", "=", "[", "]", "elif", "not", "hasattr", "(", "parse_dates", ",", "'__iter__'", ")", ":", "parse_dates", "=", "[", "parse_dates", "]", "return", "parse_dates" ]
Process parse_dates argument for read_sql functions
[ "Process", "parse_dates", "argument", "for", "read_sql", "functions" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L68-L76
train
Process parse_dates argument for read_sql functions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvh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,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(437 - 389) + chr(111) + chr(84 - 34) + '\x35' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(6017 - 5906) + chr(50) + '\062' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(48) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b11101 + 0o122) + chr(0b10001 + 0o40) + chr(0b110100) + chr(230 - 178), 62365 - 62357), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\157' + chr(50) + '\063' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(51) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\x35' + chr(54), 30510 - 30502), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110110 + 0o0) + chr(49), 43446 - 43438), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + '\061' + chr(0b110001) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(417 - 364) + chr(0b100010 + 0o25), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(0b11011 + 0o33) + '\060', 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + '\x31' + chr(460 - 412) + chr(0b1101 + 0o45), ord("\x08")), ehT0Px3KOsy9(chr(2032 - 1984) + chr(2216 - 2105) + chr(0b100001 + 0o20) + chr(52) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b100110 + 0o13) + '\065', 0o10), ehT0Px3KOsy9(chr(1658 - 1610) + chr(0b1101111) + chr(2170 - 2119) + '\x36' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(505 - 457) + chr(0b1101010 + 0o5) + chr(0b110001) + '\x35' + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1716 - 1668) + chr(10805 - 10694) + chr(0b100 + 0o55) + '\x31' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011110 + 0o21) + '\061' + chr(50) + chr(318 - 269), 10679 - 10671), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001011 + 0o44) + '\062' + chr(0b1011 + 0o45) + '\063', 0o10), ehT0Px3KOsy9(chr(1935 - 1887) + '\157' + chr(1351 - 1300) + '\067' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(2056 - 2008) + chr(0b1101111) + chr(2480 - 2430) + '\064' + chr(1878 - 1828), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x34' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(50) + chr(50), 29564 - 29556), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(0b110011) + chr(0b100011 + 0o21), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101101 + 0o2) + chr(0b1000 + 0o52) + chr(0b110011) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101010 + 0o7) + '\x35' + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101010 + 0o5) + chr(0b110 + 0o54) + chr(54), 4738 - 4730), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b110100) + '\060', 5767 - 5759), ehT0Px3KOsy9('\060' + chr(111) + chr(1137 - 1087) + '\061' + chr(51), 0b1000), ehT0Px3KOsy9(chr(1822 - 1774) + chr(0b1011011 + 0o24) + '\x32' + '\x35' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(3294 - 3183) + chr(97 - 45) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(8655 - 8544) + chr(0b110001) + chr(50) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101111 + 0o100) + chr(0b110001) + chr(0b110111) + '\065', 14316 - 14308), ehT0Px3KOsy9('\x30' + chr(0b11111 + 0o120) + chr(0b10100 + 0o36) + chr(2786 - 2733) + chr(50), 55130 - 55122), ehT0Px3KOsy9(chr(0b110000) + chr(8221 - 8110) + chr(0b110001) + chr(997 - 948) + '\060', 49509 - 49501), ehT0Px3KOsy9('\060' + chr(0b11000 + 0o127) + '\065' + '\x37', 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + '\x34', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110100 + 0o1) + chr(0b11000 + 0o30), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x85'), chr(2338 - 2238) + '\x65' + chr(0b1100011) + chr(111) + '\144' + chr(101))(chr(117) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Vdob_8esVEbU(T1brfYV34pPD): if T1brfYV34pPD is ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100101 + 0o14), 0o10) or T1brfYV34pPD is None or T1brfYV34pPD is ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110000), 0b1000): T1brfYV34pPD = [] elif not lot1PSoAwYhj(T1brfYV34pPD, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf4\xcc\xad\x10\xff\xab\xf1n'), chr(0b1100100) + chr(0b110011 + 0o62) + chr(99) + chr(3636 - 3525) + chr(0b101100 + 0o70) + chr(101))(chr(5125 - 5008) + '\164' + chr(0b1010000 + 0o26) + chr(0b101101) + '\070')): T1brfYV34pPD = [T1brfYV34pPD] return T1brfYV34pPD
pandas-dev/pandas
pandas/io/sql.py
_parse_date_columns
def _parse_date_columns(data_frame, parse_dates): """ Force non-datetime columns to be read as such. Supports both string formatted and integer timestamp columns. """ parse_dates = _process_parse_dates_argument(parse_dates) # we want to coerce datetime64_tz dtypes for now to UTC # we could in theory do a 'nice' conversion from a FixedOffset tz # GH11216 for col_name, df_col in data_frame.iteritems(): if is_datetime64tz_dtype(df_col) or col_name in parse_dates: try: fmt = parse_dates[col_name] except TypeError: fmt = None data_frame[col_name] = _handle_date_column(df_col, format=fmt) return data_frame
python
def _parse_date_columns(data_frame, parse_dates): """ Force non-datetime columns to be read as such. Supports both string formatted and integer timestamp columns. """ parse_dates = _process_parse_dates_argument(parse_dates) # we want to coerce datetime64_tz dtypes for now to UTC # we could in theory do a 'nice' conversion from a FixedOffset tz # GH11216 for col_name, df_col in data_frame.iteritems(): if is_datetime64tz_dtype(df_col) or col_name in parse_dates: try: fmt = parse_dates[col_name] except TypeError: fmt = None data_frame[col_name] = _handle_date_column(df_col, format=fmt) return data_frame
[ "def", "_parse_date_columns", "(", "data_frame", ",", "parse_dates", ")", ":", "parse_dates", "=", "_process_parse_dates_argument", "(", "parse_dates", ")", "# we want to coerce datetime64_tz dtypes for now to UTC", "# we could in theory do a 'nice' conversion from a FixedOffset tz", "# GH11216", "for", "col_name", ",", "df_col", "in", "data_frame", ".", "iteritems", "(", ")", ":", "if", "is_datetime64tz_dtype", "(", "df_col", ")", "or", "col_name", "in", "parse_dates", ":", "try", ":", "fmt", "=", "parse_dates", "[", "col_name", "]", "except", "TypeError", ":", "fmt", "=", "None", "data_frame", "[", "col_name", "]", "=", "_handle_date_column", "(", "df_col", ",", "format", "=", "fmt", ")", "return", "data_frame" ]
Force non-datetime columns to be read as such. Supports both string formatted and integer timestamp columns.
[ "Force", "non", "-", "datetime", "columns", "to", "be", "read", "as", "such", ".", "Supports", "both", "string", "formatted", "and", "integer", "timestamp", "columns", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L98-L116
train
Convert datetime columns to datetime columns.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,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ZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(670 - 559) + '\x32' + chr(0b10001 + 0o43), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + '\x34' + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1480 - 1431) + chr(53) + chr(1838 - 1789), 5396 - 5388), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(320 - 267) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + '\066' + chr(629 - 580), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + '\x30' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(0b10100 + 0o43) + '\x37', 56026 - 56018), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + '\x31' + chr(0b0 + 0o63) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3343 - 3232) + '\x31' + '\062' + chr(0b101110 + 0o7), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(1312 - 1257) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011111 + 0o20) + chr(0b110001) + '\x30' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4611 - 4500) + chr(0b110010) + chr(932 - 881) + chr(2547 - 2493), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(53) + chr(49), 24712 - 24704), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(10997 - 10886) + '\061' + chr(2201 - 2153) + '\062', 51523 - 51515), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b110010) + chr(1826 - 1772), ord("\x08")), ehT0Px3KOsy9(chr(2183 - 2135) + '\157' + chr(0b110110) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + chr(0b101011 + 0o10) + chr(1011 - 963) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(920 - 871) + '\x33' + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(0b100010 + 0o17) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(180 - 131) + '\x36' + '\x30', 0b1000), ehT0Px3KOsy9(chr(612 - 564) + chr(0b1101111) + '\x32' + chr(0b110100 + 0o1) + chr(1413 - 1358), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(306 - 257) + chr(0b1010 + 0o51) + '\x33', 0b1000), ehT0Px3KOsy9(chr(516 - 468) + '\157' + chr(50) + '\x31' + chr(2304 - 2253), ord("\x08")), ehT0Px3KOsy9(chr(1721 - 1673) + chr(111) + '\062' + '\x33' + '\060', 0b1000), ehT0Px3KOsy9(chr(1335 - 1287) + chr(5810 - 5699) + chr(0b110011) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(52) + '\062', 47943 - 47935), ehT0Px3KOsy9('\060' + chr(5793 - 5682) + chr(2209 - 2158) + chr(50) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(1344 - 1233) + '\063' + chr(0b101110 + 0o7) + chr(1773 - 1724), 8), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b10110 + 0o131) + chr(2338 - 2288) + chr(50) + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110001) + '\064', 8), ehT0Px3KOsy9('\060' + chr(0b10011 + 0o134) + chr(54) + chr(262 - 210), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(51) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\065' + '\065', 59762 - 59754), ehT0Px3KOsy9('\060' + '\x6f' + chr(2587 - 2536) + chr(0b101000 + 0o12) + '\x31', 19087 - 19079), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(3133 - 3022) + '\066' + chr(56 - 7), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10100 + 0o36) + chr(0b110110) + chr(0b1011 + 0o53), 35461 - 35453), ehT0Px3KOsy9(chr(1272 - 1224) + chr(0b1101111) + chr(0b1110 + 0o45) + chr(0b110001) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(2120 - 2072) + chr(0b1101111) + chr(0b110011) + chr(49) + chr(155 - 101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(3392 - 3281) + chr(0b110011) + chr(53) + chr(0b100101 + 0o20), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1859 - 1811) + chr(8500 - 8389) + '\x35' + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b':'), '\144' + chr(0b100000 + 0o105) + chr(3729 - 3630) + '\x6f' + chr(100) + chr(0b1100101))(chr(13147 - 13030) + chr(0b100110 + 0o116) + chr(102) + chr(45) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def uaSIiXgQwR6N(LjRoUgiSNWXh, T1brfYV34pPD): T1brfYV34pPD = Vdob_8esVEbU(T1brfYV34pPD) for (W93rymQCbozJ, lhzRzl6zabVS) in xafqLlk3kkUe(LjRoUgiSNWXh, xafqLlk3kkUe(SXOLrMavuUCe(b'}\x93\x0c\x9bX4\xda1&'), chr(0b1100100) + chr(5366 - 5265) + chr(0b1100011) + chr(111) + chr(100) + '\145')(chr(0b1110101) + chr(1376 - 1260) + chr(3118 - 3016) + chr(0b101101) + chr(56)))(): if WU585kKowDKQ(lhzRzl6zabVS) or W93rymQCbozJ in T1brfYV34pPD: try: EwDuvMM18jq4 = T1brfYV34pPD[W93rymQCbozJ] except sznFqDbNBHlx: EwDuvMM18jq4 = None LjRoUgiSNWXh[W93rymQCbozJ] = XJ3YiAnKRkOa(lhzRzl6zabVS, format=EwDuvMM18jq4) return LjRoUgiSNWXh
pandas-dev/pandas
pandas/io/sql.py
_wrap_result
def _wrap_result(data, columns, index_col=None, coerce_float=True, parse_dates=None): """Wrap result set of query in a DataFrame.""" frame = DataFrame.from_records(data, columns=columns, coerce_float=coerce_float) frame = _parse_date_columns(frame, parse_dates) if index_col is not None: frame.set_index(index_col, inplace=True) return frame
python
def _wrap_result(data, columns, index_col=None, coerce_float=True, parse_dates=None): """Wrap result set of query in a DataFrame.""" frame = DataFrame.from_records(data, columns=columns, coerce_float=coerce_float) frame = _parse_date_columns(frame, parse_dates) if index_col is not None: frame.set_index(index_col, inplace=True) return frame
[ "def", "_wrap_result", "(", "data", ",", "columns", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "parse_dates", "=", "None", ")", ":", "frame", "=", "DataFrame", ".", "from_records", "(", "data", ",", "columns", "=", "columns", ",", "coerce_float", "=", "coerce_float", ")", "frame", "=", "_parse_date_columns", "(", "frame", ",", "parse_dates", ")", "if", "index_col", "is", "not", "None", ":", "frame", ".", "set_index", "(", "index_col", ",", "inplace", "=", "True", ")", "return", "frame" ]
Wrap result set of query in a DataFrame.
[ "Wrap", "result", "set", "of", "query", "in", "a", "DataFrame", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L119-L131
train
Wrap result set of query in a DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,h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_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + '\063' + chr(0b110111) + chr(0b101 + 0o53), 31517 - 31509), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b10 + 0o63) + chr(0b110001), 7393 - 7385), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\x31', 23799 - 23791), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(1085 - 1032) + '\x31', 8), ehT0Px3KOsy9(chr(48) + chr(0b1011111 + 0o20) + chr(0b110011) + chr(0b110000) + chr(294 - 245), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010011 + 0o34) + chr(49) + chr(1104 - 1051) + chr(50), 0o10), ehT0Px3KOsy9(chr(636 - 588) + '\x6f' + chr(830 - 776) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(12228 - 12117) + chr(691 - 642) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001 + 0o0) + '\064' + '\x35', 0b1000), ehT0Px3KOsy9(chr(1090 - 1042) + '\157' + chr(0b10 + 0o61) + '\062' + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100110 + 0o13) + chr(2324 - 2269) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(172 - 124) + chr(0b110001 + 0o76) + '\x36' + '\066', 19621 - 19613), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(677 - 628) + chr(0b110000) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(8031 - 7920) + '\061' + chr(51) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(1131 - 1083) + '\157' + chr(0b1100 + 0o46) + chr(0b11010 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(1965 - 1917) + chr(4266 - 4155) + chr(51) + chr(50) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(2079 - 2031) + '\157' + chr(0b110011) + '\x30' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(6348 - 6237) + chr(50) + chr(0b10110 + 0o32) + chr(52), 60978 - 60970), ehT0Px3KOsy9(chr(48) + chr(111) + chr(733 - 682) + chr(0b110011) + chr(979 - 924), 30213 - 30205), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(52) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + '\x33' + '\x33', 0b1000), ehT0Px3KOsy9(chr(1080 - 1032) + chr(0b1101111) + chr(0b110011) + chr(0b101110 + 0o5) + chr(1850 - 1795), 8), ehT0Px3KOsy9(chr(2020 - 1972) + chr(0b1101111) + chr(49) + chr(0b100011 + 0o24) + chr(1214 - 1161), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b1001 + 0o56) + chr(2041 - 1991), 50138 - 50130), ehT0Px3KOsy9(chr(2252 - 2204) + chr(111) + '\061' + chr(53) + chr(0b11010 + 0o35), 0o10), ehT0Px3KOsy9('\060' + chr(0b11 + 0o154) + '\x33' + '\x33' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b10111 + 0o130) + chr(0b100100 + 0o15) + chr(0b11011 + 0o34) + chr(814 - 765), 24301 - 24293), ehT0Px3KOsy9(chr(266 - 218) + chr(0b11000 + 0o127) + chr(0b11101 + 0o26) + '\x37' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1990 - 1942) + chr(8259 - 8148) + chr(1880 - 1829) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1010 + 0o50) + '\063' + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(191 - 141) + chr(300 - 250) + chr(229 - 177), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(1527 - 1475) + chr(2065 - 2016), 0b1000), ehT0Px3KOsy9('\060' + chr(9853 - 9742) + '\061' + chr(52) + '\064', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100010 + 0o15) + chr(0b110001) + chr(0b110010) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(111) + '\062' + chr(0b100111 + 0o16) + chr(2246 - 2197), 0o10), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(0b1 + 0o62) + chr(0b110100) + chr(2160 - 2110), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(52), 0o10), ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + chr(1162 - 1111) + chr(0b110000 + 0o3) + '\x33', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b110100 + 0o73) + '\065' + chr(48), 8319 - 8311)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6'), chr(100) + chr(9141 - 9040) + chr(8314 - 8215) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(0b1000001 + 0o64) + '\x74' + chr(0b1100110) + chr(657 - 612) + chr(1254 - 1198)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def jDdYdl3hJF1x(ULnjp6D6efFH, qKlXBtn3PKy4, o90TMYhFhMm_=None, hyGdBsLYkQVS=ehT0Px3KOsy9(chr(48) + chr(0b101000 + 0o107) + '\x31', 8), T1brfYV34pPD=None): C4IqNNmLfHXB = TTWbaLX2VikC.from_records(ULnjp6D6efFH, columns=qKlXBtn3PKy4, coerce_float=hyGdBsLYkQVS) C4IqNNmLfHXB = uaSIiXgQwR6N(C4IqNNmLfHXB, T1brfYV34pPD) if o90TMYhFhMm_ is not None: xafqLlk3kkUe(C4IqNNmLfHXB, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8b\x0ce6\xa8\x04Ul\x1d'), '\144' + chr(1813 - 1712) + chr(0b101101 + 0o66) + '\157' + chr(2975 - 2875) + '\x65')('\165' + '\164' + chr(102) + chr(0b11010 + 0o23) + chr(0b111000)))(o90TMYhFhMm_, inplace=ehT0Px3KOsy9(chr(0b110000) + chr(1621 - 1510) + chr(0b11 + 0o56), 8)) return C4IqNNmLfHXB
pandas-dev/pandas
pandas/io/sql.py
execute
def execute(sql, con, cur=None, params=None): """ Execute the given SQL query using the provided connection object. Parameters ---------- sql : string SQL query to be executed. con : SQLAlchemy connectable(engine/connection) or sqlite3 connection Using SQLAlchemy makes it possible to use any DB supported by the library. If a DBAPI2 object, only sqlite3 is supported. cur : deprecated, cursor is obtained from connection, default: None params : list or tuple, optional, default: None List of parameters to pass to execute method. Returns ------- Results Iterable """ if cur is None: pandas_sql = pandasSQL_builder(con) else: pandas_sql = pandasSQL_builder(cur, is_cursor=True) args = _convert_params(sql, params) return pandas_sql.execute(*args)
python
def execute(sql, con, cur=None, params=None): """ Execute the given SQL query using the provided connection object. Parameters ---------- sql : string SQL query to be executed. con : SQLAlchemy connectable(engine/connection) or sqlite3 connection Using SQLAlchemy makes it possible to use any DB supported by the library. If a DBAPI2 object, only sqlite3 is supported. cur : deprecated, cursor is obtained from connection, default: None params : list or tuple, optional, default: None List of parameters to pass to execute method. Returns ------- Results Iterable """ if cur is None: pandas_sql = pandasSQL_builder(con) else: pandas_sql = pandasSQL_builder(cur, is_cursor=True) args = _convert_params(sql, params) return pandas_sql.execute(*args)
[ "def", "execute", "(", "sql", ",", "con", ",", "cur", "=", "None", ",", "params", "=", "None", ")", ":", "if", "cur", "is", "None", ":", "pandas_sql", "=", "pandasSQL_builder", "(", "con", ")", "else", ":", "pandas_sql", "=", "pandasSQL_builder", "(", "cur", ",", "is_cursor", "=", "True", ")", "args", "=", "_convert_params", "(", "sql", ",", "params", ")", "return", "pandas_sql", ".", "execute", "(", "*", "args", ")" ]
Execute the given SQL query using the provided connection object. Parameters ---------- sql : string SQL query to be executed. con : SQLAlchemy connectable(engine/connection) or sqlite3 connection Using SQLAlchemy makes it possible to use any DB supported by the library. If a DBAPI2 object, only sqlite3 is supported. cur : deprecated, cursor is obtained from connection, default: None params : list or tuple, optional, default: None List of parameters to pass to execute method. Returns ------- Results Iterable
[ "Execute", "the", "given", "SQL", "query", "using", "the", "provided", "connection", "object", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L134-L159
train
Execute a SQL query using the provided connection object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTst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tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + '\x33' + chr(0b1010 + 0o55) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3550 - 3439) + chr(2429 - 2378) + chr(0b110110 + 0o0) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(53) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(11760 - 11649) + chr(50) + chr(0b110011) + chr(0b10110 + 0o35), 15766 - 15758), ehT0Px3KOsy9('\060' + chr(597 - 486) + '\062' + chr(0b101101 + 0o11) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + chr(447 - 397) + chr(743 - 694) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(226 - 177) + '\060' + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(6775 - 6664) + '\x31' + '\060' + '\063', 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101 + 0o142) + chr(0b110001) + chr(48) + chr(0b110010), 18237 - 18229), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(911 - 862) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101001 + 0o6) + chr(0b11000 + 0o34) + chr(227 - 172), 0o10), ehT0Px3KOsy9('\060' + chr(5591 - 5480) + chr(1012 - 962) + chr(52) + chr(48), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110 + 0o57) + chr(529 - 480), 0o10), ehT0Px3KOsy9(chr(578 - 530) + '\x6f' + chr(49) + chr(49) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100110 + 0o15) + chr(490 - 439) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(574 - 526) + chr(0b1101000 + 0o7) + '\063' + chr(0b100101 + 0o17) + chr(1209 - 1156), 45518 - 45510), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10011 + 0o36) + '\064' + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1100001 + 0o16) + chr(51) + chr(820 - 765) + '\067', 0b1000), ehT0Px3KOsy9('\060' + chr(2560 - 2449) + '\063' + chr(0b100110 + 0o14), 8), ehT0Px3KOsy9(chr(0b110000) + chr(11155 - 11044) + '\063' + chr(2085 - 2037) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + chr(0b1110 + 0o45) + chr(1881 - 1833), 20888 - 20880), ehT0Px3KOsy9(chr(1043 - 995) + chr(0b1101111) + chr(51) + '\x35' + chr(0b11010 + 0o27), 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + chr(2357 - 2306) + chr(417 - 367) + chr(0b110110), 48990 - 48982), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b110101) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(0b0 + 0o157) + chr(51) + chr(55) + '\060', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\065' + chr(51), 64136 - 64128), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100101 + 0o12) + chr(1981 - 1931) + '\x36' + chr(82 - 29), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\064' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(166 - 118) + chr(2754 - 2643) + '\x31' + chr(55) + chr(0b1011 + 0o53), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(53) + '\x36', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100000 + 0o17) + '\x36' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + chr(1896 - 1847) + chr(51) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101001 + 0o10) + '\x32' + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(48) + chr(2459 - 2408), 27491 - 27483), ehT0Px3KOsy9(chr(861 - 813) + '\x6f' + '\061' + chr(0b110111) + chr(0b11010 + 0o26), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110101) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100110 + 0o11) + '\x32' + chr(50) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(0b110010) + chr(48), 8), ehT0Px3KOsy9(chr(1781 - 1733) + chr(4114 - 4003) + chr(0b10111 + 0o34) + '\x34' + chr(0b10011 + 0o40), 21054 - 21046)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101011 + 0o4) + chr(1209 - 1156) + chr(0b110000), 34091 - 34083)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7'), chr(3760 - 3660) + chr(101) + chr(99) + chr(4474 - 4363) + chr(185 - 85) + chr(0b1011011 + 0o12))(chr(5155 - 5038) + '\x74' + chr(7226 - 7124) + chr(0b101101) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def TaiENS9_ww2W(GWXd4kBaViZK, _sqfVuM76EP3, wL6S4kgnTowq=None, nEbJZ4wfte2w=None): if wL6S4kgnTowq is None: Re4ydlckRnKx = Hm7TAp8orHi4(_sqfVuM76EP3) else: Re4ydlckRnKx = Hm7TAp8orHi4(wL6S4kgnTowq, is_cursor=ehT0Px3KOsy9(chr(994 - 946) + chr(111) + '\061', 0b1000)) kJDRfRhcZHjS = Q7IKiRWSu9En(GWXd4kBaViZK, nEbJZ4wfte2w) return xafqLlk3kkUe(Re4ydlckRnKx, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9cb\x96\r\xee\xc2\xee'), chr(0b1001 + 0o133) + '\145' + chr(5468 - 5369) + '\x6f' + '\144' + chr(101))('\165' + chr(116) + '\x66' + '\055' + chr(0b101101 + 0o13)))(*kJDRfRhcZHjS)
pandas-dev/pandas
pandas/io/sql.py
read_sql_table
def read_sql_table(table_name, con, schema=None, index_col=None, coerce_float=True, parse_dates=None, columns=None, chunksize=None): """ Read SQL database table into a DataFrame. Given a table name and a SQLAlchemy connectable, returns a DataFrame. This function does not support DBAPI connections. Parameters ---------- table_name : str Name of SQL table in database. con : SQLAlchemy connectable or str A database URI could be provided as as str. SQLite DBAPI connection mode not supported. schema : str, default None Name of SQL schema in database to query (if database flavor supports this). Uses default schema if None (default). index_col : str or list of str, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : bool, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. Can result in loss of Precision. parse_dates : list or dict, default None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. columns : list, default None List of column names to select from SQL table. chunksize : int, default None If specified, returns an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame A SQL table is returned as two-dimensional data structure with labeled axes. See Also -------- read_sql_query : Read SQL query into a DataFrame. read_sql : Read SQL query or database table into a DataFrame. Notes ----- Any datetime values with time zone information will be converted to UTC. Examples -------- >>> pd.read_sql_table('table_name', 'postgres:///db_name') # doctest:+SKIP """ con = _engine_builder(con) if not _is_sqlalchemy_connectable(con): raise NotImplementedError("read_sql_table only supported for " "SQLAlchemy connectable.") import sqlalchemy from sqlalchemy.schema import MetaData meta = MetaData(con, schema=schema) try: meta.reflect(only=[table_name], views=True) except sqlalchemy.exc.InvalidRequestError: raise ValueError("Table {name} not found".format(name=table_name)) pandas_sql = SQLDatabase(con, meta=meta) table = pandas_sql.read_table( table_name, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates, columns=columns, chunksize=chunksize) if table is not None: return table else: raise ValueError("Table {name} not found".format(name=table_name), con)
python
def read_sql_table(table_name, con, schema=None, index_col=None, coerce_float=True, parse_dates=None, columns=None, chunksize=None): """ Read SQL database table into a DataFrame. Given a table name and a SQLAlchemy connectable, returns a DataFrame. This function does not support DBAPI connections. Parameters ---------- table_name : str Name of SQL table in database. con : SQLAlchemy connectable or str A database URI could be provided as as str. SQLite DBAPI connection mode not supported. schema : str, default None Name of SQL schema in database to query (if database flavor supports this). Uses default schema if None (default). index_col : str or list of str, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : bool, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. Can result in loss of Precision. parse_dates : list or dict, default None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. columns : list, default None List of column names to select from SQL table. chunksize : int, default None If specified, returns an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame A SQL table is returned as two-dimensional data structure with labeled axes. See Also -------- read_sql_query : Read SQL query into a DataFrame. read_sql : Read SQL query or database table into a DataFrame. Notes ----- Any datetime values with time zone information will be converted to UTC. Examples -------- >>> pd.read_sql_table('table_name', 'postgres:///db_name') # doctest:+SKIP """ con = _engine_builder(con) if not _is_sqlalchemy_connectable(con): raise NotImplementedError("read_sql_table only supported for " "SQLAlchemy connectable.") import sqlalchemy from sqlalchemy.schema import MetaData meta = MetaData(con, schema=schema) try: meta.reflect(only=[table_name], views=True) except sqlalchemy.exc.InvalidRequestError: raise ValueError("Table {name} not found".format(name=table_name)) pandas_sql = SQLDatabase(con, meta=meta) table = pandas_sql.read_table( table_name, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates, columns=columns, chunksize=chunksize) if table is not None: return table else: raise ValueError("Table {name} not found".format(name=table_name), con)
[ "def", "read_sql_table", "(", "table_name", ",", "con", ",", "schema", "=", "None", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "parse_dates", "=", "None", ",", "columns", "=", "None", ",", "chunksize", "=", "None", ")", ":", "con", "=", "_engine_builder", "(", "con", ")", "if", "not", "_is_sqlalchemy_connectable", "(", "con", ")", ":", "raise", "NotImplementedError", "(", "\"read_sql_table only supported for \"", "\"SQLAlchemy connectable.\"", ")", "import", "sqlalchemy", "from", "sqlalchemy", ".", "schema", "import", "MetaData", "meta", "=", "MetaData", "(", "con", ",", "schema", "=", "schema", ")", "try", ":", "meta", ".", "reflect", "(", "only", "=", "[", "table_name", "]", ",", "views", "=", "True", ")", "except", "sqlalchemy", ".", "exc", ".", "InvalidRequestError", ":", "raise", "ValueError", "(", "\"Table {name} not found\"", ".", "format", "(", "name", "=", "table_name", ")", ")", "pandas_sql", "=", "SQLDatabase", "(", "con", ",", "meta", "=", "meta", ")", "table", "=", "pandas_sql", ".", "read_table", "(", "table_name", ",", "index_col", "=", "index_col", ",", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ",", "columns", "=", "columns", ",", "chunksize", "=", "chunksize", ")", "if", "table", "is", "not", "None", ":", "return", "table", "else", ":", "raise", "ValueError", "(", "\"Table {name} not found\"", ".", "format", "(", "name", "=", "table_name", ")", ",", "con", ")" ]
Read SQL database table into a DataFrame. Given a table name and a SQLAlchemy connectable, returns a DataFrame. This function does not support DBAPI connections. Parameters ---------- table_name : str Name of SQL table in database. con : SQLAlchemy connectable or str A database URI could be provided as as str. SQLite DBAPI connection mode not supported. schema : str, default None Name of SQL schema in database to query (if database flavor supports this). Uses default schema if None (default). index_col : str or list of str, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : bool, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. Can result in loss of Precision. parse_dates : list or dict, default None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. columns : list, default None List of column names to select from SQL table. chunksize : int, default None If specified, returns an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame A SQL table is returned as two-dimensional data structure with labeled axes. See Also -------- read_sql_query : Read SQL query into a DataFrame. read_sql : Read SQL query or database table into a DataFrame. Notes ----- Any datetime values with time zone information will be converted to UTC. Examples -------- >>> pd.read_sql_table('table_name', 'postgres:///db_name') # doctest:+SKIP
[ "Read", "SQL", "database", "table", "into", "a", "DataFrame", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L165-L244
train
Reads a SQL table into a DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,Om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ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b101 + 0o152) + chr(0b110010) + chr(1314 - 1266), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b110000) + chr(0b1011 + 0o52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100011 + 0o114) + '\x33' + chr(2344 - 2289) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(0b10101 + 0o132) + '\061' + '\x33' + chr(54), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101010 + 0o12) + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(52) + chr(0b110000 + 0o0), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1828 - 1777) + '\x33' + chr(1851 - 1798), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(808 - 753), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110000 + 0o77) + '\063' + chr(0b10001 + 0o42) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(934 - 880) + chr(0b100010 + 0o22), 61365 - 61357), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1100101 + 0o12) + '\062' + chr(0b110011) + '\x31', 0b1000), ehT0Px3KOsy9(chr(671 - 623) + '\157' + chr(50) + chr(558 - 504) + chr(0b0 + 0o66), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(52) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x34' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(2292 - 2244) + chr(0b100110 + 0o111) + chr(462 - 413) + chr(1722 - 1671) + '\x36', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b110011) + chr(0b110000), 56434 - 56426), ehT0Px3KOsy9(chr(48) + chr(111) + chr(352 - 303) + chr(51) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010 + 0o1) + chr(0b100100 + 0o16) + '\061', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\063' + '\x32', 8), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(0b10100 + 0o36) + chr(0b110001) + chr(2469 - 2418), 61066 - 61058), ehT0Px3KOsy9(chr(48) + chr(2433 - 2322) + chr(0b110000 + 0o6) + chr(0b100001 + 0o23), 8), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101 + 0o142) + chr(0b110011) + '\x32' + chr(55), 48686 - 48678), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(51) + '\060', 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1176 - 1127) + chr(51) + chr(48), 8), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + '\x31' + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(2005 - 1952) + chr(588 - 536), 0b1000), ehT0Px3KOsy9(chr(1957 - 1909) + chr(7503 - 7392) + '\x33' + chr(0b110001) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\066', 0b1000), ehT0Px3KOsy9(chr(1976 - 1928) + chr(0b111 + 0o150) + chr(51) + chr(0b101011 + 0o10) + '\067', 0b1000), ehT0Px3KOsy9(chr(190 - 142) + chr(1083 - 972) + '\x32' + '\x31' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(111) + chr(51) + '\x31' + chr(304 - 250), 0o10), ehT0Px3KOsy9(chr(2203 - 2155) + '\157' + chr(0b110011) + chr(52) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(10304 - 10193) + chr(263 - 214) + '\x32' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(0b11010 + 0o34) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(2045 - 1997) + chr(0b1101111) + chr(0b110010) + chr(193 - 139), ord("\x08")), ehT0Px3KOsy9(chr(1009 - 961) + chr(111) + '\063' + chr(0b1 + 0o61) + '\063', 0o10), ehT0Px3KOsy9(chr(814 - 766) + chr(5063 - 4952) + '\x33' + '\x30' + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10110 + 0o41) + chr(2804 - 2749), 25285 - 25277), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\062' + '\x33', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + chr(53) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'>'), chr(100) + chr(101) + '\143' + chr(0b1000101 + 0o52) + chr(0b1100100) + chr(6073 - 5972))('\165' + chr(0b1001100 + 0o50) + '\146' + chr(0b11110 + 0o17) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def M3E5bfIV8rX_(NKKFbr2Z4sr1, _sqfVuM76EP3, P7DmIFVRivx6=None, o90TMYhFhMm_=None, hyGdBsLYkQVS=ehT0Px3KOsy9('\x30' + chr(3554 - 3443) + chr(0b110001), 8), T1brfYV34pPD=None, qKlXBtn3PKy4=None, op94qe_Rdjul=None): _sqfVuM76EP3 = NcAk05ebjpoG(_sqfVuM76EP3) if not Q1dJV0ss0eny(_sqfVuM76EP3): raise _zJ24Vce7wp0(xafqLlk3kkUe(SXOLrMavuUCe(b"b \x9b:y\x93\xack\x85@\xf8\xd4\x8eA~74\xbdx\xfa\xf8A\xa7(7x\x18\xaez\xff\xea\xa1\x91vdG\x9f\x81S\xb0x \x97'\x06\x83\xb2i\xb4Q\xfa\xc2\x83F2=t"), '\144' + chr(2482 - 2381) + chr(8723 - 8624) + chr(0b1101111) + chr(100) + '\145')(chr(5529 - 5412) + chr(0b1110100) + '\146' + chr(879 - 834) + chr(0b111000))) (PiAb9sTkjfM_,) = (jFWsnpHpAUWz(xafqLlk3kkUe(SXOLrMavuUCe(b'c4\x96?J\x83\xb5b\xb7M'), '\x64' + chr(5531 - 5430) + '\143' + chr(0b1101111) + chr(168 - 68) + chr(0b100 + 0o141))(chr(117) + chr(116) + chr(0b101010 + 0o74) + chr(45) + chr(1475 - 1419))),) (cIx8kvPtdxPd,) = (xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'c4\x96?J\x83\xb5b\xb7M\xb7\xc5\x81L;5;'), chr(3416 - 3316) + chr(0b1100101) + '\x63' + chr(111) + chr(0b1100100) + chr(101))('\x75' + '\x74' + chr(0b1100110) + chr(1395 - 1350) + chr(0b100001 + 0o27)), xafqLlk3kkUe(SXOLrMavuUCe(b'] \x8e?b\x81\xa9f'), chr(100) + chr(3122 - 3021) + chr(99) + chr(0b1101111) + chr(2596 - 2496) + '\x65')(chr(0b1110101) + '\164' + chr(0b100000 + 0o106) + chr(961 - 916) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'c&\x92;K\x81'), '\144' + chr(1834 - 1733) + chr(99) + '\x6f' + chr(100) + chr(0b111011 + 0o52))(chr(0b1110101) + chr(0b1110100) + chr(0b1001111 + 0o27) + chr(1287 - 1242) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'] \x8e?b\x81\xa9f'), chr(0b1011110 + 0o6) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(100) + '\145')(chr(2819 - 2702) + '\x74' + '\x66' + chr(45) + '\x38')),) Ddxy_ihdYXS3 = cIx8kvPtdxPd(_sqfVuM76EP3, schema=P7DmIFVRivx6) try: xafqLlk3kkUe(Ddxy_ihdYXS3, xafqLlk3kkUe(SXOLrMavuUCe(b'b \x9c2C\x83\xa9'), chr(0b11011 + 0o111) + '\x65' + '\143' + chr(111) + chr(0b1110 + 0o126) + '\145')('\165' + chr(0b1110100) + chr(0b100011 + 0o103) + '\x2d' + '\x38'))(only=[NKKFbr2Z4sr1], views=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061', 8)) except xafqLlk3kkUe(PiAb9sTkjfM_.exc, xafqLlk3kkUe(SXOLrMavuUCe(b'Y+\x8c?J\x89\xb9U\xbfE\xec\xd3\x91P\x1b*(\xbes'), '\144' + chr(0b101100 + 0o71) + chr(0b1100011) + chr(10983 - 10872) + chr(100) + chr(0b11 + 0o142))(chr(12058 - 11941) + chr(826 - 710) + chr(0b10011 + 0o123) + chr(270 - 225) + chr(0b111000))): raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'D$\x982C\xc0\xa6i\xbbY\xfc\xcb\xc2J1,z\xb7n\xaf\xe5P'), chr(100) + chr(101) + '\143' + chr(111) + '\144' + '\145')(chr(3440 - 3323) + chr(0b1110100) + chr(102) + chr(45) + chr(0b110101 + 0o3)), xafqLlk3kkUe(SXOLrMavuUCe(b'v*\x883G\x94'), chr(3702 - 3602) + '\x65' + chr(99) + chr(0b1100001 + 0o16) + '\x64' + '\145')(chr(117) + '\164' + chr(102) + chr(591 - 546) + chr(0b11 + 0o65)))(name=NKKFbr2Z4sr1)) Re4ydlckRnKx = APbCRgLa2CC0(_sqfVuM76EP3, meta=Ddxy_ihdYXS3) YbLi4ide0_3E = Re4ydlckRnKx.read_table(NKKFbr2Z4sr1, index_col=o90TMYhFhMm_, coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD, columns=qKlXBtn3PKy4, chunksize=op94qe_Rdjul) if YbLi4ide0_3E is not None: return YbLi4ide0_3E else: raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'D$\x982C\xc0\xa6i\xbbY\xfc\xcb\xc2J1,z\xb7n\xaf\xe5P'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b110101 + 0o61) + chr(0b101101) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'v*\x883G\x94'), '\144' + '\x65' + chr(0b1010111 + 0o14) + chr(111) + chr(0b1100100) + chr(0b101110 + 0o67))(chr(2349 - 2232) + chr(0b111101 + 0o67) + chr(9665 - 9563) + chr(1085 - 1040) + chr(0b110101 + 0o3)))(name=NKKFbr2Z4sr1), _sqfVuM76EP3)
pandas-dev/pandas
pandas/io/sql.py
read_sql_query
def read_sql_query(sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, chunksize=None): """Read SQL query into a DataFrame. Returns a DataFrame corresponding to the result set of the query string. Optionally provide an `index_col` parameter to use one of the columns as the index, otherwise default integer index will be used. Parameters ---------- sql : string SQL query or SQLAlchemy Selectable (select or text object) SQL query to be executed. con : SQLAlchemy connectable(engine/connection), database string URI, or sqlite3 DBAPI2 connection Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : boolean, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. Useful for SQL result sets. params : list, tuple or dict, optional, default: None List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- read_sql_table : Read SQL database table into a DataFrame. read_sql Notes ----- Any datetime values with time zone information parsed via the `parse_dates` parameter will be converted to UTC. """ pandas_sql = pandasSQL_builder(con) return pandas_sql.read_query( sql, index_col=index_col, params=params, coerce_float=coerce_float, parse_dates=parse_dates, chunksize=chunksize)
python
def read_sql_query(sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, chunksize=None): """Read SQL query into a DataFrame. Returns a DataFrame corresponding to the result set of the query string. Optionally provide an `index_col` parameter to use one of the columns as the index, otherwise default integer index will be used. Parameters ---------- sql : string SQL query or SQLAlchemy Selectable (select or text object) SQL query to be executed. con : SQLAlchemy connectable(engine/connection), database string URI, or sqlite3 DBAPI2 connection Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : boolean, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. Useful for SQL result sets. params : list, tuple or dict, optional, default: None List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- read_sql_table : Read SQL database table into a DataFrame. read_sql Notes ----- Any datetime values with time zone information parsed via the `parse_dates` parameter will be converted to UTC. """ pandas_sql = pandasSQL_builder(con) return pandas_sql.read_query( sql, index_col=index_col, params=params, coerce_float=coerce_float, parse_dates=parse_dates, chunksize=chunksize)
[ "def", "read_sql_query", "(", "sql", ",", "con", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "params", "=", "None", ",", "parse_dates", "=", "None", ",", "chunksize", "=", "None", ")", ":", "pandas_sql", "=", "pandasSQL_builder", "(", "con", ")", "return", "pandas_sql", ".", "read_query", "(", "sql", ",", "index_col", "=", "index_col", ",", "params", "=", "params", ",", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ",", "chunksize", "=", "chunksize", ")" ]
Read SQL query into a DataFrame. Returns a DataFrame corresponding to the result set of the query string. Optionally provide an `index_col` parameter to use one of the columns as the index, otherwise default integer index will be used. Parameters ---------- sql : string SQL query or SQLAlchemy Selectable (select or text object) SQL query to be executed. con : SQLAlchemy connectable(engine/connection), database string URI, or sqlite3 DBAPI2 connection Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : boolean, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. Useful for SQL result sets. params : list, tuple or dict, optional, default: None List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- read_sql_table : Read SQL database table into a DataFrame. read_sql Notes ----- Any datetime values with time zone information parsed via the `parse_dates` parameter will be converted to UTC.
[ "Read", "SQL", "query", "into", "a", "DataFrame", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L247-L305
train
Read a SQL query into a DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY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9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1001110 + 0o41) + '\x33' + chr(0b100100 + 0o22) + chr(1968 - 1920), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(6810 - 6699) + chr(0b110010) + chr(2072 - 2022) + '\x32', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x34' + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + '\066' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(459 - 411) + chr(0b1101111) + chr(0b110011) + '\x34' + chr(434 - 382), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5617 - 5506) + chr(1401 - 1350) + '\060' + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(563 - 452) + chr(54) + chr(0b100001 + 0o23), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1011 + 0o50) + chr(1870 - 1818) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b111010 + 0o65) + chr(0b11011 + 0o26) + chr(0b10100 + 0o35) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001101 + 0o42) + chr(0b110011) + chr(0b110001 + 0o5) + '\x35', 38256 - 38248), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(1138 - 1083) + chr(954 - 906), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8514 - 8403) + '\062' + '\062' + chr(2539 - 2484), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(1893 - 1844) + chr(0b110100) + chr(1607 - 1557), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(0b101100 + 0o10) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(1566 - 1518) + chr(111) + chr(0b110010) + '\x31' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1607 - 1559) + '\157' + chr(1015 - 965) + '\x34' + chr(648 - 600), 11439 - 11431), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(55) + chr(0b101110 + 0o11), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + '\060' + chr(596 - 547), ord("\x08")), ehT0Px3KOsy9(chr(1456 - 1408) + '\157' + '\061' + chr(55) + chr(909 - 860), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(0b1010 + 0o51) + chr(0b110100) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(2082 - 2034) + chr(0b1101111) + '\x33' + '\x30' + '\x31', 27057 - 27049), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(49) + chr(0b10001 + 0o37), 34720 - 34712), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\066' + chr(1005 - 950), 38998 - 38990), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11001 + 0o36) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(3513 - 3402) + chr(0b110001) + chr(0b110111 + 0o0) + chr(86 - 36), 0b1000), ehT0Px3KOsy9(chr(2273 - 2225) + '\x6f' + '\063' + chr(0b110001) + chr(0b10111 + 0o32), 59237 - 59229), ehT0Px3KOsy9('\x30' + chr(0b1001110 + 0o41) + '\x33' + chr(1971 - 1923) + chr(0b101 + 0o54), 8), ehT0Px3KOsy9(chr(1174 - 1126) + chr(111) + '\x32' + chr(0b110010) + chr(2227 - 2174), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b110111 + 0o70) + chr(51) + '\x35' + chr(50), 1699 - 1691), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + chr(0b110000) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011101 + 0o22) + chr(0b100000 + 0o22) + '\064' + chr(0b101010 + 0o11), 0b1000), ehT0Px3KOsy9(chr(590 - 542) + chr(111) + chr(972 - 922) + chr(0b110011), 10637 - 10629), ehT0Px3KOsy9(chr(48) + chr(0b10100 + 0o133) + chr(53) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10010 + 0o135) + chr(0b110101) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11590 - 11479) + '\x31' + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(2491 - 2380) + '\062' + chr(462 - 407), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(1773 - 1720) + chr(49), 8), ehT0Px3KOsy9(chr(2245 - 2197) + chr(0b1101111) + chr(1854 - 1803) + chr(2566 - 2514) + chr(0b100010 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(0b111 + 0o54) + '\x30' + '\x31', 8), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(135 - 87) + chr(52), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(261 - 213) + chr(0b11101 + 0o122) + chr(53) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xde'), chr(0b1011010 + 0o12) + chr(0b100000 + 0o105) + chr(0b1100011) + chr(0b1001011 + 0o44) + chr(0b1100100) + '\145')(chr(0b1011101 + 0o30) + chr(116) + chr(0b1100110) + chr(45) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def bMr2VbgfAxiV(GWXd4kBaViZK, _sqfVuM76EP3, o90TMYhFhMm_=None, hyGdBsLYkQVS=ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(5217 - 5106) + chr(0b110001), 0b1000), nEbJZ4wfte2w=None, T1brfYV34pPD=None, op94qe_Rdjul=None): Re4ydlckRnKx = Hm7TAp8orHi4(_sqfVuM76EP3) return xafqLlk3kkUe(Re4ydlckRnKx, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xf7A\x90\xbb\xb3A\x878\x8c'), chr(3091 - 2991) + '\145' + chr(99) + chr(0b1101111) + '\x64' + chr(0b110101 + 0o60))(chr(0b1010111 + 0o36) + '\164' + chr(0b11000 + 0o116) + '\x2d' + chr(0b10010 + 0o46)))(GWXd4kBaViZK, index_col=o90TMYhFhMm_, params=nEbJZ4wfte2w, coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD, chunksize=op94qe_Rdjul)
pandas-dev/pandas
pandas/io/sql.py
read_sql
def read_sql(sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, columns=None, chunksize=None): """ Read SQL query or database table into a DataFrame. This function is a convenience wrapper around ``read_sql_table`` and ``read_sql_query`` (for backward compatibility). It will delegate to the specific function depending on the provided input. A SQL query will be routed to ``read_sql_query``, while a database table name will be routed to ``read_sql_table``. Note that the delegated function might have more specific notes about their functionality not listed here. Parameters ---------- sql : string or SQLAlchemy Selectable (select or text object) SQL query to be executed or a table name. con : SQLAlchemy connectable (engine/connection) or database string URI or DBAPI2 connection (fallback mode) Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : boolean, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point, useful for SQL result sets. params : list, tuple or dict, optional, default: None List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. columns : list, default: None List of column names to select from SQL table (only used when reading a table). chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- read_sql_table : Read SQL database table into a DataFrame. read_sql_query : Read SQL query into a DataFrame. """ pandas_sql = pandasSQL_builder(con) if isinstance(pandas_sql, SQLiteDatabase): return pandas_sql.read_query( sql, index_col=index_col, params=params, coerce_float=coerce_float, parse_dates=parse_dates, chunksize=chunksize) try: _is_table_name = pandas_sql.has_table(sql) except Exception: # using generic exception to catch errors from sql drivers (GH24988) _is_table_name = False if _is_table_name: pandas_sql.meta.reflect(only=[sql]) return pandas_sql.read_table( sql, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates, columns=columns, chunksize=chunksize) else: return pandas_sql.read_query( sql, index_col=index_col, params=params, coerce_float=coerce_float, parse_dates=parse_dates, chunksize=chunksize)
python
def read_sql(sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, columns=None, chunksize=None): """ Read SQL query or database table into a DataFrame. This function is a convenience wrapper around ``read_sql_table`` and ``read_sql_query`` (for backward compatibility). It will delegate to the specific function depending on the provided input. A SQL query will be routed to ``read_sql_query``, while a database table name will be routed to ``read_sql_table``. Note that the delegated function might have more specific notes about their functionality not listed here. Parameters ---------- sql : string or SQLAlchemy Selectable (select or text object) SQL query to be executed or a table name. con : SQLAlchemy connectable (engine/connection) or database string URI or DBAPI2 connection (fallback mode) Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : boolean, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point, useful for SQL result sets. params : list, tuple or dict, optional, default: None List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. columns : list, default: None List of column names to select from SQL table (only used when reading a table). chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- read_sql_table : Read SQL database table into a DataFrame. read_sql_query : Read SQL query into a DataFrame. """ pandas_sql = pandasSQL_builder(con) if isinstance(pandas_sql, SQLiteDatabase): return pandas_sql.read_query( sql, index_col=index_col, params=params, coerce_float=coerce_float, parse_dates=parse_dates, chunksize=chunksize) try: _is_table_name = pandas_sql.has_table(sql) except Exception: # using generic exception to catch errors from sql drivers (GH24988) _is_table_name = False if _is_table_name: pandas_sql.meta.reflect(only=[sql]) return pandas_sql.read_table( sql, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates, columns=columns, chunksize=chunksize) else: return pandas_sql.read_query( sql, index_col=index_col, params=params, coerce_float=coerce_float, parse_dates=parse_dates, chunksize=chunksize)
[ "def", "read_sql", "(", "sql", ",", "con", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "params", "=", "None", ",", "parse_dates", "=", "None", ",", "columns", "=", "None", ",", "chunksize", "=", "None", ")", ":", "pandas_sql", "=", "pandasSQL_builder", "(", "con", ")", "if", "isinstance", "(", "pandas_sql", ",", "SQLiteDatabase", ")", ":", "return", "pandas_sql", ".", "read_query", "(", "sql", ",", "index_col", "=", "index_col", ",", "params", "=", "params", ",", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ",", "chunksize", "=", "chunksize", ")", "try", ":", "_is_table_name", "=", "pandas_sql", ".", "has_table", "(", "sql", ")", "except", "Exception", ":", "# using generic exception to catch errors from sql drivers (GH24988)", "_is_table_name", "=", "False", "if", "_is_table_name", ":", "pandas_sql", ".", "meta", ".", "reflect", "(", "only", "=", "[", "sql", "]", ")", "return", "pandas_sql", ".", "read_table", "(", "sql", ",", "index_col", "=", "index_col", ",", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ",", "columns", "=", "columns", ",", "chunksize", "=", "chunksize", ")", "else", ":", "return", "pandas_sql", ".", "read_query", "(", "sql", ",", "index_col", "=", "index_col", ",", "params", "=", "params", ",", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ",", "chunksize", "=", "chunksize", ")" ]
Read SQL query or database table into a DataFrame. This function is a convenience wrapper around ``read_sql_table`` and ``read_sql_query`` (for backward compatibility). It will delegate to the specific function depending on the provided input. A SQL query will be routed to ``read_sql_query``, while a database table name will be routed to ``read_sql_table``. Note that the delegated function might have more specific notes about their functionality not listed here. Parameters ---------- sql : string or SQLAlchemy Selectable (select or text object) SQL query to be executed or a table name. con : SQLAlchemy connectable (engine/connection) or database string URI or DBAPI2 connection (fallback mode) Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). coerce_float : boolean, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point, useful for SQL result sets. params : list, tuple or dict, optional, default: None List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. columns : list, default: None List of column names to select from SQL table (only used when reading a table). chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- read_sql_table : Read SQL database table into a DataFrame. read_sql_query : Read SQL query into a DataFrame.
[ "Read", "SQL", "query", "or", "database", "table", "into", "a", "DataFrame", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L308-L388
train
Read a SQL query or database table into a DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BF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y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1011010 + 0o25) + '\063' + chr(1031 - 980) + chr(0b10110 + 0o41), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\x30' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(415 - 364) + chr(0b100011 + 0o16) + chr(2267 - 2217), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10001 + 0o42) + '\x36' + chr(2903 - 2848), ord("\x08")), ehT0Px3KOsy9(chr(617 - 569) + chr(0b1101111) + '\063' + chr(0b1111 + 0o46) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001110 + 0o41) + '\061' + '\x35' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(1591 - 1543) + chr(9852 - 9741) + chr(0b1011 + 0o46) + '\x32' + chr(2571 - 2517), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(525 - 474) + chr(0b100 + 0o57), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + '\067' + '\x30', 0o10), ehT0Px3KOsy9(chr(876 - 828) + chr(6818 - 6707) + chr(0b10110 + 0o33) + '\x31' + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b11001 + 0o126) + chr(1851 - 1802) + chr(55) + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\066' + chr(1135 - 1084), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(667 - 615) + chr(0b110010), 20982 - 20974), ehT0Px3KOsy9(chr(48) + chr(9276 - 9165) + chr(2059 - 2010) + chr(0b110101) + chr(0b110 + 0o60), ord("\x08")), ehT0Px3KOsy9(chr(2061 - 2013) + '\157' + chr(0b110001) + chr(974 - 921) + chr(53), 39203 - 39195), ehT0Px3KOsy9('\060' + chr(3830 - 3719) + chr(0b10010 + 0o37) + chr(0b110100), 40620 - 40612), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10111 + 0o34) + chr(2040 - 1992) + chr(0b10011 + 0o41), 17085 - 17077), ehT0Px3KOsy9(chr(0b110000) + chr(4967 - 4856) + '\x31' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b101010 + 0o6) + '\x32', 23564 - 23556), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(0b110011), 8), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(50) + chr(1132 - 1081), 0b1000), ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + chr(0b100011 + 0o17) + chr(0b110000) + chr(51), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(1624 - 1574) + chr(0b110111) + chr(48), 8), ehT0Px3KOsy9(chr(1782 - 1734) + '\x6f' + chr(752 - 701) + '\061' + chr(0b100000 + 0o22), 8), ehT0Px3KOsy9(chr(48) + chr(0b1011110 + 0o21) + '\x32' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(408 - 358) + chr(0b110001) + chr(0b101110 + 0o10), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(578 - 528) + '\067' + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(8724 - 8613) + '\065' + chr(0b110010 + 0o1), 41435 - 41427), ehT0Px3KOsy9('\060' + chr(0b111110 + 0o61) + chr(0b10111 + 0o33) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1645 - 1595) + '\067' + chr(913 - 859), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4468 - 4357) + chr(570 - 520) + chr(1788 - 1740) + chr(0b100101 + 0o20), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2042 - 1993) + chr(0b110110) + chr(0b11000 + 0o34), 6474 - 6466), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x36' + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\x35' + chr(0b101010 + 0o13), 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(10397 - 10286) + chr(0b110010) + chr(196 - 148) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1564 - 1514) + '\x32' + chr(0b10001 + 0o40), 39343 - 39335), ehT0Px3KOsy9(chr(784 - 736) + '\x6f' + chr(0b110010) + '\x31' + chr(1033 - 980), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b110011) + chr(0b10010 + 0o36), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(1493 - 1443) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1100 + 0o46) + chr(52) + chr(51), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(2044 - 1991) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1'), '\144' + '\145' + '\143' + '\157' + chr(100) + chr(0b1010 + 0o133))('\x75' + chr(0b1110100) + chr(1228 - 1126) + chr(0b101101) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def mdHxN4Ui7iXg(GWXd4kBaViZK, _sqfVuM76EP3, o90TMYhFhMm_=None, hyGdBsLYkQVS=ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1011 + 0o46), 0o10), nEbJZ4wfte2w=None, T1brfYV34pPD=None, qKlXBtn3PKy4=None, op94qe_Rdjul=None): Re4ydlckRnKx = Hm7TAp8orHi4(_sqfVuM76EP3) if PlSM16l2KDPD(Re4ydlckRnKx, bPxPu_8gzhG3): return xafqLlk3kkUe(Re4ydlckRnKx, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xa6\xab\x93\xb4\x19#~\xca1'), '\144' + '\x65' + '\x63' + chr(0b1101111) + '\144' + chr(0b1100101))(chr(0b1011 + 0o152) + '\x74' + '\x66' + '\x2d' + chr(56)))(GWXd4kBaViZK, index_col=o90TMYhFhMm_, params=nEbJZ4wfte2w, coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD, chunksize=op94qe_Rdjul) try: _4DO_IUDToiS = Re4ydlckRnKx.has_table(GWXd4kBaViZK) except jLmadlzMdunT: _4DO_IUDToiS = ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(0b0 + 0o60), ord("\x08")) if _4DO_IUDToiS: xafqLlk3kkUe(Re4ydlckRnKx.meta, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xa6\xac\x9b\x8e\x0b"'), chr(0b1100100) + '\x65' + chr(99) + chr(111) + '\x64' + chr(0b1100101))(chr(117) + chr(0b1100010 + 0o22) + chr(102) + '\055' + chr(0b111000)))(only=[GWXd4kBaViZK]) return xafqLlk3kkUe(Re4ydlckRnKx, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xa6\xab\x93\xb4\x1c7y\xd4-'), chr(100) + '\x65' + chr(6737 - 6638) + '\157' + chr(1540 - 1440) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(102) + chr(245 - 200) + chr(56)))(GWXd4kBaViZK, index_col=o90TMYhFhMm_, coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD, columns=qKlXBtn3PKy4, chunksize=op94qe_Rdjul) else: return xafqLlk3kkUe(Re4ydlckRnKx, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xa6\xab\x93\xb4\x19#~\xca1'), chr(4894 - 4794) + chr(4295 - 4194) + '\143' + chr(0b1101111) + '\144' + chr(0b110 + 0o137))(chr(117) + '\x74' + chr(0b1100110) + chr(0b101100 + 0o1) + chr(1978 - 1922)))(GWXd4kBaViZK, index_col=o90TMYhFhMm_, params=nEbJZ4wfte2w, coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD, chunksize=op94qe_Rdjul)
pandas-dev/pandas
pandas/io/sql.py
to_sql
def to_sql(frame, name, con, schema=None, if_exists='fail', index=True, index_label=None, chunksize=None, dtype=None, method=None): """ Write records stored in a DataFrame to a SQL database. Parameters ---------- frame : DataFrame, Series name : string Name of SQL table. con : SQLAlchemy connectable(engine/connection) or database string URI or sqlite3 DBAPI2 connection Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. schema : string, default None Name of SQL schema in database to write to (if database flavor supports this). If None, use default schema (default). if_exists : {'fail', 'replace', 'append'}, default 'fail' - fail: If table exists, do nothing. - replace: If table exists, drop it, recreate it, and insert data. - append: If table exists, insert data. Create if does not exist. index : boolean, default True Write DataFrame index as a column. index_label : string or sequence, default None Column label for index column(s). If None is given (default) and `index` is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. chunksize : int, default None If not None, then rows will be written in batches of this size at a time. If None, all rows will be written at once. dtype : single SQLtype or dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type, or a string for sqlite3 fallback connection. If all columns are of the same type, one single value can be used. method : {None, 'multi', callable}, default None Controls the SQL insertion clause used: - None : Uses standard SQL ``INSERT`` clause (one per row). - 'multi': Pass multiple values in a single ``INSERT`` clause. - callable with signature ``(pd_table, conn, keys, data_iter)``. Details and a sample callable implementation can be found in the section :ref:`insert method <io.sql.method>`. .. versionadded:: 0.24.0 """ if if_exists not in ('fail', 'replace', 'append'): raise ValueError("'{0}' is not valid for if_exists".format(if_exists)) pandas_sql = pandasSQL_builder(con, schema=schema) if isinstance(frame, Series): frame = frame.to_frame() elif not isinstance(frame, DataFrame): raise NotImplementedError("'frame' argument should be either a " "Series or a DataFrame") pandas_sql.to_sql(frame, name, if_exists=if_exists, index=index, index_label=index_label, schema=schema, chunksize=chunksize, dtype=dtype, method=method)
python
def to_sql(frame, name, con, schema=None, if_exists='fail', index=True, index_label=None, chunksize=None, dtype=None, method=None): """ Write records stored in a DataFrame to a SQL database. Parameters ---------- frame : DataFrame, Series name : string Name of SQL table. con : SQLAlchemy connectable(engine/connection) or database string URI or sqlite3 DBAPI2 connection Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. schema : string, default None Name of SQL schema in database to write to (if database flavor supports this). If None, use default schema (default). if_exists : {'fail', 'replace', 'append'}, default 'fail' - fail: If table exists, do nothing. - replace: If table exists, drop it, recreate it, and insert data. - append: If table exists, insert data. Create if does not exist. index : boolean, default True Write DataFrame index as a column. index_label : string or sequence, default None Column label for index column(s). If None is given (default) and `index` is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. chunksize : int, default None If not None, then rows will be written in batches of this size at a time. If None, all rows will be written at once. dtype : single SQLtype or dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type, or a string for sqlite3 fallback connection. If all columns are of the same type, one single value can be used. method : {None, 'multi', callable}, default None Controls the SQL insertion clause used: - None : Uses standard SQL ``INSERT`` clause (one per row). - 'multi': Pass multiple values in a single ``INSERT`` clause. - callable with signature ``(pd_table, conn, keys, data_iter)``. Details and a sample callable implementation can be found in the section :ref:`insert method <io.sql.method>`. .. versionadded:: 0.24.0 """ if if_exists not in ('fail', 'replace', 'append'): raise ValueError("'{0}' is not valid for if_exists".format(if_exists)) pandas_sql = pandasSQL_builder(con, schema=schema) if isinstance(frame, Series): frame = frame.to_frame() elif not isinstance(frame, DataFrame): raise NotImplementedError("'frame' argument should be either a " "Series or a DataFrame") pandas_sql.to_sql(frame, name, if_exists=if_exists, index=index, index_label=index_label, schema=schema, chunksize=chunksize, dtype=dtype, method=method)
[ "def", "to_sql", "(", "frame", ",", "name", ",", "con", ",", "schema", "=", "None", ",", "if_exists", "=", "'fail'", ",", "index", "=", "True", ",", "index_label", "=", "None", ",", "chunksize", "=", "None", ",", "dtype", "=", "None", ",", "method", "=", "None", ")", ":", "if", "if_exists", "not", "in", "(", "'fail'", ",", "'replace'", ",", "'append'", ")", ":", "raise", "ValueError", "(", "\"'{0}' is not valid for if_exists\"", ".", "format", "(", "if_exists", ")", ")", "pandas_sql", "=", "pandasSQL_builder", "(", "con", ",", "schema", "=", "schema", ")", "if", "isinstance", "(", "frame", ",", "Series", ")", ":", "frame", "=", "frame", ".", "to_frame", "(", ")", "elif", "not", "isinstance", "(", "frame", ",", "DataFrame", ")", ":", "raise", "NotImplementedError", "(", "\"'frame' argument should be either a \"", "\"Series or a DataFrame\"", ")", "pandas_sql", ".", "to_sql", "(", "frame", ",", "name", ",", "if_exists", "=", "if_exists", ",", "index", "=", "index", ",", "index_label", "=", "index_label", ",", "schema", "=", "schema", ",", "chunksize", "=", "chunksize", ",", "dtype", "=", "dtype", ",", "method", "=", "method", ")" ]
Write records stored in a DataFrame to a SQL database. Parameters ---------- frame : DataFrame, Series name : string Name of SQL table. con : SQLAlchemy connectable(engine/connection) or database string URI or sqlite3 DBAPI2 connection Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. schema : string, default None Name of SQL schema in database to write to (if database flavor supports this). If None, use default schema (default). if_exists : {'fail', 'replace', 'append'}, default 'fail' - fail: If table exists, do nothing. - replace: If table exists, drop it, recreate it, and insert data. - append: If table exists, insert data. Create if does not exist. index : boolean, default True Write DataFrame index as a column. index_label : string or sequence, default None Column label for index column(s). If None is given (default) and `index` is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. chunksize : int, default None If not None, then rows will be written in batches of this size at a time. If None, all rows will be written at once. dtype : single SQLtype or dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type, or a string for sqlite3 fallback connection. If all columns are of the same type, one single value can be used. method : {None, 'multi', callable}, default None Controls the SQL insertion clause used: - None : Uses standard SQL ``INSERT`` clause (one per row). - 'multi': Pass multiple values in a single ``INSERT`` clause. - callable with signature ``(pd_table, conn, keys, data_iter)``. Details and a sample callable implementation can be found in the section :ref:`insert method <io.sql.method>`. .. versionadded:: 0.24.0
[ "Write", "records", "stored", "in", "a", "DataFrame", "to", "a", "SQL", "database", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L391-L451
train
Writes records stored in a DataFrame to a SQL database.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvb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nectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + '\067' + chr(335 - 284), 25849 - 25841), ehT0Px3KOsy9(chr(1142 - 1094) + '\157' + chr(50) + chr(0b101110 + 0o7) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11111 + 0o24) + '\063' + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1111 + 0o43) + chr(0b110001 + 0o6) + chr(53), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b101110 + 0o5) + chr(49) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(540 - 490) + chr(0b110001) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + '\x33' + chr(0b110110) + chr(1214 - 1165), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + '\063' + chr(0b110010) + chr(0b110 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(613 - 565) + chr(2524 - 2413) + chr(51) + chr(0b110010) + '\061', 10705 - 10697), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1 + 0o156) + chr(1841 - 1790) + chr(0b10111 + 0o34) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(198 - 150) + chr(111) + '\061' + chr(0b110101) + chr(478 - 427), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7259 - 7148) + chr(481 - 431) + chr(0b110011) + '\062', 0o10), ehT0Px3KOsy9(chr(555 - 507) + chr(454 - 343) + '\x33' + '\062' + chr(0b101001 + 0o15), 33266 - 33258), ehT0Px3KOsy9('\060' + chr(0b1101110 + 0o1) + '\x31' + '\060' + chr(53), 1251 - 1243), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + chr(49) + '\065' + chr(0b10 + 0o61), 8), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(471 - 420) + chr(54) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110100) + chr(1448 - 1399), 47035 - 47027), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(1875 - 1823) + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(4546 - 4435) + chr(483 - 432) + chr(54) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10000 + 0o43) + chr(1719 - 1671) + chr(2710 - 2655), 45298 - 45290), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\x32' + '\062', 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1010000 + 0o37) + chr(1956 - 1901) + '\x30', 12409 - 12401), ehT0Px3KOsy9('\060' + chr(2444 - 2333) + '\063' + chr(0b100000 + 0o23) + '\067', 55026 - 55018), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + '\064' + '\065', 0b1000), ehT0Px3KOsy9(chr(1487 - 1439) + chr(111) + chr(0b1000 + 0o53) + chr(52) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101110 + 0o4) + '\x32' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1489 - 1441) + chr(0b1101111) + '\062' + chr(1533 - 1478) + chr(0b110000 + 0o3), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(11814 - 11703) + '\x32' + chr(0b10 + 0o65) + chr(55), 20152 - 20144), ehT0Px3KOsy9(chr(1492 - 1444) + chr(111) + chr(50) + chr(55) + '\x35', 8), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(111) + chr(0b1110 + 0o44) + chr(432 - 383) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1819 - 1770) + '\065' + chr(0b110110), 10146 - 10138), ehT0Px3KOsy9(chr(0b110000) + chr(3026 - 2915) + chr(0b110011) + chr(53) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(0b110110) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(829 - 781) + chr(0b1101111) + chr(2000 - 1949) + '\x32', 42716 - 42708), ehT0Px3KOsy9(chr(533 - 485) + chr(0b1011111 + 0o20) + chr(0b100011 + 0o17) + chr(1814 - 1764) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1101 + 0o50) + chr(0b1111 + 0o45), 0o10), ehT0Px3KOsy9(chr(1252 - 1204) + chr(0b10110 + 0o131) + chr(51) + chr(0b110000) + chr(0b1010 + 0o46), 35970 - 35962), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + '\x32' + '\x33', 50149 - 50141), ehT0Px3KOsy9(chr(2094 - 2046) + '\157' + chr(0b1010 + 0o47) + '\064' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(6177 - 6066) + chr(0b101100 + 0o5) + chr(1144 - 1089) + '\x33', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111 + 0o0) + chr(2808 - 2755) + chr(1413 - 1365), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x15'), chr(100) + '\x65' + chr(0b100010 + 0o101) + chr(0b1001010 + 0o45) + chr(100) + chr(101))('\165' + '\x74' + chr(7629 - 7527) + '\x2d' + chr(0b110 + 0o62)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def b6tBeYOjJJGT(C4IqNNmLfHXB, AIvJRzLdDfgF, _sqfVuM76EP3, P7DmIFVRivx6=None, zZFPtODM90fp=xafqLlk3kkUe(SXOLrMavuUCe(b']\xc9\xb2\xd1'), chr(0b1100100) + chr(0b1100101) + chr(1308 - 1209) + '\x6f' + chr(0b111101 + 0o47) + chr(0b1001100 + 0o31))(chr(0b1010100 + 0o41) + chr(0b1110100) + chr(2260 - 2158) + chr(0b101101) + chr(56)), XdowRbJKZWL9=ehT0Px3KOsy9('\060' + chr(0b11000 + 0o127) + chr(0b110001), 15577 - 15569), Rj5_q03bvJPB=None, op94qe_Rdjul=None, jSV9IKnemH7K=None, CVRCXTcnOnH6=None): if zZFPtODM90fp not in (xafqLlk3kkUe(SXOLrMavuUCe(b']\xc9\xb2\xd1'), chr(0b1100100) + chr(5959 - 5858) + chr(2503 - 2404) + chr(111) + chr(0b101011 + 0o71) + '\145')(chr(117) + chr(0b11100 + 0o130) + '\x66' + chr(0b101101) + chr(214 - 158)), xafqLlk3kkUe(SXOLrMavuUCe(b'I\xcd\xab\xd1\xad\xef\x94'), chr(0b1100100) + chr(7426 - 7325) + '\x63' + '\x6f' + chr(2559 - 2459) + '\x65')(chr(0b1110101) + chr(116) + chr(5314 - 5212) + chr(0b101101) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'Z\xd8\xab\xd8\xa2\xe8'), chr(0b1100100) + '\x65' + chr(0b100 + 0o137) + chr(3083 - 2972) + chr(0b1000111 + 0o35) + '\x65')(chr(0b10010 + 0o143) + chr(0b1110100) + chr(0b1011100 + 0o12) + chr(0b101101) + chr(56))): raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1c\xd3\xeb\xc0\xeb\xac\x98\xa6\xf1\xb6\x04\xee\xf63\n\x9fH\x87\xd5\xa1=J\xff\xcc\x80\xc9\xde\xc7\xd4\xf9\x1a\x9f'), '\x64' + chr(0b1100101) + chr(0b1000 + 0o133) + chr(2606 - 2495) + '\144' + chr(6903 - 6802))(chr(0b1110101) + '\164' + '\x66' + chr(1601 - 1556) + chr(1954 - 1898)), xafqLlk3kkUe(SXOLrMavuUCe(b']\xc7\xa9\xd0\xad\xf8'), chr(0b110011 + 0o61) + chr(101) + chr(0b110101 + 0o56) + chr(0b1101111) + '\x64' + chr(6940 - 6839))(chr(0b110100 + 0o101) + chr(0b1110100) + chr(102) + '\x2d' + '\070'))(zZFPtODM90fp)) Re4ydlckRnKx = Hm7TAp8orHi4(_sqfVuM76EP3, schema=P7DmIFVRivx6) if PlSM16l2KDPD(C4IqNNmLfHXB, I9PbrFvU4NYI): C4IqNNmLfHXB = C4IqNNmLfHXB.to_frame() elif not PlSM16l2KDPD(C4IqNNmLfHXB, TTWbaLX2VikC): raise _zJ24Vce7wp0(xafqLlk3kkUe(SXOLrMavuUCe(b"\x1c\xce\xa9\xdc\xa1\xe9\xd6\xf5\xb0\xaa\x0c\xef\xbb \x05\x87\x01\x90\x9d\xa8'T\xbb\x85\x84\xf3\x9b\xda\xd4\xfe\x06\x89\x85:\xf0\x0c\x93v\x12\x12^\xdb\xfb\xd2\xbe\xac\x90\xf5\x95\xb9\x1f\xfb\x907\n\x9eD"), '\144' + chr(0b111100 + 0o51) + chr(7983 - 7884) + chr(111) + chr(100) + '\x65')('\165' + '\164' + '\146' + chr(1163 - 1118) + '\x38')) xafqLlk3kkUe(Re4ydlckRnKx, xafqLlk3kkUe(SXOLrMavuUCe(b'O\xc7\x84\xce\xbd\xe0'), chr(5364 - 5264) + chr(101) + chr(0b1011110 + 0o5) + chr(111) + '\144' + '\145')(chr(0b1000111 + 0o56) + chr(3055 - 2939) + chr(0b1100110) + chr(0b101101) + chr(969 - 913)))(C4IqNNmLfHXB, AIvJRzLdDfgF, if_exists=zZFPtODM90fp, index=XdowRbJKZWL9, index_label=Rj5_q03bvJPB, schema=P7DmIFVRivx6, chunksize=op94qe_Rdjul, dtype=jSV9IKnemH7K, method=CVRCXTcnOnH6)
pandas-dev/pandas
pandas/io/sql.py
has_table
def has_table(table_name, con, schema=None): """ Check if DataBase has named table. Parameters ---------- table_name: string Name of SQL table. con: SQLAlchemy connectable(engine/connection) or sqlite3 DBAPI2 connection Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. schema : string, default None Name of SQL schema in database to write to (if database flavor supports this). If None, use default schema (default). Returns ------- boolean """ pandas_sql = pandasSQL_builder(con, schema=schema) return pandas_sql.has_table(table_name)
python
def has_table(table_name, con, schema=None): """ Check if DataBase has named table. Parameters ---------- table_name: string Name of SQL table. con: SQLAlchemy connectable(engine/connection) or sqlite3 DBAPI2 connection Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. schema : string, default None Name of SQL schema in database to write to (if database flavor supports this). If None, use default schema (default). Returns ------- boolean """ pandas_sql = pandasSQL_builder(con, schema=schema) return pandas_sql.has_table(table_name)
[ "def", "has_table", "(", "table_name", ",", "con", ",", "schema", "=", "None", ")", ":", "pandas_sql", "=", "pandasSQL_builder", "(", "con", ",", "schema", "=", "schema", ")", "return", "pandas_sql", ".", "has_table", "(", "table_name", ")" ]
Check if DataBase has named table. Parameters ---------- table_name: string Name of SQL table. con: SQLAlchemy connectable(engine/connection) or sqlite3 DBAPI2 connection Using SQLAlchemy makes it possible to use any DB supported by that library. If a DBAPI2 object, only sqlite3 is supported. schema : string, default None Name of SQL schema in database to write to (if database flavor supports this). If None, use default schema (default). Returns ------- boolean
[ "Check", "if", "DataBase", "has", "named", "table", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L454-L475
train
Check if DataBase has named table.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTm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2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x34' + '\063', 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(1944 - 1833) + chr(0b100100 + 0o16) + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + chr(637 - 526) + chr(1472 - 1423) + chr(49) + chr(320 - 266), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10 + 0o60) + chr(0b110101) + chr(55), 44408 - 44400), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + chr(593 - 544) + chr(1489 - 1435) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100100 + 0o13) + chr(53) + '\x36', 1951 - 1943), ehT0Px3KOsy9(chr(889 - 841) + chr(11823 - 11712) + chr(51) + '\x35' + chr(0b110010), 20784 - 20776), ehT0Px3KOsy9(chr(48) + chr(0b1100000 + 0o17) + '\062' + chr(0b100101 + 0o16) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\x35' + '\x32', 36997 - 36989), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(7980 - 7869) + chr(51) + chr(48) + chr(2405 - 2350), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o22) + '\065' + chr(0b101110 + 0o10), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b110110) + chr(2341 - 2291), 34849 - 34841), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\x6f' + chr(0b1 + 0o60) + chr(0b110100) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110100 + 0o73) + chr(552 - 499), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011000 + 0o27) + '\061' + chr(0b110010) + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001 + 0o1) + '\063' + chr(2235 - 2183), 3293 - 3285), ehT0Px3KOsy9('\060' + '\157' + chr(0b110 + 0o53) + chr(0b110101) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(2268 - 2220) + chr(6303 - 6192) + chr(0b110011) + '\x35' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b10000 + 0o42) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11000 + 0o32) + chr(55) + chr(0b1100 + 0o45), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(0b110110), 8), ehT0Px3KOsy9(chr(691 - 643) + '\x6f' + chr(51) + chr(0b110010) + chr(0b11 + 0o60), 50072 - 50064), ehT0Px3KOsy9(chr(1236 - 1188) + chr(0b1101111) + chr(50) + chr(2472 - 2422) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10000 + 0o137) + chr(53) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000101 + 0o52) + chr(0b110010) + chr(842 - 787) + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1776 - 1726) + chr(0b110011) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(1894 - 1846) + chr(111) + chr(0b110011) + chr(0b1110 + 0o45) + '\065', 0b1000), ehT0Px3KOsy9(chr(1804 - 1756) + chr(0b1101100 + 0o3) + '\062' + '\066' + '\x32', 8), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\x36' + chr(1834 - 1785), ord("\x08")), ehT0Px3KOsy9(chr(1711 - 1663) + '\157' + chr(0b101111 + 0o3) + chr(0b110110) + chr(0b10100 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + '\x33' + '\x37' + chr(0b110101), 14347 - 14339), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11011 + 0o124) + chr(51) + '\062' + chr(0b10001 + 0o40), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(1476 - 1428) + chr(0b1001010 + 0o45) + chr(49) + '\x33' + chr(622 - 573), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(0b110011) + chr(50) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(55) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(50) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(1958 - 1905) + chr(0b110101 + 0o0), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(53) + chr(1389 - 1341), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\r'), chr(100) + chr(0b1011101 + 0o10) + chr(99) + chr(111) + '\x64' + '\145')(chr(0b1110101) + chr(5532 - 5416) + '\x66' + chr(0b101101) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Qd97IG25xIDy(NKKFbr2Z4sr1, _sqfVuM76EP3, P7DmIFVRivx6=None): Re4ydlckRnKx = Hm7TAp8orHi4(_sqfVuM76EP3, schema=P7DmIFVRivx6) return xafqLlk3kkUe(Re4ydlckRnKx, xafqLlk3kkUe(SXOLrMavuUCe(b'Ks=\xf0\x06O\x88\xf1\xcf'), '\144' + '\x65' + chr(5589 - 5490) + chr(6705 - 6594) + chr(0b1100100) + '\145')('\x75' + '\x74' + '\x66' + chr(0b101101) + '\070'))(NKKFbr2Z4sr1)
pandas-dev/pandas
pandas/io/sql.py
_engine_builder
def _engine_builder(con): """ Returns a SQLAlchemy engine from a URI (if con is a string) else it just return con without modifying it. """ global _SQLALCHEMY_INSTALLED if isinstance(con, str): try: import sqlalchemy except ImportError: _SQLALCHEMY_INSTALLED = False else: con = sqlalchemy.create_engine(con) return con return con
python
def _engine_builder(con): """ Returns a SQLAlchemy engine from a URI (if con is a string) else it just return con without modifying it. """ global _SQLALCHEMY_INSTALLED if isinstance(con, str): try: import sqlalchemy except ImportError: _SQLALCHEMY_INSTALLED = False else: con = sqlalchemy.create_engine(con) return con return con
[ "def", "_engine_builder", "(", "con", ")", ":", "global", "_SQLALCHEMY_INSTALLED", "if", "isinstance", "(", "con", ",", "str", ")", ":", "try", ":", "import", "sqlalchemy", "except", "ImportError", ":", "_SQLALCHEMY_INSTALLED", "=", "False", "else", ":", "con", "=", "sqlalchemy", ".", "create_engine", "(", "con", ")", "return", "con", "return", "con" ]
Returns a SQLAlchemy engine from a URI (if con is a string) else it just return con without modifying it.
[ "Returns", "a", "SQLAlchemy", "engine", "from", "a", "URI", "(", "if", "con", "is", "a", "string", ")", "else", "it", "just", "return", "con", "without", "modifying", "it", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L481-L496
train
Returns a SQLAlchemy engine from a URI if con is a string else it just return con without modifying it.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,L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eWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\x6f' + chr(2096 - 2045) + '\x33' + chr(0b100101 + 0o20), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(0b101000 + 0o16) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(0b101001 + 0o15) + chr(53), 2446 - 2438), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + '\x32' + '\x36' + chr(48), 43153 - 43145), ehT0Px3KOsy9(chr(48) + chr(4502 - 4391) + chr(2552 - 2497) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + chr(0b110001) + chr(0b110100) + chr(2113 - 2064), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(1416 - 1367) + '\x32' + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(10779 - 10668) + '\063' + '\064' + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(928 - 817) + chr(2587 - 2533) + chr(0b10001 + 0o40), 16580 - 16572), ehT0Px3KOsy9(chr(0b110000) + chr(2869 - 2758) + chr(952 - 902) + chr(52) + chr(1497 - 1442), 25389 - 25381), ehT0Px3KOsy9('\x30' + chr(0b11100 + 0o123) + chr(0b101110 + 0o5) + chr(0b100110 + 0o21), 0o10), ehT0Px3KOsy9(chr(1797 - 1749) + '\x6f' + '\062' + '\063' + '\x30', 43487 - 43479), ehT0Px3KOsy9(chr(48) + '\157' + chr(116 - 66) + chr(55) + '\x33', 42662 - 42654), ehT0Px3KOsy9(chr(248 - 200) + chr(0b11010 + 0o125) + chr(0b100000 + 0o23) + chr(53) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100111 + 0o10) + chr(49) + chr(0b110001) + chr(54), 37144 - 37136), ehT0Px3KOsy9(chr(1602 - 1554) + '\x6f' + chr(0b110001 + 0o4) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011011 + 0o24) + '\063' + chr(55) + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b10 + 0o61) + chr(1741 - 1686) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(534 - 486) + chr(0b1101111) + chr(50) + chr(1919 - 1864) + '\x34', 30135 - 30127), ehT0Px3KOsy9(chr(0b110000) + chr(8123 - 8012) + '\061' + chr(0b110011) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010101 + 0o32) + chr(49) + chr(406 - 354) + chr(54), 46154 - 46146), ehT0Px3KOsy9(chr(1139 - 1091) + '\x6f' + chr(0b110010) + chr(49) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(498 - 450) + chr(0b1100 + 0o143) + chr(1707 - 1659), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101010 + 0o10) + '\x35' + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(87 - 38) + '\063' + chr(52), 55318 - 55310), ehT0Px3KOsy9(chr(0b110000) + chr(5455 - 5344) + chr(49) + chr(0b110011) + chr(1952 - 1901), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + '\060' + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101011 + 0o4) + chr(0b11010 + 0o31) + chr(52) + chr(0b100001 + 0o22), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\x37' + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + '\064' + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1 + 0o61) + chr(55) + chr(53), 57401 - 57393), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(0b110001 + 0o6) + chr(128 - 78), 0b1000), ehT0Px3KOsy9('\x30' + chr(10888 - 10777) + chr(0b110001) + '\x37' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(876 - 828) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011 + 0o4) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\x31' + chr(0b101011 + 0o13), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101101 + 0o10) + chr(922 - 872), 0o10), ehT0Px3KOsy9('\060' + chr(877 - 766) + chr(49) + chr(2054 - 2001) + chr(1429 - 1381), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b111 + 0o54), 44899 - 44891), ehT0Px3KOsy9(chr(0b110000) + chr(3527 - 3416) + chr(0b110011) + chr(0b110100), 28227 - 28219)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(53) + chr(0b11100 + 0o24), 52144 - 52136)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3'), chr(0b110000 + 0o64) + chr(0b1100101) + chr(4301 - 4202) + chr(6000 - 5889) + '\144' + chr(101))('\165' + chr(116) + chr(102) + chr(0b11011 + 0o22) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def NcAk05ebjpoG(_sqfVuM76EP3): global raxlEYdyOWpM if PlSM16l2KDPD(_sqfVuM76EP3, M8_cKLkHVB2V): try: (PiAb9sTkjfM_,) = (jFWsnpHpAUWz(xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\x87\x99\xd1W\x028\x84\\\xde'), chr(0b1100100) + chr(0b111010 + 0o53) + '\143' + '\157' + '\144' + '\145')(chr(117) + '\164' + '\146' + '\x2d' + '\x38')),) except yROw0HWBk0Qc: raxlEYdyOWpM = ehT0Px3KOsy9(chr(0b110000) + chr(0b111000 + 0o67) + chr(0b110000), 8) else: _sqfVuM76EP3 = PiAb9sTkjfM_.create_engine(_sqfVuM76EP3) return _sqfVuM76EP3 return _sqfVuM76EP3
pandas-dev/pandas
pandas/io/sql.py
pandasSQL_builder
def pandasSQL_builder(con, schema=None, meta=None, is_cursor=False): """ Convenience function to return the correct PandasSQL subclass based on the provided parameters. """ # When support for DBAPI connections is removed, # is_cursor should not be necessary. con = _engine_builder(con) if _is_sqlalchemy_connectable(con): return SQLDatabase(con, schema=schema, meta=meta) elif isinstance(con, str): raise ImportError("Using URI string without sqlalchemy installed.") else: return SQLiteDatabase(con, is_cursor=is_cursor)
python
def pandasSQL_builder(con, schema=None, meta=None, is_cursor=False): """ Convenience function to return the correct PandasSQL subclass based on the provided parameters. """ # When support for DBAPI connections is removed, # is_cursor should not be necessary. con = _engine_builder(con) if _is_sqlalchemy_connectable(con): return SQLDatabase(con, schema=schema, meta=meta) elif isinstance(con, str): raise ImportError("Using URI string without sqlalchemy installed.") else: return SQLiteDatabase(con, is_cursor=is_cursor)
[ "def", "pandasSQL_builder", "(", "con", ",", "schema", "=", "None", ",", "meta", "=", "None", ",", "is_cursor", "=", "False", ")", ":", "# When support for DBAPI connections is removed,", "# is_cursor should not be necessary.", "con", "=", "_engine_builder", "(", "con", ")", "if", "_is_sqlalchemy_connectable", "(", "con", ")", ":", "return", "SQLDatabase", "(", "con", ",", "schema", "=", "schema", ",", "meta", "=", "meta", ")", "elif", "isinstance", "(", "con", ",", "str", ")", ":", "raise", "ImportError", "(", "\"Using URI string without sqlalchemy installed.\"", ")", "else", ":", "return", "SQLiteDatabase", "(", "con", ",", "is_cursor", "=", "is_cursor", ")" ]
Convenience function to return the correct PandasSQL subclass based on the provided parameters.
[ "Convenience", "function", "to", "return", "the", "correct", "PandasSQL", "subclass", "based", "on", "the", "provided", "parameters", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L499-L513
train
Convenience function to return the correct P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uw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\x37' + chr(426 - 377), 22196 - 22188), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(497 - 448) + chr(0b10001 + 0o41) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(408 - 356) + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1001000 + 0o47) + chr(0b11001 + 0o33) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(292 - 244) + chr(6631 - 6520) + chr(738 - 688) + chr(0b101100 + 0o6) + '\062', 0o10), ehT0Px3KOsy9(chr(285 - 237) + chr(111) + '\x33' + chr(0b111 + 0o54) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(0b1100 + 0o50), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + chr(0b10011 + 0o44) + chr(2434 - 2380), 0o10), ehT0Px3KOsy9(chr(1486 - 1438) + chr(0b1010010 + 0o35) + '\061' + chr(1570 - 1515) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(11488 - 11377) + chr(49) + chr(0b110110) + chr(0b11100 + 0o33), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100111 + 0o10) + chr(661 - 612) + chr(53) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(3409 - 3298) + chr(50) + '\064' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1954 - 1906) + chr(0b1101111) + '\x32' + chr(2701 - 2646), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x33' + chr(1700 - 1651), 15011 - 15003), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b11100 + 0o123) + chr(0b110011) + chr(2095 - 2042) + chr(0b11010 + 0o35), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(814 - 763) + '\061' + chr(0b100010 + 0o25), 0o10), ehT0Px3KOsy9('\060' + chr(6142 - 6031) + chr(0b1011 + 0o47) + '\063' + chr(0b1100 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(0b11001 + 0o32) + chr(49) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011100 + 0o23) + '\061' + chr(0b101111 + 0o2) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(10078 - 9967) + '\064' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(933 - 885) + '\x6f' + chr(0b10010 + 0o40) + '\x33' + chr(0b1 + 0o64), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1671 - 1622) + chr(0b10110 + 0o33) + chr(0b110010 + 0o4), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101101 + 0o11), 27863 - 27855), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + chr(0b110110) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(1986 - 1938) + chr(0b1101111) + chr(0b101010 + 0o11) + chr(1106 - 1058) + chr(0b110 + 0o61), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x35' + chr(0b100010 + 0o16), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(534 - 484) + chr(0b10110 + 0o32), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(0b110101) + '\x35', 50852 - 50844), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + '\x31' + chr(2110 - 2058), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(10235 - 10124) + '\x32' + '\x37', 8), ehT0Px3KOsy9(chr(1843 - 1795) + '\x6f' + chr(0b11001 + 0o30) + '\x32', 60018 - 60010), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(410 - 299) + chr(0b110010) + chr(52) + chr(0b11010 + 0o35), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(0b101011 + 0o7) + chr(1648 - 1596), 0o10), ehT0Px3KOsy9('\060' + chr(9141 - 9030) + '\x31' + chr(54) + chr(0b110000 + 0o6), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5594 - 5483) + chr(0b110001) + chr(0b1011 + 0o52) + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(2932 - 2821) + '\x31' + chr(1514 - 1461) + chr(0b101001 + 0o16), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(0b110011) + '\x37', 27344 - 27336), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(52) + chr(54), 17593 - 17585)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + chr(53) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7'), chr(4620 - 4520) + '\145' + chr(99) + chr(1563 - 1452) + '\144' + chr(5130 - 5029))('\x75' + chr(3784 - 3668) + '\x66' + chr(1053 - 1008) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def Hm7TAp8orHi4(_sqfVuM76EP3, P7DmIFVRivx6=None, Ddxy_ihdYXS3=None, XZeymUwWp6JJ=ehT0Px3KOsy9(chr(1334 - 1286) + chr(0b1101111) + '\x30', 0o10)): _sqfVuM76EP3 = NcAk05ebjpoG(_sqfVuM76EP3) if Q1dJV0ss0eny(_sqfVuM76EP3): return APbCRgLa2CC0(_sqfVuM76EP3, schema=P7DmIFVRivx6, meta=Ddxy_ihdYXS3) elif PlSM16l2KDPD(_sqfVuM76EP3, M8_cKLkHVB2V): raise yROw0HWBk0Qc(xafqLlk3kkUe(SXOLrMavuUCe(b'\xac$\x08H\xf5\xf8Il5!\x04\x1a\xd4~7\x88\xef\xea\xa5=H\xf2;r\x10\xb4d\x04\xf1\x01o\x7fo\xca\xedV\x05\x01\xac\x92\x98;\rC\xf6\xf6'), chr(0b101111 + 0o65) + chr(101) + '\x63' + '\157' + chr(100) + chr(101))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b0 + 0o55) + chr(0b111000))) else: return bPxPu_8gzhG3(_sqfVuM76EP3, is_cursor=XZeymUwWp6JJ)
pandas-dev/pandas
pandas/io/sql.py
get_schema
def get_schema(frame, name, keys=None, con=None, dtype=None): """ Get the SQL db table schema for the given frame. Parameters ---------- frame : DataFrame name : string name of SQL table keys : string or sequence, default: None columns to use a primary key con: an open SQL database connection object or a SQLAlchemy connectable Using SQLAlchemy makes it possible to use any DB supported by that library, default: None If a DBAPI2 object, only sqlite3 is supported. dtype : dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type, or a string for sqlite3 fallback connection. """ pandas_sql = pandasSQL_builder(con=con) return pandas_sql._create_sql_schema(frame, name, keys=keys, dtype=dtype)
python
def get_schema(frame, name, keys=None, con=None, dtype=None): """ Get the SQL db table schema for the given frame. Parameters ---------- frame : DataFrame name : string name of SQL table keys : string or sequence, default: None columns to use a primary key con: an open SQL database connection object or a SQLAlchemy connectable Using SQLAlchemy makes it possible to use any DB supported by that library, default: None If a DBAPI2 object, only sqlite3 is supported. dtype : dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type, or a string for sqlite3 fallback connection. """ pandas_sql = pandasSQL_builder(con=con) return pandas_sql._create_sql_schema(frame, name, keys=keys, dtype=dtype)
[ "def", "get_schema", "(", "frame", ",", "name", ",", "keys", "=", "None", ",", "con", "=", "None", ",", "dtype", "=", "None", ")", ":", "pandas_sql", "=", "pandasSQL_builder", "(", "con", "=", "con", ")", "return", "pandas_sql", ".", "_create_sql_schema", "(", "frame", ",", "name", ",", "keys", "=", "keys", ",", "dtype", "=", "dtype", ")" ]
Get the SQL db table schema for the given frame. Parameters ---------- frame : DataFrame name : string name of SQL table keys : string or sequence, default: None columns to use a primary key con: an open SQL database connection object or a SQLAlchemy connectable Using SQLAlchemy makes it possible to use any DB supported by that library, default: None If a DBAPI2 object, only sqlite3 is supported. dtype : dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type, or a string for sqlite3 fallback connection.
[ "Get", "the", "SQL", "db", "table", "schema", "for", "the", "given", "frame", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L1564-L1586
train
Returns the SQL db table schema for the given DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2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riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1958 - 1910) + chr(0b1101111) + '\x33' + '\x32' + chr(0b100011 + 0o16), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1010111 + 0o30) + chr(0b101110 + 0o3) + '\065' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + chr(50) + chr(0b10011 + 0o44) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(979 - 931) + chr(0b1010101 + 0o32) + chr(0b110010) + chr(50) + chr(0b10101 + 0o36), 0o10), ehT0Px3KOsy9(chr(99 - 51) + chr(0b1101111) + chr(53) + chr(0b11100 + 0o27), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(711 - 600) + chr(1302 - 1252) + '\x33' + chr(0b110001), 31714 - 31706), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(924 - 813) + '\063' + chr(457 - 402), 43976 - 43968), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(418 - 368) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + '\066' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + chr(0b110010) + '\063' + '\066', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1908 - 1857) + '\x31' + chr(125 - 76), 27464 - 27456), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(3043 - 2932) + '\x33' + chr(0b101 + 0o53) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1101 + 0o44) + '\064' + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(10105 - 9994) + chr(0b11111 + 0o30) + chr(989 - 936), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\066' + chr(48), 63324 - 63316), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b110100 + 0o1) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + '\062' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(2010 - 1962) + '\x6f' + chr(0b110001) + chr(0b10100 + 0o34) + chr(798 - 746), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b11110 + 0o121) + '\062' + chr(0b101011 + 0o14) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9278 - 9167) + chr(50) + '\x36' + '\061', 44565 - 44557), ehT0Px3KOsy9(chr(48) + chr(0b1100101 + 0o12) + chr(191 - 141) + chr(2808 - 2753) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + chr(1107 - 1055) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + chr(49) + chr(0b100010 + 0o24) + chr(1490 - 1441), ord("\x08")), ehT0Px3KOsy9('\060' + chr(2697 - 2586) + '\x31' + '\x31' + chr(0b101010 + 0o7), 52792 - 52784), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(52) + chr(0b11110 + 0o23), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\066' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1000101 + 0o52) + chr(2202 - 2152) + chr(0b100011 + 0o15) + chr(1502 - 1454), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\x6f' + chr(305 - 254) + chr(521 - 472) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(824 - 776) + '\x6f' + '\x34' + chr(0b11100 + 0o26), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(111) + chr(50) + '\x34' + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + '\x36' + chr(0b10000 + 0o46), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10011 + 0o44) + '\x30', 30082 - 30074), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b110100 + 0o73) + chr(0b110010) + chr(0b110110) + chr(596 - 542), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(1262 - 1209), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\064' + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(1590 - 1540) + '\067', 55962 - 55954), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2339 - 2288) + '\x36' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\066', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110101) + chr(1823 - 1775), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xff'), chr(4678 - 4578) + chr(101) + chr(5740 - 5641) + chr(0b1101111) + chr(6787 - 6687) + '\145')(chr(0b1110101) + chr(8708 - 8592) + chr(0b1100110) + chr(45) + chr(2905 - 2849)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def QMSANZNiT5L0(C4IqNNmLfHXB, AIvJRzLdDfgF, w8H8C9ec5BO1=None, _sqfVuM76EP3=None, jSV9IKnemH7K=None): Re4ydlckRnKx = Hm7TAp8orHi4(con=_sqfVuM76EP3) return xafqLlk3kkUe(Re4ydlckRnKx, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e\n\xcc\xf6Ja\xfc@&\x87\xf2\x96\xb0x\x0fX\xdd\xc8'), chr(7677 - 7577) + '\145' + '\x63' + chr(9040 - 8929) + chr(0b1100100) + chr(0b1100100 + 0o1))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(0b111000)))(C4IqNNmLfHXB, AIvJRzLdDfgF, keys=w8H8C9ec5BO1, dtype=jSV9IKnemH7K)
pandas-dev/pandas
pandas/io/sql.py
SQLTable._execute_insert
def _execute_insert(self, conn, keys, data_iter): """Execute SQL statement inserting data Parameters ---------- conn : sqlalchemy.engine.Engine or sqlalchemy.engine.Connection keys : list of str Column names data_iter : generator of list Each item contains a list of values to be inserted """ data = [dict(zip(keys, row)) for row in data_iter] conn.execute(self.table.insert(), data)
python
def _execute_insert(self, conn, keys, data_iter): """Execute SQL statement inserting data Parameters ---------- conn : sqlalchemy.engine.Engine or sqlalchemy.engine.Connection keys : list of str Column names data_iter : generator of list Each item contains a list of values to be inserted """ data = [dict(zip(keys, row)) for row in data_iter] conn.execute(self.table.insert(), data)
[ "def", "_execute_insert", "(", "self", ",", "conn", ",", "keys", ",", "data_iter", ")", ":", "data", "=", "[", "dict", "(", "zip", "(", "keys", ",", "row", ")", ")", "for", "row", "in", "data_iter", "]", "conn", ".", "execute", "(", "self", ".", "table", ".", "insert", "(", ")", ",", "data", ")" ]
Execute SQL statement inserting data Parameters ---------- conn : sqlalchemy.engine.Engine or sqlalchemy.engine.Connection keys : list of str Column names data_iter : generator of list Each item contains a list of values to be inserted
[ "Execute", "SQL", "statement", "inserting", "data" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io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SQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(614 - 566) + '\x6f' + '\061' + chr(51) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b110110 + 0o0) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + '\x30' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11101 + 0o122) + '\x32' + chr(0b111 + 0o60) + '\060', 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(50) + '\060' + '\x36', 65387 - 65379), ehT0Px3KOsy9(chr(48) + chr(0b1100110 + 0o11) + chr(0b101011 + 0o6) + '\061' + '\x37', 6110 - 6102), ehT0Px3KOsy9(chr(48) + chr(378 - 267) + chr(0b110100 + 0o2) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(111) + chr(775 - 726) + chr(902 - 848) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + '\064' + chr(0b110010), 55728 - 55720), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b110001) + chr(0b10101 + 0o41), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101101 + 0o6) + chr(1662 - 1607) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(2860 - 2749) + chr(850 - 801) + chr(0b10 + 0o65), 25156 - 25148), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(55) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x35' + chr(0b11000 + 0o33), 57750 - 57742), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(532 - 480) + chr(0b110111), 4334 - 4326), ehT0Px3KOsy9('\060' + '\157' + chr(0b1111 + 0o43) + chr(0b110010) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(0b110100) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(1993 - 1945) + chr(111) + chr(2239 - 2190) + chr(0b110101) + chr(0b1110 + 0o50), ord("\x08")), ehT0Px3KOsy9(chr(1192 - 1144) + chr(0b1101111) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b100101 + 0o112) + '\063' + chr(1879 - 1829) + chr(227 - 174), 37900 - 37892), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(2304 - 2255) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\062' + chr(2304 - 2256), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2214 - 2164) + chr(53) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(4242 - 4131) + chr(0b1111 + 0o44) + chr(1110 - 1056) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(835 - 785) + chr(0b110101) + chr(1552 - 1501), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10 + 0o57) + chr(1962 - 1914) + chr(0b100001 + 0o23), 0b1000), ehT0Px3KOsy9(chr(48) + chr(620 - 509) + chr(0b10100 + 0o36) + chr(0b110100 + 0o2) + chr(0b10101 + 0o40), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110100) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(718 - 667) + chr(0b111 + 0o55) + chr(50), 8), ehT0Px3KOsy9(chr(432 - 384) + chr(0b101 + 0o152) + '\063' + chr(0b11101 + 0o23) + chr(0b11010 + 0o34), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(11712 - 11601) + '\063' + chr(2225 - 2171) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\x32' + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(0b110100) + chr(0b10000 + 0o43), 0b1000), ehT0Px3KOsy9('\x30' + chr(8231 - 8120) + chr(1497 - 1448) + '\063' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + chr(0b10 + 0o61) + chr(2169 - 2115) + chr(0b101010 + 0o12), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111100 + 0o63) + '\x33' + chr(641 - 592) + '\062', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(0b110011 + 0o1) + chr(0b10100 + 0o43), 17055 - 17047), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\x35' + chr(0b100 + 0o61), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000000 + 0o57) + '\x33' + chr(2227 - 2177) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(53) + chr(0b10110 + 0o37), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x35' + chr(1120 - 1072), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'u'), '\x64' + '\145' + chr(0b100101 + 0o76) + chr(111) + chr(5556 - 5456) + chr(0b1100101))(chr(11910 - 11793) + '\x74' + '\x66' + '\055' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def blQ6hN2LG7pV(oVre8I6UXc3b, npwjCV10gdob, w8H8C9ec5BO1, Qlm2mKMkeI3e): ULnjp6D6efFH = [wLqBDw8l0eIm(pZ0NK2y6HRbn(w8H8C9ec5BO1, TAK9K32TkBdA)) for TAK9K32TkBdA in Qlm2mKMkeI3e] xafqLlk3kkUe(npwjCV10gdob, xafqLlk3kkUe(SXOLrMavuUCe(b'>\xcb\xa6\xdb\xf3;P'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b1010000 + 0o37) + chr(0b10110 + 0o116) + chr(5748 - 5647))('\165' + chr(679 - 563) + '\146' + chr(936 - 891) + chr(0b10000 + 0o50)))(xafqLlk3kkUe(oVre8I6UXc3b.table, xafqLlk3kkUe(SXOLrMavuUCe(b'2\xdd\xb0\xdd\xf4;'), '\x64' + '\x65' + '\143' + '\x6f' + chr(6107 - 6007) + '\x65')(chr(0b1110101) + chr(116) + chr(7422 - 7320) + '\x2d' + chr(2619 - 2563)))(), ULnjp6D6efFH)
pandas-dev/pandas
pandas/io/sql.py
SQLTable._query_iterator
def _query_iterator(self, result, chunksize, columns, coerce_float=True, parse_dates=None): """Return generator through chunked result set.""" while True: data = result.fetchmany(chunksize) if not data: break else: self.frame = DataFrame.from_records( data, columns=columns, coerce_float=coerce_float) self._harmonize_columns(parse_dates=parse_dates) if self.index is not None: self.frame.set_index(self.index, inplace=True) yield self.frame
python
def _query_iterator(self, result, chunksize, columns, coerce_float=True, parse_dates=None): """Return generator through chunked result set.""" while True: data = result.fetchmany(chunksize) if not data: break else: self.frame = DataFrame.from_records( data, columns=columns, coerce_float=coerce_float) self._harmonize_columns(parse_dates=parse_dates) if self.index is not None: self.frame.set_index(self.index, inplace=True) yield self.frame
[ "def", "_query_iterator", "(", "self", ",", "result", ",", "chunksize", ",", "columns", ",", "coerce_float", "=", "True", ",", "parse_dates", "=", "None", ")", ":", "while", "True", ":", "data", "=", "result", ".", "fetchmany", "(", "chunksize", ")", "if", "not", "data", ":", "break", "else", ":", "self", ".", "frame", "=", "DataFrame", ".", "from_records", "(", "data", ",", "columns", "=", "columns", ",", "coerce_float", "=", "coerce_float", ")", "self", ".", "_harmonize_columns", "(", "parse_dates", "=", "parse_dates", ")", "if", "self", ".", "index", "is", "not", "None", ":", "self", ".", "frame", ".", "set_index", "(", "self", ".", "index", ",", "inplace", "=", "True", ")", "yield", "self", ".", "frame" ]
Return generator through chunked result set.
[ "Return", "generator", "through", "chunked", "result", "set", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py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tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1111 + 0o140) + chr(51) + chr(0b110100) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + '\066' + '\x36', 64303 - 64295), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b101000 + 0o107) + chr(671 - 620) + chr(55) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1 + 0o156) + chr(0b110010) + '\x36', 0o10), ehT0Px3KOsy9(chr(1580 - 1532) + '\157' + chr(0b10001 + 0o42) + '\x32' + chr(55), 11363 - 11355), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b1101 + 0o47) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\067' + chr(0b10000 + 0o44), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100010 + 0o15) + '\062' + chr(0b11001 + 0o27) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x35' + chr(0b1011 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(6183 - 6072) + chr(0b11011 + 0o27) + '\x31' + chr(0b10010 + 0o44), 19357 - 19349), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + '\x32' + chr(53), 33457 - 33449), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100000 + 0o21) + chr(0b110010), 31034 - 31026), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + '\064' + chr(0b11010 + 0o33), 29263 - 29255), ehT0Px3KOsy9('\x30' + chr(3344 - 3233) + chr(0b110 + 0o54) + chr(0b11 + 0o57) + chr(0b100001 + 0o23), 0b1000), ehT0Px3KOsy9(chr(683 - 635) + chr(1752 - 1641) + '\x32' + '\x37' + '\066', 2955 - 2947), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\x34' + chr(0b101111 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(1326 - 1278) + '\157' + '\063' + chr(0b110101) + chr(0b101000 + 0o16), 0b1000), ehT0Px3KOsy9(chr(2131 - 2083) + '\157' + '\061' + chr(1398 - 1349) + chr(0b1001 + 0o56), 43863 - 43855), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b110100) + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100010 + 0o21) + chr(0b1 + 0o57) + chr(0b100011 + 0o15), 0b1000), ehT0Px3KOsy9(chr(667 - 619) + chr(7706 - 7595) + chr(285 - 236) + chr(0b110100) + chr(0b1100 + 0o44), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110100 + 0o3), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(843 - 793) + chr(0b110100) + chr(0b10101 + 0o37), 20510 - 20502), ehT0Px3KOsy9('\060' + chr(6130 - 6019) + chr(0b110001) + '\x37' + chr(0b100011 + 0o23), 49309 - 49301), ehT0Px3KOsy9(chr(0b110000) + chr(0b11010 + 0o125) + chr(0b110011) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(0b11000 + 0o127) + chr(50) + '\x33' + chr(50), 0b1000), ehT0Px3KOsy9(chr(97 - 49) + chr(0b101100 + 0o103) + chr(1665 - 1612) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1000 + 0o51) + chr(0b11000 + 0o36) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(277 - 226) + '\060' + chr(2489 - 2438), 43608 - 43600), ehT0Px3KOsy9(chr(1080 - 1032) + chr(0b1000001 + 0o56) + '\x33' + chr(0b1100 + 0o53) + chr(50), 8), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(0b11001 + 0o31) + chr(0b110000) + chr(0b10001 + 0o44), 51300 - 51292), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(0b110010) + '\060' + chr(0b111 + 0o51), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(0b110010) + chr(48), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100111 + 0o12) + chr(1421 - 1366) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + '\x31' + '\065' + chr(0b110110), 37307 - 37299), ehT0Px3KOsy9(chr(1401 - 1353) + chr(0b1101111) + chr(0b101101 + 0o7) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(6905 - 6794) + chr(49) + chr(0b110011) + chr(2129 - 2075), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2276 - 2226) + '\064' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(393 - 345) + chr(0b1101111) + '\062' + chr(0b101111 + 0o5), 43653 - 43645), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(54) + chr(0b1010 + 0o47), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1100110 + 0o11) + chr(0b11101 + 0o30) + chr(0b10000 + 0o40), 29503 - 29495)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf'), chr(391 - 291) + '\x65' + '\x63' + chr(6302 - 6191) + chr(100) + chr(9866 - 9765))(chr(0b1110101) + '\x74' + chr(0b1100110) + '\055' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ysyuhdWchnZj(oVre8I6UXc3b, ShZmEKfTkAOZ, op94qe_Rdjul, qKlXBtn3PKy4, hyGdBsLYkQVS=ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001), 43550 - 43542), T1brfYV34pPD=None): while ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31', 8): ULnjp6D6efFH = ShZmEKfTkAOZ.fetchmany(op94qe_Rdjul) if not ULnjp6D6efFH: break else: oVre8I6UXc3b.C4IqNNmLfHXB = TTWbaLX2VikC.from_records(ULnjp6D6efFH, columns=qKlXBtn3PKy4, coerce_float=hyGdBsLYkQVS) xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe\xde\x9bd\xba\x89\x92\xeaV\xeb\xcai\x8a\xf8\xcb\t\x80<'), '\x64' + chr(0b1100101) + '\x63' + chr(0b101100 + 0o103) + chr(0b1100100) + chr(0b1100101))(chr(1235 - 1118) + chr(116) + '\146' + chr(0b101101) + chr(0b101100 + 0o14)))(parse_dates=T1brfYV34pPD) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\xd2\x95a\x85\x84\xb6\xc8v\xd9\xd93'), chr(100) + chr(8601 - 8500) + chr(3902 - 3803) + '\157' + chr(0b1 + 0o143) + chr(1733 - 1632))('\x75' + '\x74' + '\x66' + '\055' + '\070')) is not None: xafqLlk3kkUe(oVre8I6UXc3b.frame, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xd3\x8eI\xbe\x88\x98\xe6T'), chr(100) + '\x65' + '\143' + '\x6f' + chr(0b10001 + 0o123) + '\145')(chr(6749 - 6632) + '\x74' + chr(0b1100110) + chr(1537 - 1492) + chr(0b101001 + 0o17)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\xd2\x95a\x85\x84\xb6\xc8v\xd9\xd93'), '\144' + chr(2170 - 2069) + chr(0b1000110 + 0o35) + chr(0b1101111) + '\144' + '\x65')(chr(0b110001 + 0o104) + '\164' + chr(0b1100110) + chr(45) + '\070')), inplace=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10000 + 0o41), 8)) yield xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2\x82\xb3g\x99\xa8\x91\xcfJ\xc6\xcdH'), chr(0b100111 + 0o75) + chr(1616 - 1515) + chr(0b0 + 0o143) + '\x6f' + chr(0b1100100) + chr(1372 - 1271))(chr(0b11011 + 0o132) + chr(0b1101011 + 0o11) + chr(0b101001 + 0o75) + chr(741 - 696) + chr(56)))
pandas-dev/pandas
pandas/io/sql.py
SQLTable._harmonize_columns
def _harmonize_columns(self, parse_dates=None): """ Make the DataFrame's column types align with the SQL table column types. Need to work around limited NA value support. Floats are always fine, ints must always be floats if there are Null values. Booleans are hard because converting bool column with None replaces all Nones with false. Therefore only convert bool if there are no NA values. Datetimes should already be converted to np.datetime64 if supported, but here we also force conversion if required. """ parse_dates = _process_parse_dates_argument(parse_dates) for sql_col in self.table.columns: col_name = sql_col.name try: df_col = self.frame[col_name] # Handle date parsing upfront; don't try to convert columns # twice if col_name in parse_dates: try: fmt = parse_dates[col_name] except TypeError: fmt = None self.frame[col_name] = _handle_date_column( df_col, format=fmt) continue # the type the dataframe column should have col_type = self._get_dtype(sql_col.type) if (col_type is datetime or col_type is date or col_type is DatetimeTZDtype): # Convert tz-aware Datetime SQL columns to UTC utc = col_type is DatetimeTZDtype self.frame[col_name] = _handle_date_column(df_col, utc=utc) elif col_type is float: # floats support NA, can always convert! self.frame[col_name] = df_col.astype(col_type, copy=False) elif len(df_col) == df_col.count(): # No NA values, can convert ints and bools if col_type is np.dtype('int64') or col_type is bool: self.frame[col_name] = df_col.astype( col_type, copy=False) except KeyError: pass
python
def _harmonize_columns(self, parse_dates=None): """ Make the DataFrame's column types align with the SQL table column types. Need to work around limited NA value support. Floats are always fine, ints must always be floats if there are Null values. Booleans are hard because converting bool column with None replaces all Nones with false. Therefore only convert bool if there are no NA values. Datetimes should already be converted to np.datetime64 if supported, but here we also force conversion if required. """ parse_dates = _process_parse_dates_argument(parse_dates) for sql_col in self.table.columns: col_name = sql_col.name try: df_col = self.frame[col_name] # Handle date parsing upfront; don't try to convert columns # twice if col_name in parse_dates: try: fmt = parse_dates[col_name] except TypeError: fmt = None self.frame[col_name] = _handle_date_column( df_col, format=fmt) continue # the type the dataframe column should have col_type = self._get_dtype(sql_col.type) if (col_type is datetime or col_type is date or col_type is DatetimeTZDtype): # Convert tz-aware Datetime SQL columns to UTC utc = col_type is DatetimeTZDtype self.frame[col_name] = _handle_date_column(df_col, utc=utc) elif col_type is float: # floats support NA, can always convert! self.frame[col_name] = df_col.astype(col_type, copy=False) elif len(df_col) == df_col.count(): # No NA values, can convert ints and bools if col_type is np.dtype('int64') or col_type is bool: self.frame[col_name] = df_col.astype( col_type, copy=False) except KeyError: pass
[ "def", "_harmonize_columns", "(", "self", ",", "parse_dates", "=", "None", ")", ":", "parse_dates", "=", "_process_parse_dates_argument", "(", "parse_dates", ")", "for", "sql_col", "in", "self", ".", "table", ".", "columns", ":", "col_name", "=", "sql_col", ".", "name", "try", ":", "df_col", "=", "self", ".", "frame", "[", "col_name", "]", "# Handle date parsing upfront; don't try to convert columns", "# twice", "if", "col_name", "in", "parse_dates", ":", "try", ":", "fmt", "=", "parse_dates", "[", "col_name", "]", "except", "TypeError", ":", "fmt", "=", "None", "self", ".", "frame", "[", "col_name", "]", "=", "_handle_date_column", "(", "df_col", ",", "format", "=", "fmt", ")", "continue", "# the type the dataframe column should have", "col_type", "=", "self", ".", "_get_dtype", "(", "sql_col", ".", "type", ")", "if", "(", "col_type", "is", "datetime", "or", "col_type", "is", "date", "or", "col_type", "is", "DatetimeTZDtype", ")", ":", "# Convert tz-aware Datetime SQL columns to UTC", "utc", "=", "col_type", "is", "DatetimeTZDtype", "self", ".", "frame", "[", "col_name", "]", "=", "_handle_date_column", "(", "df_col", ",", "utc", "=", "utc", ")", "elif", "col_type", "is", "float", ":", "# floats support NA, can always convert!", "self", ".", "frame", "[", "col_name", "]", "=", "df_col", ".", "astype", "(", "col_type", ",", "copy", "=", "False", ")", "elif", "len", "(", "df_col", ")", "==", "df_col", ".", "count", "(", ")", ":", "# No NA values, can convert ints and bools", "if", "col_type", "is", "np", ".", "dtype", "(", "'int64'", ")", "or", "col_type", "is", "bool", ":", "self", ".", "frame", "[", "col_name", "]", "=", "df_col", ".", "astype", "(", "col_type", ",", "copy", "=", "False", ")", "except", "KeyError", ":", "pass" ]
Make the DataFrame's column types align with the SQL table column types. Need to work around limited NA value support. Floats are always fine, ints must always be floats if there are Null values. Booleans are hard because converting bool column with None replaces all Nones with false. Therefore only convert bool if there are no NA values. Datetimes should already be converted to np.datetime64 if supported, but here we also force conversion if required.
[ "Make", "the", "DataFrame", "s", "column", "types", "align", "with", "the", "SQL", "table", "column", "types", ".", "Need", "to", "work", "around", "limited", "NA", "value", "support", ".", "Floats", "are", "always", "fine", "ints", "must", "always", "be", "floats", "if", "there", "are", "Null", "values", ".", "Booleans", "are", "hard", "because", "converting", "bool", "column", "with", "None", "replaces", "all", "Nones", "with", "false", ".", "Therefore", "only", "convert", "bool", "if", "there", "are", "no", "NA", "values", ".", "Datetimes", "should", "already", "be", "converted", "to", "np", ".", "datetime64", "if", "supported", "but", "here", "we", "also", "force", "conversion", "if", "required", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L803-L851
train
Harmonize the columns of the DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7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wYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1308 - 1260) + chr(0b1101111) + chr(0b1 + 0o60) + '\061' + chr(54), 1318 - 1310), ehT0Px3KOsy9(chr(667 - 619) + '\157' + chr(0b11010 + 0o31) + '\064' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101 + 0o57) + chr(0b1011 + 0o50), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(2165 - 2114) + '\x34' + chr(0b101010 + 0o13), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(1006 - 954) + '\062', 56528 - 56520), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101110 + 0o3) + '\060' + '\x37', 0o10), ehT0Px3KOsy9(chr(1566 - 1518) + chr(111) + '\x31' + chr(0b110010) + chr(0b110110), 44558 - 44550), ehT0Px3KOsy9(chr(1898 - 1850) + '\x6f' + '\062' + chr(49) + chr(0b110011 + 0o4), 0b1000), ehT0Px3KOsy9(chr(1407 - 1359) + chr(0b1101111) + '\x32' + '\x33' + '\x34', 4948 - 4940), ehT0Px3KOsy9(chr(2129 - 2081) + '\x6f' + '\x33' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x36' + '\061', 0b1000), ehT0Px3KOsy9(chr(1164 - 1116) + chr(0b1000101 + 0o52) + '\062' + '\062' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(55) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b11 + 0o154) + '\x31' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + '\062' + '\x34' + '\x32', 58303 - 58295), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(0b110101) + chr(0b110111), 45101 - 45093), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(1249 - 1200) + '\067', 31018 - 31010), ehT0Px3KOsy9(chr(1786 - 1738) + '\x6f' + chr(0b1110 + 0o43) + chr(0b1011 + 0o52) + chr(538 - 489), 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(5795 - 5684) + chr(2393 - 2344) + '\x36' + '\x30', 14244 - 14236), ehT0Px3KOsy9(chr(110 - 62) + chr(111) + chr(2002 - 1952) + chr(0b110000) + chr(0b1101 + 0o45), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(54) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110010) + '\x33', 45043 - 45035), ehT0Px3KOsy9('\x30' + '\x6f' + chr(727 - 678) + chr(1200 - 1148) + chr(802 - 753), 47863 - 47855), ehT0Px3KOsy9('\060' + chr(0b1100001 + 0o16) + '\x31' + chr(0b110000) + chr(1677 - 1625), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8982 - 8871) + chr(720 - 669) + chr(877 - 824) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\066' + chr(0b101110 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(966 - 918) + chr(0b1101111) + chr(50) + '\x35' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + '\x33' + chr(0b110101) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2058 - 2009) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b101100 + 0o103) + chr(1464 - 1415) + '\x36' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b100001 + 0o25) + chr(1785 - 1733), 0o10), ehT0Px3KOsy9(chr(1862 - 1814) + chr(0b1101111) + chr(54) + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\067' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(9294 - 9183) + chr(0b110000 + 0o2) + chr(0b11001 + 0o32) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(50) + chr(0b110001) + '\064', 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(51) + '\x30' + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\x31' + chr(2231 - 2179), 8), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + chr(0b100110 + 0o13) + '\x33', 8), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(0b111 + 0o54) + chr(0b110000) + chr(50), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(53) + '\x36', 6627 - 6619)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(2236 - 2188) + chr(0b1100100 + 0o13) + chr(0b1001 + 0o54) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'`'), chr(7646 - 7546) + '\x65' + chr(0b1100011) + chr(8172 - 8061) + chr(786 - 686) + chr(5255 - 5154))(chr(117) + chr(116) + '\x66' + chr(1051 - 1006) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def OZR_pQymANGD(oVre8I6UXc3b, T1brfYV34pPD=None): T1brfYV34pPD = Vdob_8esVEbU(T1brfYV34pPD) for THhoCIGuUw2T in xafqLlk3kkUe(oVre8I6UXc3b.table, xafqLlk3kkUe(SXOLrMavuUCe(b'?\xa8O\xbd 38\xbc\xccVH\xa3'), chr(100) + chr(9644 - 9543) + chr(0b1010011 + 0o20) + chr(0b1000100 + 0o53) + chr(0b1100100) + chr(2298 - 2197))(chr(0b1110101) + chr(0b1110100) + chr(0b101011 + 0o73) + '\x2d' + chr(56))): W93rymQCbozJ = THhoCIGuUw2T.AIvJRzLdDfgF try: lhzRzl6zabVS = oVre8I6UXc3b.C4IqNNmLfHXB[W93rymQCbozJ] if W93rymQCbozJ in T1brfYV34pPD: try: EwDuvMM18jq4 = T1brfYV34pPD[W93rymQCbozJ] except sznFqDbNBHlx: EwDuvMM18jq4 = None oVre8I6UXc3b.C4IqNNmLfHXB[W93rymQCbozJ] = XJ3YiAnKRkOa(lhzRzl6zabVS, format=EwDuvMM18jq4) continue tsawQFQB3tvJ = oVre8I6UXc3b._get_dtype(THhoCIGuUw2T.type) if tsawQFQB3tvJ is zKdiQFzuryNR or tsawQFQB3tvJ is J4aeFOr3sjPo or tsawQFQB3tvJ is KOjhPpkKZCOh: FvivsEIKa897 = tsawQFQB3tvJ is KOjhPpkKZCOh oVre8I6UXc3b.C4IqNNmLfHXB[W93rymQCbozJ] = XJ3YiAnKRkOa(lhzRzl6zabVS, utc=FvivsEIKa897) elif tsawQFQB3tvJ is kkSX4ccExqw4: oVre8I6UXc3b.C4IqNNmLfHXB[W93rymQCbozJ] = lhzRzl6zabVS.astype(tsawQFQB3tvJ, copy=ehT0Px3KOsy9(chr(0b110000) + chr(7673 - 7562) + chr(48), 12055 - 12047)) elif c2A0yzQpDQB3(lhzRzl6zabVS) == xafqLlk3kkUe(lhzRzl6zabVS, xafqLlk3kkUe(SXOLrMavuUCe(b'-\x8cV\x8b\x16'), '\x64' + chr(1659 - 1558) + chr(99) + chr(7805 - 7694) + chr(100) + chr(7710 - 7609))('\165' + chr(0b1101 + 0o147) + '\x66' + chr(373 - 328) + '\070'))(): if tsawQFQB3tvJ is xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'*\x97Z\x95\x07'), chr(0b111110 + 0o46) + chr(101) + '\143' + chr(111) + chr(6385 - 6285) + '\x65')(chr(0b1110101) + chr(8865 - 8749) + '\x66' + chr(0b10110 + 0o27) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b"'\x8dW\xd3V"), chr(100) + '\145' + chr(0b111100 + 0o47) + chr(4918 - 4807) + '\x64' + '\145')('\165' + chr(0b1100111 + 0o15) + '\146' + chr(0b101 + 0o50) + chr(56))) or tsawQFQB3tvJ is WbBjf8Y7v9VN: oVre8I6UXc3b.C4IqNNmLfHXB[W93rymQCbozJ] = lhzRzl6zabVS.astype(tsawQFQB3tvJ, copy=ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\x6f' + chr(48), 8)) except RQ6CSRrFArYB: pass
pandas-dev/pandas
pandas/io/sql.py
SQLDatabase.read_table
def read_table(self, table_name, index_col=None, coerce_float=True, parse_dates=None, columns=None, schema=None, chunksize=None): """Read SQL database table into a DataFrame. Parameters ---------- table_name : string Name of SQL table in database. index_col : string, optional, default: None Column to set as index. coerce_float : boolean, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. This can result in loss of precision. parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg}``, where the arg corresponds to the keyword arguments of :func:`pandas.to_datetime`. Especially useful with databases without native Datetime support, such as SQLite. columns : list, default: None List of column names to select from SQL table. schema : string, default None Name of SQL schema in database to query (if database flavor supports this). If specified, this overwrites the default schema of the SQL database object. chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- pandas.read_sql_table SQLDatabase.read_query """ table = SQLTable(table_name, self, index=index_col, schema=schema) return table.read(coerce_float=coerce_float, parse_dates=parse_dates, columns=columns, chunksize=chunksize)
python
def read_table(self, table_name, index_col=None, coerce_float=True, parse_dates=None, columns=None, schema=None, chunksize=None): """Read SQL database table into a DataFrame. Parameters ---------- table_name : string Name of SQL table in database. index_col : string, optional, default: None Column to set as index. coerce_float : boolean, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. This can result in loss of precision. parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg}``, where the arg corresponds to the keyword arguments of :func:`pandas.to_datetime`. Especially useful with databases without native Datetime support, such as SQLite. columns : list, default: None List of column names to select from SQL table. schema : string, default None Name of SQL schema in database to query (if database flavor supports this). If specified, this overwrites the default schema of the SQL database object. chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- pandas.read_sql_table SQLDatabase.read_query """ table = SQLTable(table_name, self, index=index_col, schema=schema) return table.read(coerce_float=coerce_float, parse_dates=parse_dates, columns=columns, chunksize=chunksize)
[ "def", "read_table", "(", "self", ",", "table_name", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "parse_dates", "=", "None", ",", "columns", "=", "None", ",", "schema", "=", "None", ",", "chunksize", "=", "None", ")", ":", "table", "=", "SQLTable", "(", "table_name", ",", "self", ",", "index", "=", "index_col", ",", "schema", "=", "schema", ")", "return", "table", ".", "read", "(", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ",", "columns", "=", "columns", ",", "chunksize", "=", "chunksize", ")" ]
Read SQL database table into a DataFrame. Parameters ---------- table_name : string Name of SQL table in database. index_col : string, optional, default: None Column to set as index. coerce_float : boolean, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. This can result in loss of precision. parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg}``, where the arg corresponds to the keyword arguments of :func:`pandas.to_datetime`. Especially useful with databases without native Datetime support, such as SQLite. columns : list, default: None List of column names to select from SQL table. schema : string, default None Name of SQL schema in database to query (if database flavor supports this). If specified, this overwrites the default schema of the SQL database object. chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- pandas.read_sql_table SQLDatabase.read_query
[ "Read", "SQL", "database", "table", "into", "a", "DataFrame", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L982-L1029
train
Read a table into a DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,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bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1100111 + 0o10) + chr(591 - 542) + chr(52) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\061' + chr(0b110 + 0o54), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(0b110011) + chr(0b110001) + chr(55), 60745 - 60737), ehT0Px3KOsy9(chr(219 - 171) + chr(11091 - 10980) + '\x31' + chr(53) + '\x32', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b10111 + 0o32) + chr(0b100 + 0o60) + '\066', 36179 - 36171), ehT0Px3KOsy9(chr(156 - 108) + chr(0b100011 + 0o114) + chr(621 - 570) + chr(50) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(54) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(979 - 927) + chr(1841 - 1791), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100000 + 0o23) + chr(1121 - 1073) + chr(0b1010 + 0o52), 46534 - 46526), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\066' + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(398 - 347) + chr(617 - 569) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(0b110010) + chr(0b110000) + chr(0b101001 + 0o16), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b100001 + 0o24) + chr(50), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110100) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + '\062' + chr(924 - 875), 0o10), ehT0Px3KOsy9(chr(1721 - 1673) + chr(111) + chr(0b110010) + chr(2294 - 2240) + chr(2509 - 2458), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b101001 + 0o106) + chr(283 - 233) + '\061' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(735 - 687) + chr(11466 - 11355) + chr(49) + '\061' + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(7161 - 7050) + '\x32' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(0b10101 + 0o40) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + '\x34' + chr(48), 0o10), ehT0Px3KOsy9(chr(800 - 752) + '\x6f' + chr(0b110011) + chr(0b110111) + chr(0b110010), 36816 - 36808), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110000 + 0o3) + chr(0b110000) + chr(0b110011), 8), ehT0Px3KOsy9(chr(2203 - 2155) + '\x6f' + chr(0b1000 + 0o53) + chr(0b1010 + 0o54) + chr(1506 - 1452), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1001 + 0o53) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011101 + 0o22) + chr(0b100 + 0o57) + chr(939 - 888) + chr(0b10001 + 0o41), 45217 - 45209), ehT0Px3KOsy9('\x30' + chr(7741 - 7630) + '\x32' + chr(0b110001) + '\065', 8), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\064', 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b110001 + 0o76) + chr(51) + chr(48) + chr(52), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\061' + '\x33', 47707 - 47699), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b111 + 0o150) + chr(49) + '\065' + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b110000) + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\x35' + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100010 + 0o20) + chr(509 - 457) + chr(1263 - 1213), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(5005 - 4894) + '\x32' + chr(0b101110 + 0o11), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b110011 + 0o74) + chr(51) + '\066' + chr(49), 0b1000), ehT0Px3KOsy9(chr(1125 - 1077) + chr(111) + '\x33' + chr(0b110100) + chr(2492 - 2442), 3920 - 3912), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(273 - 220) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(48), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + '\x35' + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'I'), chr(0b1111 + 0o125) + chr(0b1100101 + 0o0) + chr(0b101011 + 0o70) + chr(0b100001 + 0o116) + chr(2461 - 2361) + '\x65')(chr(4984 - 4867) + chr(0b110111 + 0o75) + chr(0b1100110) + '\x2d' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def QLMuHiY4FMZb(oVre8I6UXc3b, NKKFbr2Z4sr1, o90TMYhFhMm_=None, hyGdBsLYkQVS=ehT0Px3KOsy9(chr(924 - 876) + chr(111) + chr(49), ord("\x08")), T1brfYV34pPD=None, qKlXBtn3PKy4=None, P7DmIFVRivx6=None, op94qe_Rdjul=None): YbLi4ide0_3E = XnxdIGnwpv_R(NKKFbr2Z4sr1, oVre8I6UXc3b, index=o90TMYhFhMm_, schema=P7DmIFVRivx6) return xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'\x15s\xab\xab'), chr(0b1011000 + 0o14) + '\x65' + chr(0b10101 + 0o116) + '\x6f' + chr(2322 - 2222) + '\x65')('\x75' + chr(116) + '\x66' + chr(0b11 + 0o52) + chr(0b101101 + 0o13)))(coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD, columns=qKlXBtn3PKy4, chunksize=op94qe_Rdjul)
pandas-dev/pandas
pandas/io/sql.py
SQLDatabase._query_iterator
def _query_iterator(result, chunksize, columns, index_col=None, coerce_float=True, parse_dates=None): """Return generator through chunked result set""" while True: data = result.fetchmany(chunksize) if not data: break else: yield _wrap_result(data, columns, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates)
python
def _query_iterator(result, chunksize, columns, index_col=None, coerce_float=True, parse_dates=None): """Return generator through chunked result set""" while True: data = result.fetchmany(chunksize) if not data: break else: yield _wrap_result(data, columns, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates)
[ "def", "_query_iterator", "(", "result", ",", "chunksize", ",", "columns", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "parse_dates", "=", "None", ")", ":", "while", "True", ":", "data", "=", "result", ".", "fetchmany", "(", "chunksize", ")", "if", "not", "data", ":", "break", "else", ":", "yield", "_wrap_result", "(", "data", ",", "columns", ",", "index_col", "=", "index_col", ",", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ")" ]
Return generator through chunked result set
[ "Return", "generator", "through", "chunked", "result", "set" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L1032-L1043
train
Return generator through chunked result set
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,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HmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\x35' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(51) + chr(51), 28438 - 28430), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\x31' + chr(54), 41966 - 41958), ehT0Px3KOsy9(chr(48) + chr(0b110101 + 0o72) + '\063' + '\062' + chr(55), 52212 - 52204), ehT0Px3KOsy9('\x30' + chr(0b11000 + 0o127) + chr(0b110001) + '\x35' + chr(0b10 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + '\061' + '\063' + chr(55), 0o10), ehT0Px3KOsy9(chr(2253 - 2205) + '\157' + chr(2345 - 2294) + chr(0b100 + 0o63) + chr(0b10 + 0o60), 41309 - 41301), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + '\060' + chr(0b100011 + 0o24), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10010 + 0o41) + chr(1764 - 1715) + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b0 + 0o60) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\x31' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(806 - 695) + chr(1143 - 1092) + '\064' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(50) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100001 + 0o116) + chr(0b101 + 0o56) + chr(0b11111 + 0o30) + chr(50), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10110 + 0o34) + chr(0b101111 + 0o5), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + '\x36' + '\061', 61823 - 61815), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10001 + 0o44), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5736 - 5625) + chr(50) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b101100 + 0o103) + '\062' + chr(0b110011) + '\x37', 53282 - 53274), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + '\062' + chr(0b110110) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(10535 - 10424) + chr(0b110011) + '\064' + chr(1903 - 1850), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(54) + '\x35', 34363 - 34355), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + chr(51) + chr(0b101101 + 0o5) + chr(1650 - 1600), 0b1000), ehT0Px3KOsy9('\060' + chr(1689 - 1578) + '\062' + chr(1070 - 1017) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b110001) + chr(1350 - 1296), 8), ehT0Px3KOsy9('\060' + chr(7000 - 6889) + '\062' + chr(51) + chr(1913 - 1865), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + chr(0b11111 + 0o23) + '\060' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + '\x34' + chr(2024 - 1969), 52886 - 52878), ehT0Px3KOsy9(chr(411 - 363) + chr(111) + '\061' + '\063' + chr(55), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101110 + 0o11) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2245 - 2194) + chr(0b11011 + 0o26) + chr(54), 8), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + '\063' + '\x33' + chr(0b110011), 50322 - 50314), ehT0Px3KOsy9('\x30' + '\157' + chr(1795 - 1744) + '\062' + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b10111 + 0o35) + chr(2400 - 2345), 8), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + chr(49) + '\067' + chr(0b101100 + 0o12), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1357 - 1307) + chr(2315 - 2264) + chr(49), 0o10), ehT0Px3KOsy9('\x30' + chr(6711 - 6600) + chr(1120 - 1071) + chr(0b11 + 0o64) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + '\x32' + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1000 + 0o52) + chr(1093 - 1040), 42705 - 42697), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(52), 35479 - 35471)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1400 - 1347) + '\060', 35966 - 35958)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'E'), chr(0b101100 + 0o70) + '\145' + chr(0b1100011) + chr(0b110110 + 0o71) + chr(0b1100100) + '\x65')('\165' + chr(0b1110100) + '\146' + chr(1339 - 1294) + chr(2945 - 2889)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ysyuhdWchnZj(ShZmEKfTkAOZ, op94qe_Rdjul, qKlXBtn3PKy4, o90TMYhFhMm_=None, hyGdBsLYkQVS=ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001), 23802 - 23794), T1brfYV34pPD=None): while ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10110 + 0o33), 8): ULnjp6D6efFH = ShZmEKfTkAOZ.fetchmany(op94qe_Rdjul) if not ULnjp6D6efFH: break else: yield jDdYdl3hJF1x(ULnjp6D6efFH, qKlXBtn3PKy4, index_col=o90TMYhFhMm_, coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD)
pandas-dev/pandas
pandas/io/sql.py
SQLDatabase.read_query
def read_query(self, sql, index_col=None, coerce_float=True, parse_dates=None, params=None, chunksize=None): """Read SQL query into a DataFrame. Parameters ---------- sql : string SQL query to be executed. index_col : string, optional, default: None Column name to use as index for the returned DataFrame object. coerce_float : boolean, default True Attempt to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point, useful for SQL result sets. params : list, tuple or dict, optional, default: None List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- read_sql_table : Read SQL database table into a DataFrame. read_sql """ args = _convert_params(sql, params) result = self.execute(*args) columns = result.keys() if chunksize is not None: return self._query_iterator(result, chunksize, columns, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates) else: data = result.fetchall() frame = _wrap_result(data, columns, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates) return frame
python
def read_query(self, sql, index_col=None, coerce_float=True, parse_dates=None, params=None, chunksize=None): """Read SQL query into a DataFrame. Parameters ---------- sql : string SQL query to be executed. index_col : string, optional, default: None Column name to use as index for the returned DataFrame object. coerce_float : boolean, default True Attempt to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point, useful for SQL result sets. params : list, tuple or dict, optional, default: None List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- read_sql_table : Read SQL database table into a DataFrame. read_sql """ args = _convert_params(sql, params) result = self.execute(*args) columns = result.keys() if chunksize is not None: return self._query_iterator(result, chunksize, columns, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates) else: data = result.fetchall() frame = _wrap_result(data, columns, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates) return frame
[ "def", "read_query", "(", "self", ",", "sql", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "parse_dates", "=", "None", ",", "params", "=", "None", ",", "chunksize", "=", "None", ")", ":", "args", "=", "_convert_params", "(", "sql", ",", "params", ")", "result", "=", "self", ".", "execute", "(", "*", "args", ")", "columns", "=", "result", ".", "keys", "(", ")", "if", "chunksize", "is", "not", "None", ":", "return", "self", ".", "_query_iterator", "(", "result", ",", "chunksize", ",", "columns", ",", "index_col", "=", "index_col", ",", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ")", "else", ":", "data", "=", "result", ".", "fetchall", "(", ")", "frame", "=", "_wrap_result", "(", "data", ",", "columns", ",", "index_col", "=", "index_col", ",", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ")", "return", "frame" ]
Read SQL query into a DataFrame. Parameters ---------- sql : string SQL query to be executed. index_col : string, optional, default: None Column name to use as index for the returned DataFrame object. coerce_float : boolean, default True Attempt to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point, useful for SQL result sets. params : list, tuple or dict, optional, default: None List of parameters to pass to execute method. The syntax used to pass parameters is database driver dependent. Check your database driver documentation for which of the five syntax styles, described in PEP 249's paramstyle, is supported. Eg. for psycopg2, uses %(name)s so use params={'name' : 'value'} parse_dates : list or dict, default: None - List of column names to parse as dates. - Dict of ``{column_name: format string}`` where format string is strftime compatible in case of parsing string times, or is one of (D, s, ns, ms, us) in case of parsing integer timestamps. - Dict of ``{column_name: arg dict}``, where the arg dict corresponds to the keyword arguments of :func:`pandas.to_datetime` Especially useful with databases without native Datetime support, such as SQLite. chunksize : int, default None If specified, return an iterator where `chunksize` is the number of rows to include in each chunk. Returns ------- DataFrame See Also -------- read_sql_table : Read SQL database table into a DataFrame. read_sql
[ "Read", "SQL", "query", "into", "a", "DataFrame", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L1045-L1102
train
Read SQL query into a DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0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Im,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(7920 - 7809) + '\x31' + chr(0b110000) + chr(0b110101), 1979 - 1971), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001010 + 0o45) + chr(0b11000 + 0o35) + chr(0b1101 + 0o47), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6385 - 6274) + chr(0b1 + 0o60) + '\063' + chr(0b110111), 16524 - 16516), ehT0Px3KOsy9('\060' + chr(111) + chr(471 - 422) + chr(0b11101 + 0o31) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(0b101101 + 0o6) + chr(0b110111), 8), ehT0Px3KOsy9(chr(2094 - 2046) + chr(0b1100110 + 0o11) + chr(0b110010) + chr(640 - 585) + chr(1571 - 1517), 0o10), ehT0Px3KOsy9(chr(48) + chr(9292 - 9181) + chr(50) + chr(54) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101110 + 0o4) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(1073 - 1023) + '\x34' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(1019 - 970) + chr(52) + chr(987 - 937), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111 + 0o150) + '\061' + '\063' + '\x30', 27809 - 27801), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\065' + chr(0b101001 + 0o13), 15885 - 15877), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + '\063' + '\x37' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11 + 0o56) + '\067' + chr(993 - 943), ord("\x08")), ehT0Px3KOsy9(chr(176 - 128) + chr(0b1101111) + chr(1665 - 1616) + chr(0b110010) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5266 - 5155) + '\062' + chr(1916 - 1861) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b110101) + chr(0b1100 + 0o45), 0o10), ehT0Px3KOsy9(chr(48) + chr(271 - 160) + chr(50) + '\x32' + chr(254 - 206), 15309 - 15301), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\067' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(1825 - 1777) + chr(111) + chr(0b110001) + '\x36' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(6725 - 6614) + chr(51) + chr(51) + '\064', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(380 - 327), 0o10), ehT0Px3KOsy9(chr(2211 - 2163) + chr(0b1101111) + '\061' + chr(0b1100 + 0o45) + chr(0b111 + 0o55), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(50) + '\065' + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\x36' + chr(52), 0b1000), ehT0Px3KOsy9(chr(1900 - 1852) + '\157' + chr(0b1000 + 0o53) + chr(0b11001 + 0o36) + chr(53), 22387 - 22379), ehT0Px3KOsy9(chr(987 - 939) + chr(111) + '\062' + chr(1433 - 1385), 24754 - 24746), ehT0Px3KOsy9(chr(48) + chr(0b10110 + 0o131) + '\x31' + '\062' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(2209 - 2161) + chr(0b1101111) + chr(1435 - 1385) + chr(1638 - 1583) + '\x30', 20059 - 20051), ehT0Px3KOsy9(chr(1049 - 1001) + chr(8998 - 8887) + chr(0b110010) + chr(0b10011 + 0o35) + chr(686 - 636), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1000111 + 0o50) + chr(52) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(12210 - 12099) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000110 + 0o51) + chr(0b110110 + 0o0) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(52) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(54) + '\x36', 30430 - 30422), ehT0Px3KOsy9(chr(48) + chr(9526 - 9415) + chr(55) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\066' + chr(1126 - 1075), 5350 - 5342)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110101) + chr(0b100001 + 0o17), 16978 - 16970)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'k'), '\x64' + chr(1896 - 1795) + chr(99) + chr(111) + chr(6622 - 6522) + '\x65')('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def OomMOOBMey7C(oVre8I6UXc3b, GWXd4kBaViZK, o90TMYhFhMm_=None, hyGdBsLYkQVS=ehT0Px3KOsy9(chr(931 - 883) + chr(111) + chr(971 - 922), ord("\x08")), T1brfYV34pPD=None, nEbJZ4wfte2w=None, op94qe_Rdjul=None): kJDRfRhcZHjS = Q7IKiRWSu9En(GWXd4kBaViZK, nEbJZ4wfte2w) ShZmEKfTkAOZ = oVre8I6UXc3b.execute(*kJDRfRhcZHjS) qKlXBtn3PKy4 = ShZmEKfTkAOZ.keys() if op94qe_Rdjul is not None: return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a]g:\x05&\xe1\xdda\xc7\x109\x18\x93\x08'), chr(0b100010 + 0o102) + '\x65' + chr(99) + chr(9408 - 9297) + chr(0b1100100) + chr(101))('\x75' + chr(116) + chr(0b111011 + 0o53) + chr(0b10111 + 0o26) + '\070'))(ShZmEKfTkAOZ, op94qe_Rdjul, qKlXBtn3PKy4, index_col=o90TMYhFhMm_, coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD) else: ULnjp6D6efFH = ShZmEKfTkAOZ.fetchall() C4IqNNmLfHXB = jDdYdl3hJF1x(ULnjp6D6efFH, qKlXBtn3PKy4, index_col=o90TMYhFhMm_, coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD) return C4IqNNmLfHXB
pandas-dev/pandas
pandas/io/sql.py
SQLDatabase.to_sql
def to_sql(self, frame, name, if_exists='fail', index=True, index_label=None, schema=None, chunksize=None, dtype=None, method=None): """ Write records stored in a DataFrame to a SQL database. Parameters ---------- frame : DataFrame name : string Name of SQL table. if_exists : {'fail', 'replace', 'append'}, default 'fail' - fail: If table exists, do nothing. - replace: If table exists, drop it, recreate it, and insert data. - append: If table exists, insert data. Create if does not exist. index : boolean, default True Write DataFrame index as a column. index_label : string or sequence, default None Column label for index column(s). If None is given (default) and `index` is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. schema : string, default None Name of SQL schema in database to write to (if database flavor supports this). If specified, this overwrites the default schema of the SQLDatabase object. chunksize : int, default None If not None, then rows will be written in batches of this size at a time. If None, all rows will be written at once. dtype : single type or dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type. If all columns are of the same type, one single value can be used. method : {None', 'multi', callable}, default None Controls the SQL insertion clause used: * None : Uses standard SQL ``INSERT`` clause (one per row). * 'multi': Pass multiple values in a single ``INSERT`` clause. * callable with signature ``(pd_table, conn, keys, data_iter)``. Details and a sample callable implementation can be found in the section :ref:`insert method <io.sql.method>`. .. versionadded:: 0.24.0 """ if dtype and not is_dict_like(dtype): dtype = {col_name: dtype for col_name in frame} if dtype is not None: from sqlalchemy.types import to_instance, TypeEngine for col, my_type in dtype.items(): if not isinstance(to_instance(my_type), TypeEngine): raise ValueError('The type of {column} is not a ' 'SQLAlchemy type '.format(column=col)) table = SQLTable(name, self, frame=frame, index=index, if_exists=if_exists, index_label=index_label, schema=schema, dtype=dtype) table.create() table.insert(chunksize, method=method) if (not name.isdigit() and not name.islower()): # check for potentially case sensitivity issues (GH7815) # Only check when name is not a number and name is not lower case engine = self.connectable.engine with self.connectable.connect() as conn: table_names = engine.table_names( schema=schema or self.meta.schema, connection=conn, ) if name not in table_names: msg = ( "The provided table name '{0}' is not found exactly as " "such in the database after writing the table, possibly " "due to case sensitivity issues. Consider using lower " "case table names." ).format(name) warnings.warn(msg, UserWarning)
python
def to_sql(self, frame, name, if_exists='fail', index=True, index_label=None, schema=None, chunksize=None, dtype=None, method=None): """ Write records stored in a DataFrame to a SQL database. Parameters ---------- frame : DataFrame name : string Name of SQL table. if_exists : {'fail', 'replace', 'append'}, default 'fail' - fail: If table exists, do nothing. - replace: If table exists, drop it, recreate it, and insert data. - append: If table exists, insert data. Create if does not exist. index : boolean, default True Write DataFrame index as a column. index_label : string or sequence, default None Column label for index column(s). If None is given (default) and `index` is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. schema : string, default None Name of SQL schema in database to write to (if database flavor supports this). If specified, this overwrites the default schema of the SQLDatabase object. chunksize : int, default None If not None, then rows will be written in batches of this size at a time. If None, all rows will be written at once. dtype : single type or dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type. If all columns are of the same type, one single value can be used. method : {None', 'multi', callable}, default None Controls the SQL insertion clause used: * None : Uses standard SQL ``INSERT`` clause (one per row). * 'multi': Pass multiple values in a single ``INSERT`` clause. * callable with signature ``(pd_table, conn, keys, data_iter)``. Details and a sample callable implementation can be found in the section :ref:`insert method <io.sql.method>`. .. versionadded:: 0.24.0 """ if dtype and not is_dict_like(dtype): dtype = {col_name: dtype for col_name in frame} if dtype is not None: from sqlalchemy.types import to_instance, TypeEngine for col, my_type in dtype.items(): if not isinstance(to_instance(my_type), TypeEngine): raise ValueError('The type of {column} is not a ' 'SQLAlchemy type '.format(column=col)) table = SQLTable(name, self, frame=frame, index=index, if_exists=if_exists, index_label=index_label, schema=schema, dtype=dtype) table.create() table.insert(chunksize, method=method) if (not name.isdigit() and not name.islower()): # check for potentially case sensitivity issues (GH7815) # Only check when name is not a number and name is not lower case engine = self.connectable.engine with self.connectable.connect() as conn: table_names = engine.table_names( schema=schema or self.meta.schema, connection=conn, ) if name not in table_names: msg = ( "The provided table name '{0}' is not found exactly as " "such in the database after writing the table, possibly " "due to case sensitivity issues. Consider using lower " "case table names." ).format(name) warnings.warn(msg, UserWarning)
[ "def", "to_sql", "(", "self", ",", "frame", ",", "name", ",", "if_exists", "=", "'fail'", ",", "index", "=", "True", ",", "index_label", "=", "None", ",", "schema", "=", "None", ",", "chunksize", "=", "None", ",", "dtype", "=", "None", ",", "method", "=", "None", ")", ":", "if", "dtype", "and", "not", "is_dict_like", "(", "dtype", ")", ":", "dtype", "=", "{", "col_name", ":", "dtype", "for", "col_name", "in", "frame", "}", "if", "dtype", "is", "not", "None", ":", "from", "sqlalchemy", ".", "types", "import", "to_instance", ",", "TypeEngine", "for", "col", ",", "my_type", "in", "dtype", ".", "items", "(", ")", ":", "if", "not", "isinstance", "(", "to_instance", "(", "my_type", ")", ",", "TypeEngine", ")", ":", "raise", "ValueError", "(", "'The type of {column} is not a '", "'SQLAlchemy type '", ".", "format", "(", "column", "=", "col", ")", ")", "table", "=", "SQLTable", "(", "name", ",", "self", ",", "frame", "=", "frame", ",", "index", "=", "index", ",", "if_exists", "=", "if_exists", ",", "index_label", "=", "index_label", ",", "schema", "=", "schema", ",", "dtype", "=", "dtype", ")", "table", ".", "create", "(", ")", "table", ".", "insert", "(", "chunksize", ",", "method", "=", "method", ")", "if", "(", "not", "name", ".", "isdigit", "(", ")", "and", "not", "name", ".", "islower", "(", ")", ")", ":", "# check for potentially case sensitivity issues (GH7815)", "# Only check when name is not a number and name is not lower case", "engine", "=", "self", ".", "connectable", ".", "engine", "with", "self", ".", "connectable", ".", "connect", "(", ")", "as", "conn", ":", "table_names", "=", "engine", ".", "table_names", "(", "schema", "=", "schema", "or", "self", ".", "meta", ".", "schema", ",", "connection", "=", "conn", ",", ")", "if", "name", "not", "in", "table_names", ":", "msg", "=", "(", "\"The provided table name '{0}' is not found exactly as \"", "\"such in the database after writing the table, possibly \"", "\"due to case sensitivity issues. Consider using lower \"", "\"case table names.\"", ")", ".", "format", "(", "name", ")", "warnings", ".", "warn", "(", "msg", ",", "UserWarning", ")" ]
Write records stored in a DataFrame to a SQL database. Parameters ---------- frame : DataFrame name : string Name of SQL table. if_exists : {'fail', 'replace', 'append'}, default 'fail' - fail: If table exists, do nothing. - replace: If table exists, drop it, recreate it, and insert data. - append: If table exists, insert data. Create if does not exist. index : boolean, default True Write DataFrame index as a column. index_label : string or sequence, default None Column label for index column(s). If None is given (default) and `index` is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. schema : string, default None Name of SQL schema in database to write to (if database flavor supports this). If specified, this overwrites the default schema of the SQLDatabase object. chunksize : int, default None If not None, then rows will be written in batches of this size at a time. If None, all rows will be written at once. dtype : single type or dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a SQLAlchemy type. If all columns are of the same type, one single value can be used. method : {None', 'multi', callable}, default None Controls the SQL insertion clause used: * None : Uses standard SQL ``INSERT`` clause (one per row). * 'multi': Pass multiple values in a single ``INSERT`` clause. * callable with signature ``(pd_table, conn, keys, data_iter)``. Details and a sample callable implementation can be found in the section :ref:`insert method <io.sql.method>`. .. versionadded:: 0.24.0
[ "Write", "records", "stored", "in", "a", "DataFrame", "to", "a", "SQL", "database", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L1106-L1181
train
Writes the DataFrame to a SQL database.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA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xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b10110 + 0o36) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(6971 - 6860) + chr(0b1010 + 0o51) + chr(610 - 557) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7269 - 7158) + '\063' + '\x37' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(1804 - 1756) + chr(0b1101111) + chr(0b110001) + chr(51) + chr(0b110000 + 0o5), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3677 - 3566) + chr(0b100101 + 0o15) + chr(0b110111) + '\064', 7385 - 7377), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(4403 - 4292) + chr(50) + chr(1550 - 1502) + '\x36', 17030 - 17022), ehT0Px3KOsy9('\x30' + chr(2371 - 2260) + '\x32' + chr(51), 59861 - 59853), ehT0Px3KOsy9(chr(291 - 243) + chr(9175 - 9064) + chr(2422 - 2372) + chr(0b110101) + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1235 - 1186) + chr(0b101 + 0o53) + chr(49), 0b1000), ehT0Px3KOsy9(chr(677 - 629) + chr(0b100110 + 0o111) + chr(0b11000 + 0o31) + chr(2141 - 2091) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b100101 + 0o14) + chr(0b10101 + 0o35), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10000 + 0o45) + chr(2437 - 2383), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(0b101100 + 0o12) + chr(0b101001 + 0o13), 18434 - 18426), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(4855 - 4744) + chr(55) + '\x32', 0b1000), ehT0Px3KOsy9(chr(1461 - 1413) + chr(0b1101111) + '\067' + chr(0b11101 + 0o26), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + '\x35' + '\x33', 0o10), ehT0Px3KOsy9(chr(1468 - 1420) + '\157' + '\061' + chr(514 - 465) + chr(768 - 714), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\063', 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(2717 - 2606) + chr(1017 - 967) + chr(0b10111 + 0o35) + '\x31', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(787 - 733) + chr(1292 - 1241), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(1192 - 1144) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(627 - 516) + '\x31' + chr(48) + chr(0b101 + 0o62), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(10582 - 10471) + chr(0b110011) + '\x34' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(2228 - 2180) + chr(0b1101111) + '\x33' + chr(0b110111) + chr(0b100010 + 0o20), 0o10), ehT0Px3KOsy9('\x30' + chr(2185 - 2074) + '\062' + chr(0b110001) + chr(1677 - 1625), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(1456 - 1406) + chr(0b101001 + 0o12) + chr(2234 - 2180), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + '\x31' + chr(764 - 715), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(10233 - 10122) + chr(0b11101 + 0o26) + chr(0b101101 + 0o12) + chr(0b110111), 5901 - 5893), ehT0Px3KOsy9(chr(0b110000) + chr(0b101010 + 0o105) + chr(0b11010 + 0o30) + '\x30' + chr(0b100100 + 0o16), 0b1000), ehT0Px3KOsy9(chr(48) + chr(117 - 6) + chr(49) + chr(0b110001) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10101 + 0o132) + chr(0b101001 + 0o11) + chr(1948 - 1897) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4827 - 4716) + chr(1294 - 1243) + chr(0b101001 + 0o12) + chr(0b110011 + 0o0), 0o10), ehT0Px3KOsy9(chr(736 - 688) + chr(0b110100 + 0o73) + chr(0b110010) + chr(1901 - 1847) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(9285 - 9174) + '\x33' + chr(0b110010) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + '\x33' + '\063', 0o10), ehT0Px3KOsy9(chr(2214 - 2166) + chr(0b1011001 + 0o26) + '\x32' + '\067' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(147 - 96), 28529 - 28521), ehT0Px3KOsy9('\x30' + chr(0b101001 + 0o106) + '\x33' + chr(636 - 583) + chr(0b10111 + 0o37), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(0b100110 + 0o16) + chr(0b1100 + 0o47), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x35' + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xcb'), '\144' + chr(0b1100101) + '\x63' + chr(0b100111 + 0o110) + '\x64' + '\145')(chr(0b111110 + 0o67) + '\x74' + chr(468 - 366) + chr(0b11000 + 0o25) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def b6tBeYOjJJGT(oVre8I6UXc3b, C4IqNNmLfHXB, AIvJRzLdDfgF, zZFPtODM90fp=xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\x8b\x941'), '\x64' + chr(101) + chr(3659 - 3560) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(2888 - 2771) + chr(0b1110100) + chr(3317 - 3215) + chr(0b101101) + chr(1454 - 1398)), XdowRbJKZWL9=ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001), 0b1000), Rj5_q03bvJPB=None, P7DmIFVRivx6=None, op94qe_Rdjul=None, jSV9IKnemH7K=None, CVRCXTcnOnH6=None): if jSV9IKnemH7K and (not KwJXno8t8wVV(jSV9IKnemH7K)): jSV9IKnemH7K = {W93rymQCbozJ: jSV9IKnemH7K for W93rymQCbozJ in C4IqNNmLfHXB} if jSV9IKnemH7K is not None: (AElPlk1Zukk0, TCvHKsFthRg4) = (xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x96\x9b\x91<\xd0\xe5{\xcf,+dZ\xcdJ^w'), '\144' + '\145' + chr(0b1100011) + chr(111) + '\144' + chr(0b11101 + 0o110))('\x75' + '\x74' + chr(102) + chr(1109 - 1064) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x91\x85\xa24\xd2\xf5g\xcb/1/'), '\144' + chr(101) + chr(6073 - 5974) + chr(0b11101 + 0o122) + chr(0b1100 + 0o130) + chr(0b1100101))(chr(0b1010000 + 0o45) + chr(0b1011011 + 0o31) + '\x66' + chr(0b101101) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x91\x93\x8d8\xcf'), chr(8221 - 8121) + chr(0b1001 + 0o134) + chr(0b1100011) + chr(0b1101 + 0o142) + '\x64' + chr(0b1100101))(chr(117) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x91\x85\xa24\xd2\xf5g\xcb/1/'), '\144' + chr(101) + chr(0b1100011) + chr(0b101101 + 0o102) + chr(0b111010 + 0o52) + chr(101))(chr(0b101011 + 0o112) + '\164' + chr(0b1100110) + '\055' + chr(2287 - 2231))), xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x96\x9b\x91<\xd0\xe5{\xcf,+dZ\xcdJ^w'), chr(0b1100100) + chr(7102 - 7001) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(0b11001 + 0o114))(chr(0b1101001 + 0o14) + chr(116) + chr(0b1100110) + '\x2d' + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x93\x8d8\xf9\xe8t\xc3/7'), chr(0b1100100) + chr(0b1100101) + chr(0b111011 + 0o50) + chr(0b1011001 + 0o26) + chr(0b1100100) + '\x65')(chr(0b1001000 + 0o55) + chr(116) + chr(9735 - 9633) + '\055' + chr(1315 - 1259))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x91\x93\x8d8\xcf'), '\x64' + '\x65' + '\x63' + chr(111) + '\x64' + chr(7228 - 7127))('\165' + chr(0b1110100) + chr(10285 - 10183) + chr(0b1011 + 0o42) + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x93\x8d8\xf9\xe8t\xc3/7'), chr(0b1100100) + chr(0b101101 + 0o70) + '\143' + chr(2211 - 2100) + chr(9242 - 9142) + chr(0b1011110 + 0o7))('\165' + '\164' + '\146' + chr(0b10110 + 0o27) + chr(1969 - 1913)))) for (Qa2uSJqQPT3w, PgUW1UssNxfH) in xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c\x9e\x980\xcf'), chr(0b1100100) + '\x65' + chr(99) + '\x6f' + chr(0b101101 + 0o67) + chr(0b111010 + 0o53))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(129 - 73)))(): if not PlSM16l2KDPD(AElPlk1Zukk0(PgUW1UssNxfH), TCvHKsFthRg4): raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x82\x98}\xc8\xffc\xcfa=,\x0e\xcfYTh\xde#u\xdcS-4\xc3\x94\xe3\xea)\x9e\xa2\x18\xcb\x97\xf3\xbc\xf8\xd5n\x83\x1a\xc5\x9e\x84-\xd9\xa6'), chr(100) + chr(101) + chr(6320 - 6221) + '\x6f' + chr(0b11 + 0o141) + chr(227 - 126))(chr(0b111100 + 0o71) + chr(0b1000 + 0o154) + chr(0b1100110) + chr(573 - 528) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\x85\x8f0\xdd\xf2'), '\144' + '\x65' + chr(0b1100011) + chr(111) + '\x64' + chr(0b1100101))('\165' + chr(0b1110100) + chr(0b110100 + 0o62) + chr(0b101101) + '\070'))(column=Qa2uSJqQPT3w)) YbLi4ide0_3E = XnxdIGnwpv_R(AIvJRzLdDfgF, oVre8I6UXc3b, frame=C4IqNNmLfHXB, index=XdowRbJKZWL9, if_exists=zZFPtODM90fp, index_label=Rj5_q03bvJPB, schema=P7DmIFVRivx6, dtype=jSV9IKnemH7K) xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'\x86\x98\x98<\xc8\xe3'), '\x64' + '\145' + '\x63' + '\157' + chr(880 - 780) + chr(101))(chr(0b1110101) + chr(116) + chr(0b1010001 + 0o25) + chr(45) + chr(56)))() xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c\x84\x8e8\xce\xf2'), '\144' + chr(101) + '\x63' + chr(111) + '\144' + chr(0b11111 + 0o106))(chr(117) + '\x74' + chr(0b1011111 + 0o7) + '\055' + '\070'))(op94qe_Rdjul, method=CVRCXTcnOnH6) if not xafqLlk3kkUe(AIvJRzLdDfgF, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c\x99\x994\xdb\xefg'), chr(9228 - 9128) + chr(3613 - 3512) + chr(99) + '\x6f' + chr(0b11101 + 0o107) + chr(3881 - 3780))('\165' + chr(116) + '\146' + chr(0b101101) + chr(0b111000)))() and (not xafqLlk3kkUe(AIvJRzLdDfgF, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c\x99\x912\xcb\xe3a'), '\x64' + chr(0b110111 + 0o56) + chr(99) + '\157' + chr(0b1000111 + 0o35) + chr(101))(chr(0b1110101) + '\x74' + '\x66' + '\x2d' + chr(0b111000)))()): ZYbnEw0oVPbF = oVre8I6UXc3b.connectable.engine with xafqLlk3kkUe(oVre8I6UXc3b.connectable, xafqLlk3kkUe(SXOLrMavuUCe(b'\x86\x85\x933\xd9\xe5g'), '\x64' + chr(0b10 + 0o143) + '\143' + chr(0b10000 + 0o137) + chr(0b11100 + 0o110) + chr(0b1100101))('\x75' + chr(116) + chr(0b101100 + 0o72) + chr(45) + chr(0b111000)))() as npwjCV10gdob: tmU9MHfzAbu1 = ZYbnEw0oVPbF.table_names(schema=P7DmIFVRivx6 or oVre8I6UXc3b.meta.schema, connection=npwjCV10gdob) if AIvJRzLdDfgF not in tmU9MHfzAbu1: jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x82\x98}\xcc\xf4|\xdc(6/J\x94NZf\xc7+;\xcf\x12)"\xc3\xdd\xf7\xaet\xd8\xa2"\xe9\xfb\xdc\xbf\xef\x9dm\x81\x16\x8b\x8e\xdd8\xc4\xe7p\xde-+jO\xc7\x1aHq\xc8&;\xc8\x1dd3\x8b\x9f\xac\xfah\x8b\xe3)\xfb\xa8\xd7\xf0\xfa\xdb\x7f\x8b\x11\xc5\x9d\x8f4\xc8\xef}\xcda&"K\x94NZf\xc7+7\x81\x03+4\x90\x93\xee\xf2p\xdf\xe6>\xff\xfb\xc6\xbf\xbb\xdej\x9d\x06\xc5\x99\x983\xcf\xefg\xc37;>W\x94SHw\xde+h\x8fS\x07(\x8d\x89\xe5\xfal\x8d\xa2>\xe9\xb2\xdc\xb7\xbb\xd1d\x99\x06\x97\xca\x9e<\xcf\xe33\xde 0&K\x94TZi\xce=5'), chr(100) + chr(0b11 + 0o142) + chr(99) + chr(111) + '\144' + '\145')(chr(117) + chr(116) + '\x66' + '\055' + chr(280 - 224)).format(AIvJRzLdDfgF) xafqLlk3kkUe(fJoTPf8D_opC, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\x8b\x8f3'), '\144' + chr(0b11101 + 0o110) + '\143' + '\157' + '\144' + '\x65')(chr(117) + chr(0b1110100) + '\146' + chr(0b1100 + 0o41) + chr(56)))(jtbovtaIYjRB, hOkXjmluKZfJ)
pandas-dev/pandas
pandas/io/sql.py
SQLiteTable._create_table_setup
def _create_table_setup(self): """ Return a list of SQL statements that creates a table reflecting the structure of a DataFrame. The first entry will be a CREATE TABLE statement while the rest will be CREATE INDEX statements. """ column_names_and_types = self._get_column_names_and_types( self._sql_type_name ) pat = re.compile(r'\s+') column_names = [col_name for col_name, _, _ in column_names_and_types] if any(map(pat.search, column_names)): warnings.warn(_SAFE_NAMES_WARNING, stacklevel=6) escape = _get_valid_sqlite_name create_tbl_stmts = [escape(cname) + ' ' + ctype for cname, ctype, _ in column_names_and_types] if self.keys is not None and len(self.keys): if not is_list_like(self.keys): keys = [self.keys] else: keys = self.keys cnames_br = ", ".join(escape(c) for c in keys) create_tbl_stmts.append( "CONSTRAINT {tbl}_pk PRIMARY KEY ({cnames_br})".format( tbl=self.name, cnames_br=cnames_br)) create_stmts = ["CREATE TABLE " + escape(self.name) + " (\n" + ',\n '.join(create_tbl_stmts) + "\n)"] ix_cols = [cname for cname, _, is_index in column_names_and_types if is_index] if len(ix_cols): cnames = "_".join(ix_cols) cnames_br = ",".join(escape(c) for c in ix_cols) create_stmts.append( "CREATE INDEX " + escape("ix_" + self.name + "_" + cnames) + "ON " + escape(self.name) + " (" + cnames_br + ")") return create_stmts
python
def _create_table_setup(self): """ Return a list of SQL statements that creates a table reflecting the structure of a DataFrame. The first entry will be a CREATE TABLE statement while the rest will be CREATE INDEX statements. """ column_names_and_types = self._get_column_names_and_types( self._sql_type_name ) pat = re.compile(r'\s+') column_names = [col_name for col_name, _, _ in column_names_and_types] if any(map(pat.search, column_names)): warnings.warn(_SAFE_NAMES_WARNING, stacklevel=6) escape = _get_valid_sqlite_name create_tbl_stmts = [escape(cname) + ' ' + ctype for cname, ctype, _ in column_names_and_types] if self.keys is not None and len(self.keys): if not is_list_like(self.keys): keys = [self.keys] else: keys = self.keys cnames_br = ", ".join(escape(c) for c in keys) create_tbl_stmts.append( "CONSTRAINT {tbl}_pk PRIMARY KEY ({cnames_br})".format( tbl=self.name, cnames_br=cnames_br)) create_stmts = ["CREATE TABLE " + escape(self.name) + " (\n" + ',\n '.join(create_tbl_stmts) + "\n)"] ix_cols = [cname for cname, _, is_index in column_names_and_types if is_index] if len(ix_cols): cnames = "_".join(ix_cols) cnames_br = ",".join(escape(c) for c in ix_cols) create_stmts.append( "CREATE INDEX " + escape("ix_" + self.name + "_" + cnames) + "ON " + escape(self.name) + " (" + cnames_br + ")") return create_stmts
[ "def", "_create_table_setup", "(", "self", ")", ":", "column_names_and_types", "=", "self", ".", "_get_column_names_and_types", "(", "self", ".", "_sql_type_name", ")", "pat", "=", "re", ".", "compile", "(", "r'\\s+'", ")", "column_names", "=", "[", "col_name", "for", "col_name", ",", "_", ",", "_", "in", "column_names_and_types", "]", "if", "any", "(", "map", "(", "pat", ".", "search", ",", "column_names", ")", ")", ":", "warnings", ".", "warn", "(", "_SAFE_NAMES_WARNING", ",", "stacklevel", "=", "6", ")", "escape", "=", "_get_valid_sqlite_name", "create_tbl_stmts", "=", "[", "escape", "(", "cname", ")", "+", "' '", "+", "ctype", "for", "cname", ",", "ctype", ",", "_", "in", "column_names_and_types", "]", "if", "self", ".", "keys", "is", "not", "None", "and", "len", "(", "self", ".", "keys", ")", ":", "if", "not", "is_list_like", "(", "self", ".", "keys", ")", ":", "keys", "=", "[", "self", ".", "keys", "]", "else", ":", "keys", "=", "self", ".", "keys", "cnames_br", "=", "\", \"", ".", "join", "(", "escape", "(", "c", ")", "for", "c", "in", "keys", ")", "create_tbl_stmts", ".", "append", "(", "\"CONSTRAINT {tbl}_pk PRIMARY KEY ({cnames_br})\"", ".", "format", "(", "tbl", "=", "self", ".", "name", ",", "cnames_br", "=", "cnames_br", ")", ")", "create_stmts", "=", "[", "\"CREATE TABLE \"", "+", "escape", "(", "self", ".", "name", ")", "+", "\" (\\n\"", "+", "',\\n '", ".", "join", "(", "create_tbl_stmts", ")", "+", "\"\\n)\"", "]", "ix_cols", "=", "[", "cname", "for", "cname", ",", "_", ",", "is_index", "in", "column_names_and_types", "if", "is_index", "]", "if", "len", "(", "ix_cols", ")", ":", "cnames", "=", "\"_\"", ".", "join", "(", "ix_cols", ")", "cnames_br", "=", "\",\"", ".", "join", "(", "escape", "(", "c", ")", "for", "c", "in", "ix_cols", ")", "create_stmts", ".", "append", "(", "\"CREATE INDEX \"", "+", "escape", "(", "\"ix_\"", "+", "self", ".", "name", "+", "\"_\"", "+", "cnames", ")", "+", "\"ON \"", "+", "escape", "(", "self", ".", "name", ")", "+", "\" (\"", "+", "cnames_br", "+", "\")\"", ")", "return", "create_stmts" ]
Return a list of SQL statements that creates a table reflecting the structure of a DataFrame. The first entry will be a CREATE TABLE statement while the rest will be CREATE INDEX statements.
[ "Return", "a", "list", "of", "SQL", "statements", "that", "creates", "a", "table", "reflecting", "the", "structure", "of", "a", "DataFrame", ".", "The", "first", "entry", "will", "be", "a", "CREATE", "TABLE", "statement", "while", "the", "rest", "will", "be", "CREATE", "INDEX", "statements", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L1311-L1353
train
Returns a list of SQL statements that creates a table reflecting the theCOOKIE structure of the current DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9Fl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YBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1707 - 1659) + chr(111) + '\x31' + '\x30' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(2438 - 2388) + chr(2781 - 2728), ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(9773 - 9662) + chr(1500 - 1451) + '\x36', 47666 - 47658), ehT0Px3KOsy9(chr(778 - 730) + '\x6f' + chr(0b110101) + '\060', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101110 + 0o3) + chr(53) + chr(194 - 146), 50759 - 50751), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + chr(0b110001) + chr(0b110101) + chr(0b1011 + 0o54), 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + chr(735 - 685) + chr(0b110101) + chr(0b10000 + 0o40), 0o10), ehT0Px3KOsy9('\060' + chr(9040 - 8929) + chr(51) + chr(2097 - 2042) + '\x36', 0b1000), ehT0Px3KOsy9(chr(1724 - 1676) + '\157' + '\x37', 2702 - 2694), ehT0Px3KOsy9(chr(2140 - 2092) + chr(111) + chr(50) + '\064' + '\x37', 59142 - 59134), ehT0Px3KOsy9(chr(2123 - 2075) + '\x6f' + chr(0b101111 + 0o3) + chr(0b110000 + 0o3) + chr(0b11011 + 0o30), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001001 + 0o46) + '\061' + chr(0b110100) + chr(1367 - 1315), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6146 - 6035) + chr(0b10000 + 0o42) + chr(0b110100) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + '\x37' + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\x33' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1000 + 0o53) + '\x37' + '\x33', 8), ehT0Px3KOsy9(chr(48) + chr(0b111100 + 0o63) + chr(0b1100 + 0o46) + '\064' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(0b110001) + chr(0b10 + 0o62), 49953 - 49945), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + '\x32' + chr(0b100110 + 0o21), 24655 - 24647), ehT0Px3KOsy9('\x30' + chr(5378 - 5267) + chr(0b10111 + 0o34) + chr(52) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1101111) + '\x32' + '\065' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1000 + 0o53) + chr(0b110111) + chr(0b110110), 8), ehT0Px3KOsy9(chr(1402 - 1354) + '\157' + chr(1722 - 1672), 19299 - 19291), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1504 - 1454) + chr(0b11 + 0o60) + chr(0b101 + 0o56), 8), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + '\x33' + chr(51) + '\x31', 47382 - 47374), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110110) + chr(0b1000 + 0o54), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1010110 + 0o31) + chr(0b110010) + chr(1736 - 1683) + '\063', 23845 - 23837), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1010000 + 0o37) + chr(49) + '\x34' + chr(0b11111 + 0o25), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10110 + 0o34) + chr(55) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(8322 - 8211) + '\063' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1001101 + 0o42) + '\062' + chr(0b100001 + 0o21) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8545 - 8434) + chr(50) + '\x30', 0o10), ehT0Px3KOsy9(chr(1507 - 1459) + '\157' + chr(2312 - 2261) + chr(196 - 148) + chr(2347 - 2297), 10415 - 10407), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(6493 - 6382) + chr(2066 - 2013) + '\x30', 8), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\x36' + chr(0b1101 + 0o44), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b11011 + 0o27) + '\062', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\067' + '\x33', 63761 - 63753), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b101100 + 0o103) + chr(656 - 605) + chr(0b11111 + 0o22) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + '\064' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x32' + '\x36' + chr(48), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(6306 - 6195) + '\x35' + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'h'), chr(0b1100100) + chr(0b100101 + 0o100) + chr(99) + chr(7262 - 7151) + chr(100) + '\145')('\x75' + chr(0b1010 + 0o152) + chr(0b10100 + 0o122) + '\055' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def LvWWj3uvwwqI(oVre8I6UXc3b): bFLckXDrlGbQ = oVre8I6UXc3b._get_column_names_and_types(oVre8I6UXc3b._sql_type_name) BumvCMvK3ogt = _7u55U49WwX2.compile(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a&%'), '\144' + chr(884 - 783) + '\x63' + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(9025 - 8909) + '\146' + '\x2d' + chr(56))) Xw0ldSZpFZe4 = [W93rymQCbozJ for (W93rymQCbozJ, VNGQdHSFPrso, VNGQdHSFPrso) in bFLckXDrlGbQ] if UVSi4XW7eBIM(abA97kOQKaLo(xafqLlk3kkUe(BumvCMvK3ogt, xafqLlk3kkUe(SXOLrMavuUCe(b'50oZ\x0b\x07'), '\x64' + chr(101) + chr(5967 - 5868) + '\157' + '\x64' + chr(101))(chr(0b1110101) + chr(116) + '\x66' + chr(0b101101) + chr(0b111000))), Xw0ldSZpFZe4)): xafqLlk3kkUe(fJoTPf8D_opC, xafqLlk3kkUe(SXOLrMavuUCe(b'14|F'), chr(0b1 + 0o143) + chr(101) + '\143' + chr(0b1101111) + chr(0b10100 + 0o120) + chr(6891 - 6790))('\x75' + '\164' + chr(102) + chr(0b101101) + chr(0b101100 + 0o14)))(Ux_596rPtQO_, stacklevel=ehT0Px3KOsy9(chr(1029 - 981) + chr(111) + '\066', 0o10)) r5aqo2PTYhZy = lW_21TFceGCl MjBY59CjAjYO = [r5aqo2PTYhZy(vtI4x3YoBm5h) + xafqLlk3kkUe(SXOLrMavuUCe(b'f'), chr(0b1011 + 0o131) + '\145' + chr(4832 - 4733) + '\x6f' + chr(100) + '\x65')(chr(117) + chr(0b111001 + 0o73) + chr(102) + '\x2d' + chr(56)) + VBDnCO4L2x91 for (vtI4x3YoBm5h, VBDnCO4L2x91, VNGQdHSFPrso) in bFLckXDrlGbQ] if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'-0w['), chr(0b1010101 + 0o17) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(100) + chr(0b1100101))('\165' + chr(12020 - 11904) + chr(102) + chr(0b1011 + 0o42) + '\x38')) is not None and c2A0yzQpDQB3(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'-0w['), chr(3056 - 2956) + '\145' + '\143' + '\x6f' + chr(0b1010 + 0o132) + '\x65')(chr(0b1110101) + '\x74' + chr(102) + chr(0b100101 + 0o10) + chr(56)))): if not bAgBF7jXI53B(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'-0w['), '\144' + '\145' + chr(0b1001110 + 0o25) + '\157' + chr(0b111111 + 0o45) + '\x65')(chr(0b1000010 + 0o63) + '\x74' + '\146' + chr(0b101011 + 0o2) + chr(0b111000)))): w8H8C9ec5BO1 = [oVre8I6UXc3b.keys] else: w8H8C9ec5BO1 = oVre8I6UXc3b.keys V88UtwfUkAcz = xafqLlk3kkUe(SXOLrMavuUCe(b'ju'), chr(0b1100100) + chr(0b1001000 + 0o35) + chr(0b111110 + 0o45) + chr(0b111101 + 0o62) + chr(0b10010 + 0o122) + chr(4849 - 4748))(chr(11690 - 11573) + chr(0b1110100) + '\146' + '\055' + chr(0b111000)).join((r5aqo2PTYhZy(qzn1Ctg9WgNh) for qzn1Ctg9WgNh in w8H8C9ec5BO1)) xafqLlk3kkUe(MjBY59CjAjYO, xafqLlk3kkUe(SXOLrMavuUCe(b"'%~M\x06\x0b"), '\x64' + '\x65' + chr(0b1100011) + chr(3256 - 3145) + chr(0b100101 + 0o77) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(102) + chr(0b1010 + 0o43) + '\x38'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x05\x1a@{<=\xe9\xb7I\xf3\xbb\x1f\xd2\x99\xb1\x86\xfc\xbc<\xc1\xfc\xacK\xd6\x98\xa6\xf2D\xf2_\xcf0\xeaS\xd2\xbcZ\xa2\x80\xc3\x197|UA'), chr(9645 - 9545) + chr(0b10010 + 0o123) + chr(0b1100011) + chr(0b1000110 + 0o51) + '\144' + chr(0b10101 + 0o120))(chr(0b1110101) + chr(116) + chr(102) + chr(0b101101) + chr(0b101111 + 0o11)), xafqLlk3kkUe(SXOLrMavuUCe(b' :|E\t\x1b'), chr(1720 - 1620) + chr(5630 - 5529) + chr(0b1100011) + chr(2226 - 2115) + '\x64' + chr(0b10100 + 0o121))('\x75' + chr(0b1010110 + 0o36) + '\x66' + '\x2d' + '\070'))(tbl=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x07\x1cxb:\x15\xe4\x9aC\xc1\xfc"'), chr(222 - 122) + chr(0b11000 + 0o115) + chr(0b111 + 0o134) + chr(0b1000 + 0o147) + chr(0b110100 + 0o60) + chr(0b1100101))('\165' + '\164' + '\x66' + chr(272 - 227) + '\x38')), cnames_br=V88UtwfUkAcz)) lucOdo_SYa1b = [xafqLlk3kkUe(SXOLrMavuUCe(b'\x05\x07Ki<*\x88\xaaF\xe5\xd7!\x86'), '\144' + chr(728 - 627) + '\x63' + chr(111) + '\144' + chr(101))('\x75' + chr(0b101001 + 0o113) + '\x66' + chr(1975 - 1930) + chr(56)) + r5aqo2PTYhZy(oVre8I6UXc3b.AIvJRzLdDfgF) + xafqLlk3kkUe(SXOLrMavuUCe(b'f}\x04'), '\x64' + chr(101) + '\143' + '\157' + '\144' + chr(0b111111 + 0o46))(chr(0b1110101) + chr(9252 - 9136) + chr(3281 - 3179) + chr(0b11000 + 0o25) + chr(56)) + xafqLlk3kkUe(SXOLrMavuUCe(b'j_.\x08'), chr(100) + chr(101) + chr(99) + chr(111) + chr(4404 - 4304) + '\145')(chr(117) + chr(11937 - 11821) + chr(0b1100110) + '\055' + chr(0b111000)).join(MjBY59CjAjYO) + xafqLlk3kkUe(SXOLrMavuUCe(b'L|'), chr(8966 - 8866) + '\145' + '\143' + chr(0b1100100 + 0o13) + '\144' + '\145')(chr(5390 - 5273) + chr(0b10 + 0o162) + chr(102) + chr(1508 - 1463) + '\070')] WjXvBhCrMkBU = [vtI4x3YoBm5h for (vtI4x3YoBm5h, VNGQdHSFPrso, NqzcuhFmI3SG) in bFLckXDrlGbQ if NqzcuhFmI3SG] if c2A0yzQpDQB3(WjXvBhCrMkBU): lH75eIlUjGZV = xafqLlk3kkUe(SXOLrMavuUCe(b'\x19'), '\144' + chr(0b1100101) + chr(3992 - 3893) + chr(8616 - 8505) + chr(0b10110 + 0o116) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b110000 + 0o10)).join(WjXvBhCrMkBU) V88UtwfUkAcz = xafqLlk3kkUe(SXOLrMavuUCe(b'j'), '\x64' + chr(0b1000001 + 0o44) + chr(99) + chr(0b1101111) + chr(100) + '\145')('\x75' + chr(116) + chr(9868 - 9766) + chr(0b101101) + '\x38').join((r5aqo2PTYhZy(qzn1Ctg9WgNh) for qzn1Ctg9WgNh in WjXvBhCrMkBU)) xafqLlk3kkUe(lucOdo_SYa1b, xafqLlk3kkUe(SXOLrMavuUCe(b"'%~M\x06\x0b"), chr(2119 - 2019) + chr(0b1100101) + '\x63' + '\x6f' + chr(9134 - 9034) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(4041 - 3939) + '\055' + chr(1023 - 967)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x05\x07Ki<*\x88\xb7I\xe3\xde<\x86'), chr(1800 - 1700) + '\145' + chr(0b1100011) + '\x6f' + '\144' + '\x65')(chr(117) + chr(0b1101111 + 0o5) + chr(0b1100110) + chr(45) + chr(0b11011 + 0o35)) + r5aqo2PTYhZy(xafqLlk3kkUe(SXOLrMavuUCe(b'/-Q'), chr(0b1100100) + chr(0b1100101) + chr(99) + '\157' + chr(4276 - 4176) + '\145')('\165' + chr(12521 - 12405) + '\x66' + chr(672 - 627) + '\070') + xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x07\x1cxb:\x15\xe4\x9aC\xc1\xfc"'), chr(1655 - 1555) + chr(0b1100101) + chr(99) + '\157' + chr(3215 - 3115) + '\145')(chr(2575 - 2458) + chr(0b1101111 + 0o5) + chr(102) + chr(45) + chr(1234 - 1178))) + xafqLlk3kkUe(SXOLrMavuUCe(b'\x19'), chr(0b1100100) + chr(101) + chr(819 - 720) + chr(0b1101111) + '\144' + chr(101))(chr(117) + chr(7032 - 6916) + chr(0b10110 + 0o120) + '\055' + '\070') + lH75eIlUjGZV) + xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x1b.'), chr(0b1011100 + 0o10) + chr(1083 - 982) + '\143' + chr(0b1101111) + chr(0b1100000 + 0o4) + chr(9456 - 9355))(chr(0b1101111 + 0o6) + chr(0b1110100) + chr(9557 - 9455) + chr(1210 - 1165) + chr(2509 - 2453)) + r5aqo2PTYhZy(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x07\x1cxb:\x15\xe4\x9aC\xc1\xfc"'), chr(371 - 271) + '\145' + chr(1204 - 1105) + chr(0b1101111) + '\x64' + '\145')('\165' + chr(0b100111 + 0o115) + chr(0b101011 + 0o73) + chr(1293 - 1248) + chr(270 - 214)))) + xafqLlk3kkUe(SXOLrMavuUCe(b'f}'), chr(0b1000111 + 0o35) + chr(0b10001 + 0o124) + chr(0b1100011) + chr(5112 - 5001) + chr(0b100110 + 0o76) + chr(0b111110 + 0o47))(chr(0b11101 + 0o130) + chr(7362 - 7246) + chr(827 - 725) + chr(0b100011 + 0o12) + chr(56)) + V88UtwfUkAcz + xafqLlk3kkUe(SXOLrMavuUCe(b'o'), chr(6429 - 6329) + chr(5285 - 5184) + chr(4382 - 4283) + '\157' + chr(100) + chr(0b1010100 + 0o21))('\165' + chr(0b101010 + 0o112) + chr(0b101011 + 0o73) + chr(90 - 45) + chr(0b100001 + 0o27))) return lucOdo_SYa1b
pandas-dev/pandas
pandas/io/sql.py
SQLiteDatabase._query_iterator
def _query_iterator(cursor, chunksize, columns, index_col=None, coerce_float=True, parse_dates=None): """Return generator through chunked result set""" while True: data = cursor.fetchmany(chunksize) if type(data) == tuple: data = list(data) if not data: cursor.close() break else: yield _wrap_result(data, columns, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates)
python
def _query_iterator(cursor, chunksize, columns, index_col=None, coerce_float=True, parse_dates=None): """Return generator through chunked result set""" while True: data = cursor.fetchmany(chunksize) if type(data) == tuple: data = list(data) if not data: cursor.close() break else: yield _wrap_result(data, columns, index_col=index_col, coerce_float=coerce_float, parse_dates=parse_dates)
[ "def", "_query_iterator", "(", "cursor", ",", "chunksize", ",", "columns", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "parse_dates", "=", "None", ")", ":", "while", "True", ":", "data", "=", "cursor", ".", "fetchmany", "(", "chunksize", ")", "if", "type", "(", "data", ")", "==", "tuple", ":", "data", "=", "list", "(", "data", ")", "if", "not", "data", ":", "cursor", ".", "close", "(", ")", "break", "else", ":", "yield", "_wrap_result", "(", "data", ",", "columns", ",", "index_col", "=", "index_col", ",", "coerce_float", "=", "coerce_float", ",", "parse_dates", "=", "parse_dates", ")" ]
Return generator through chunked result set
[ "Return", "generator", "through", "chunked", "result", "set" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L1438-L1452
train
Return generator through chunked result set
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7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JWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1816 - 1768) + chr(111) + chr(0b11000 + 0o32) + '\x33' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(1484 - 1436) + '\x6f' + chr(0b110011 + 0o0) + chr(1745 - 1695) + chr(0b10100 + 0o40), 60477 - 60469), ehT0Px3KOsy9('\x30' + chr(530 - 419) + chr(0b110010) + chr(250 - 201), 47276 - 47268), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(1911 - 1860) + chr(0b11011 + 0o27) + '\x32', 0b1000), ehT0Px3KOsy9(chr(854 - 806) + chr(0b1101001 + 0o6) + chr(283 - 234) + chr(84 - 30) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2658 - 2605) + chr(1185 - 1137), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10 + 0o60) + '\x34' + chr(51), 57580 - 57572), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(1922 - 1811) + chr(49) + '\063' + '\061', 41947 - 41939), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(0b10110 + 0o37) + chr(2247 - 2195), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + chr(0b10000 + 0o42) + chr(2371 - 2318) + '\061', 43214 - 43206), ehT0Px3KOsy9(chr(0b110000) + chr(1844 - 1733) + '\063' + chr(51), 0b1000), ehT0Px3KOsy9(chr(234 - 186) + chr(0b1101111) + '\x31' + '\062' + '\060', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\066' + '\066', 30622 - 30614), ehT0Px3KOsy9('\x30' + chr(111) + chr(1909 - 1859) + chr(53) + chr(49), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(55) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b101111 + 0o100) + chr(0b10010 + 0o37) + chr(50) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111101 + 0o62) + '\x31' + chr(0b11101 + 0o25), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + '\062' + chr(1320 - 1268) + chr(275 - 225), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1495 - 1446) + chr(0b101010 + 0o10) + chr(235 - 181), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1086 - 1035) + '\062' + chr(49), 40830 - 40822), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110010) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(0b110110) + '\064', 0o10), ehT0Px3KOsy9(chr(1057 - 1009) + chr(0b1101111) + chr(1724 - 1675) + chr(2153 - 2101) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2367 - 2317) + '\065' + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(533 - 483) + '\060' + '\x34', 0b1000), ehT0Px3KOsy9(chr(1947 - 1899) + chr(111) + chr(53) + '\x33', 0o10), ehT0Px3KOsy9('\060' + chr(11190 - 11079) + chr(2423 - 2372) + chr(1640 - 1592) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + '\067' + chr(54), 8345 - 8337), ehT0Px3KOsy9('\x30' + chr(0b110110 + 0o71) + chr(50) + '\067', 31525 - 31517), ehT0Px3KOsy9('\060' + chr(2268 - 2157) + chr(1437 - 1388) + chr(0b110100) + chr(1022 - 970), 54591 - 54583), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1100111 + 0o10) + chr(0b110010) + chr(1008 - 959), 8), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(241 - 190) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(0b110111) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(389 - 341) + chr(111) + chr(0b11111 + 0o24) + chr(54) + chr(762 - 709), 38464 - 38456), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11101 + 0o24) + '\062' + chr(0b110101 + 0o2), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(0b110010) + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(2291 - 2239) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\063' + '\062' + chr(0b1100 + 0o45), 8), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + chr(0b11010 + 0o27) + chr(0b110110) + chr(0b110001), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + chr(1765 - 1712) + '\060', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\157' + '\144' + chr(0b1100101))('\x75' + chr(116) + chr(102) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ysyuhdWchnZj(jtcPmNZZo_gL, op94qe_Rdjul, qKlXBtn3PKy4, o90TMYhFhMm_=None, hyGdBsLYkQVS=ehT0Px3KOsy9('\x30' + '\157' + chr(0b1101 + 0o44), 30647 - 30639), T1brfYV34pPD=None): while ehT0Px3KOsy9(chr(48) + chr(111) + chr(49), 8): ULnjp6D6efFH = jtcPmNZZo_gL.fetchmany(op94qe_Rdjul) if PlSM16l2KDPD(ULnjp6D6efFH, KNyTy8rYcwji): ULnjp6D6efFH = YyaZ4tpXu4lf(ULnjp6D6efFH) if not ULnjp6D6efFH: xafqLlk3kkUe(jtcPmNZZo_gL, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc\xb8~\xa1\x15'), chr(0b1100001 + 0o3) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(2712 - 2612) + chr(5090 - 4989))('\165' + chr(0b11110 + 0o126) + chr(0b1100110) + chr(0b101101) + '\070'))() break else: yield jDdYdl3hJF1x(ULnjp6D6efFH, qKlXBtn3PKy4, index_col=o90TMYhFhMm_, coerce_float=hyGdBsLYkQVS, parse_dates=T1brfYV34pPD)
pandas-dev/pandas
pandas/io/sql.py
SQLiteDatabase.to_sql
def to_sql(self, frame, name, if_exists='fail', index=True, index_label=None, schema=None, chunksize=None, dtype=None, method=None): """ Write records stored in a DataFrame to a SQL database. Parameters ---------- frame: DataFrame name: string Name of SQL table. if_exists: {'fail', 'replace', 'append'}, default 'fail' fail: If table exists, do nothing. replace: If table exists, drop it, recreate it, and insert data. append: If table exists, insert data. Create if it does not exist. index : boolean, default True Write DataFrame index as a column index_label : string or sequence, default None Column label for index column(s). If None is given (default) and `index` is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. schema : string, default None Ignored parameter included for compatibility with SQLAlchemy version of ``to_sql``. chunksize : int, default None If not None, then rows will be written in batches of this size at a time. If None, all rows will be written at once. dtype : single type or dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a string. If all columns are of the same type, one single value can be used. method : {None, 'multi', callable}, default None Controls the SQL insertion clause used: * None : Uses standard SQL ``INSERT`` clause (one per row). * 'multi': Pass multiple values in a single ``INSERT`` clause. * callable with signature ``(pd_table, conn, keys, data_iter)``. Details and a sample callable implementation can be found in the section :ref:`insert method <io.sql.method>`. .. versionadded:: 0.24.0 """ if dtype and not is_dict_like(dtype): dtype = {col_name: dtype for col_name in frame} if dtype is not None: for col, my_type in dtype.items(): if not isinstance(my_type, str): raise ValueError('{column} ({type!s}) not a string'.format( column=col, type=my_type)) table = SQLiteTable(name, self, frame=frame, index=index, if_exists=if_exists, index_label=index_label, dtype=dtype) table.create() table.insert(chunksize, method)
python
def to_sql(self, frame, name, if_exists='fail', index=True, index_label=None, schema=None, chunksize=None, dtype=None, method=None): """ Write records stored in a DataFrame to a SQL database. Parameters ---------- frame: DataFrame name: string Name of SQL table. if_exists: {'fail', 'replace', 'append'}, default 'fail' fail: If table exists, do nothing. replace: If table exists, drop it, recreate it, and insert data. append: If table exists, insert data. Create if it does not exist. index : boolean, default True Write DataFrame index as a column index_label : string or sequence, default None Column label for index column(s). If None is given (default) and `index` is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. schema : string, default None Ignored parameter included for compatibility with SQLAlchemy version of ``to_sql``. chunksize : int, default None If not None, then rows will be written in batches of this size at a time. If None, all rows will be written at once. dtype : single type or dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a string. If all columns are of the same type, one single value can be used. method : {None, 'multi', callable}, default None Controls the SQL insertion clause used: * None : Uses standard SQL ``INSERT`` clause (one per row). * 'multi': Pass multiple values in a single ``INSERT`` clause. * callable with signature ``(pd_table, conn, keys, data_iter)``. Details and a sample callable implementation can be found in the section :ref:`insert method <io.sql.method>`. .. versionadded:: 0.24.0 """ if dtype and not is_dict_like(dtype): dtype = {col_name: dtype for col_name in frame} if dtype is not None: for col, my_type in dtype.items(): if not isinstance(my_type, str): raise ValueError('{column} ({type!s}) not a string'.format( column=col, type=my_type)) table = SQLiteTable(name, self, frame=frame, index=index, if_exists=if_exists, index_label=index_label, dtype=dtype) table.create() table.insert(chunksize, method)
[ "def", "to_sql", "(", "self", ",", "frame", ",", "name", ",", "if_exists", "=", "'fail'", ",", "index", "=", "True", ",", "index_label", "=", "None", ",", "schema", "=", "None", ",", "chunksize", "=", "None", ",", "dtype", "=", "None", ",", "method", "=", "None", ")", ":", "if", "dtype", "and", "not", "is_dict_like", "(", "dtype", ")", ":", "dtype", "=", "{", "col_name", ":", "dtype", "for", "col_name", "in", "frame", "}", "if", "dtype", "is", "not", "None", ":", "for", "col", ",", "my_type", "in", "dtype", ".", "items", "(", ")", ":", "if", "not", "isinstance", "(", "my_type", ",", "str", ")", ":", "raise", "ValueError", "(", "'{column} ({type!s}) not a string'", ".", "format", "(", "column", "=", "col", ",", "type", "=", "my_type", ")", ")", "table", "=", "SQLiteTable", "(", "name", ",", "self", ",", "frame", "=", "frame", ",", "index", "=", "index", ",", "if_exists", "=", "if_exists", ",", "index_label", "=", "index_label", ",", "dtype", "=", "dtype", ")", "table", ".", "create", "(", ")", "table", ".", "insert", "(", "chunksize", ",", "method", ")" ]
Write records stored in a DataFrame to a SQL database. Parameters ---------- frame: DataFrame name: string Name of SQL table. if_exists: {'fail', 'replace', 'append'}, default 'fail' fail: If table exists, do nothing. replace: If table exists, drop it, recreate it, and insert data. append: If table exists, insert data. Create if it does not exist. index : boolean, default True Write DataFrame index as a column index_label : string or sequence, default None Column label for index column(s). If None is given (default) and `index` is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. schema : string, default None Ignored parameter included for compatibility with SQLAlchemy version of ``to_sql``. chunksize : int, default None If not None, then rows will be written in batches of this size at a time. If None, all rows will be written at once. dtype : single type or dict of column name to SQL type, default None Optional specifying the datatype for columns. The SQL type should be a string. If all columns are of the same type, one single value can be used. method : {None, 'multi', callable}, default None Controls the SQL insertion clause used: * None : Uses standard SQL ``INSERT`` clause (one per row). * 'multi': Pass multiple values in a single ``INSERT`` clause. * callable with signature ``(pd_table, conn, keys, data_iter)``. Details and a sample callable implementation can be found in the section :ref:`insert method <io.sql.method>`. .. versionadded:: 0.24.0
[ "Write", "records", "stored", "in", "a", "DataFrame", "to", "a", "SQL", "database", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/sql.py#L1481-L1537
train
Write records stored in a DataFrame to a SQL database.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u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c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1686 - 1638) + '\157' + chr(49) + '\x35' + chr(0b1100 + 0o53), 0o10), ehT0Px3KOsy9(chr(2197 - 2149) + '\x6f' + chr(0b101101 + 0o10) + chr(0b100 + 0o55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(10979 - 10868) + chr(50) + '\062' + chr(1262 - 1207), 0b1000), ehT0Px3KOsy9(chr(1125 - 1077) + chr(111) + chr(0b100111 + 0o16) + chr(48), 0o10), ehT0Px3KOsy9(chr(232 - 184) + chr(0b1101111) + chr(0b11010 + 0o27) + '\065', 62091 - 62083), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(0b110011) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(1880 - 1832) + chr(0b110101 + 0o72) + chr(1763 - 1714) + chr(0b110111) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + '\066' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(48) + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x37' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(0b110111 + 0o0) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011 + 0o2) + chr(0b101110 + 0o4), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(54) + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + chr(0b10101 + 0o132) + chr(2190 - 2139) + chr(76 - 23) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8878 - 8767) + chr(0b110001) + '\x35' + '\x37', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x35' + '\x37', 50574 - 50566), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + '\x35' + '\x36', 61923 - 61915), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100110 + 0o17) + chr(2616 - 2563), 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + '\x34' + '\x32', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(52), 40226 - 40218), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + '\061' + chr(49) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(0b11100 + 0o26) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011 + 0o0) + chr(0b1110 + 0o46) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(1536 - 1484) + chr(0b110011 + 0o3), 8), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b110101 + 0o72) + chr(406 - 356) + chr(0b110001) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(1410 - 1299) + chr(51) + '\062' + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(8364 - 8253) + '\061' + chr(2931 - 2876) + chr(0b110001), 31909 - 31901), ehT0Px3KOsy9('\060' + chr(0b10111 + 0o130) + chr(2414 - 2364) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000001 + 0o56) + chr(51) + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(11933 - 11822) + '\x32' + chr(51) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(6110 - 5999) + chr(0b110010) + chr(1141 - 1091), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b111 + 0o150) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(1032 - 984) + chr(52), 31032 - 31024), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1011010 + 0o25) + chr(1656 - 1606) + chr(0b1100 + 0o51) + '\x30', 52712 - 52704), ehT0Px3KOsy9('\x30' + chr(9793 - 9682) + chr(969 - 920) + chr(0b101000 + 0o14) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(292 - 244) + chr(8521 - 8410) + '\061' + '\062' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1000000 + 0o57) + chr(0b10001 + 0o44) + '\061', 8), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + chr(1648 - 1598) + chr(0b110111) + chr(0b1100 + 0o44), 18585 - 18577), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1548 - 1497) + chr(0b110011) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(49) + chr(50), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101110 + 0o1) + chr(0b1001 + 0o54) + chr(330 - 282), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'A'), '\x64' + chr(0b11100 + 0o111) + chr(99) + chr(0b1101111) + chr(0b1100011 + 0o1) + chr(101))('\x75' + '\x74' + chr(0b110110 + 0o60) + chr(0b100101 + 0o10) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def b6tBeYOjJJGT(oVre8I6UXc3b, C4IqNNmLfHXB, AIvJRzLdDfgF, zZFPtODM90fp=xafqLlk3kkUe(SXOLrMavuUCe(b'\tH\xfeD'), chr(6194 - 6094) + chr(0b1010111 + 0o16) + chr(0b1100011) + '\x6f' + chr(0b1100001 + 0o3) + '\145')('\165' + chr(0b1000111 + 0o55) + chr(0b1010111 + 0o17) + chr(309 - 264) + chr(56)), XdowRbJKZWL9=ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + '\x31', 0b1000), Rj5_q03bvJPB=None, P7DmIFVRivx6=None, op94qe_Rdjul=None, jSV9IKnemH7K=None, CVRCXTcnOnH6=None): if jSV9IKnemH7K and (not KwJXno8t8wVV(jSV9IKnemH7K)): jSV9IKnemH7K = {W93rymQCbozJ: jSV9IKnemH7K for W93rymQCbozJ in C4IqNNmLfHXB} if jSV9IKnemH7K is not None: for (Qa2uSJqQPT3w, PgUW1UssNxfH) in xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\x06]\xf2E~'), '\144' + '\145' + chr(99) + chr(0b1101111) + chr(100) + chr(0b1100011 + 0o2))(chr(117) + '\x74' + '\146' + chr(0b101101) + chr(0b1111 + 0o51)))(): if not PlSM16l2KDPD(PgUW1UssNxfH, M8_cKLkHVB2V): raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x14J\xf8Dx1\x12L\xe1\x12\xc1^\x8c\x9b\n\x0e\x9dP\x0b4#\xb9\x92\xc6\xeb\xf4\nfm\xf4|c'), chr(0b111010 + 0o52) + '\x65' + chr(0b1100011) + '\x6f' + chr(100) + chr(3092 - 2991))(chr(0b110010 + 0o103) + chr(8588 - 8472) + '\146' + chr(45) + chr(0b101000 + 0o20)), xafqLlk3kkUe(SXOLrMavuUCe(b'\tF\xe5El('), chr(100) + chr(101) + '\x63' + '\x6f' + '\144' + '\145')(chr(0b11101 + 0o130) + '\x74' + '\146' + chr(0b101101) + '\x38'))(column=Qa2uSJqQPT3w, type=PgUW1UssNxfH)) YbLi4ide0_3E = DibIiDH57Xhu(AIvJRzLdDfgF, oVre8I6UXc3b, frame=C4IqNNmLfHXB, index=XdowRbJKZWL9, if_exists=zZFPtODM90fp, index_label=Rj5_q03bvJPB, dtype=jSV9IKnemH7K) xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c[\xf2Iy9'), chr(5857 - 5757) + chr(101) + '\x63' + chr(0b1101111) + chr(100) + '\x65')('\x75' + '\164' + '\146' + '\x2d' + '\070'))() xafqLlk3kkUe(YbLi4ide0_3E, xafqLlk3kkUe(SXOLrMavuUCe(b'\x06G\xe4M\x7f('), chr(4197 - 4097) + '\x65' + chr(0b1010001 + 0o22) + chr(0b1101111) + '\x64' + chr(2374 - 2273))(chr(0b0 + 0o165) + chr(116) + '\x66' + chr(0b101101) + chr(978 - 922)))(op94qe_Rdjul, CVRCXTcnOnH6)
pandas-dev/pandas
pandas/core/arrays/categorical.py
_maybe_to_categorical
def _maybe_to_categorical(array): """ Coerce to a categorical if a series is given. Internal use ONLY. """ if isinstance(array, (ABCSeries, ABCCategoricalIndex)): return array._values elif isinstance(array, np.ndarray): return Categorical(array) return array
python
def _maybe_to_categorical(array): """ Coerce to a categorical if a series is given. Internal use ONLY. """ if isinstance(array, (ABCSeries, ABCCategoricalIndex)): return array._values elif isinstance(array, np.ndarray): return Categorical(array) return array
[ "def", "_maybe_to_categorical", "(", "array", ")", ":", "if", "isinstance", "(", "array", ",", "(", "ABCSeries", ",", "ABCCategoricalIndex", ")", ")", ":", "return", "array", ".", "_values", "elif", "isinstance", "(", "array", ",", "np", ".", "ndarray", ")", ":", "return", "Categorical", "(", "array", ")", "return", "array" ]
Coerce to a categorical if a series is given. Internal use ONLY.
[ "Coerce", "to", "a", "categorical", "if", "a", "series", "is", "given", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L131-L141
train
Coerce to a categorical if a series is given.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9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UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(2130 - 2075) + chr(2060 - 2009), 1349 - 1341), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\062' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(337 - 286) + chr(0b11001 + 0o27) + chr(0b1001 + 0o52), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + chr(0b100001 + 0o20) + chr(0b1 + 0o57) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001111 + 0o40) + chr(2232 - 2181) + '\064' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100101 + 0o112) + chr(0b110010) + '\062' + chr(793 - 745), 0b1000), ehT0Px3KOsy9(chr(1191 - 1143) + chr(111) + '\x31' + '\x36' + chr(1236 - 1187), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(1502 - 1453) + '\061' + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011111 + 0o20) + chr(2420 - 2369) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + chr(7670 - 7559) + chr(1095 - 1045) + chr(48) + chr(2091 - 2036), 5154 - 5146), ehT0Px3KOsy9(chr(48) + chr(0b1 + 0o156) + chr(0b101011 + 0o14) + chr(0b110010 + 0o0), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(1924 - 1875) + chr(0b110001), 4324 - 4316), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b110011) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10001 + 0o42) + chr(0b1100 + 0o51) + chr(1718 - 1669), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101110 + 0o10), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110101) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5040 - 4929) + '\x35' + chr(2681 - 2629), 50404 - 50396), ehT0Px3KOsy9(chr(2158 - 2110) + chr(111) + chr(0b110001) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101110 + 0o3) + chr(737 - 687) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b111 + 0o54) + chr(124 - 74) + chr(2490 - 2439), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(0b110011) + chr(53), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011111 + 0o20) + chr(0b110010) + '\067' + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10101 + 0o34) + '\065' + '\062', 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + '\x32' + '\061', 27952 - 27944), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + '\x30' + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(6316 - 6205) + chr(2575 - 2524) + chr(0b110001) + chr(2707 - 2654), 12284 - 12276), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1182 - 1132) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1110 + 0o43) + chr(0b11011 + 0o26) + '\065', 0o10), ehT0Px3KOsy9(chr(1174 - 1126) + chr(0b1101111) + '\x33' + chr(0b110000) + chr(0b101100 + 0o13), 18572 - 18564), ehT0Px3KOsy9(chr(348 - 300) + chr(0b10010 + 0o135) + chr(53) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b110000) + chr(8486 - 8375) + chr(0b10111 + 0o33) + chr(55) + chr(0b1001 + 0o53), 0b1000), ehT0Px3KOsy9(chr(48) + chr(7749 - 7638) + chr(49) + '\066' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(1145 - 1097) + chr(111) + chr(0b11010 + 0o31) + '\x34' + '\x37', 30866 - 30858), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + '\x34' + chr(54), 0o10), ehT0Px3KOsy9(chr(2263 - 2215) + '\x6f' + chr(49) + '\066' + '\065', 8), ehT0Px3KOsy9('\060' + chr(10101 - 9990) + chr(51) + chr(2197 - 2148) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(231 - 177) + chr(2213 - 2165), 61753 - 61745), ehT0Px3KOsy9(chr(48) + chr(0b101000 + 0o107) + chr(0b110001) + chr(874 - 823) + chr(0b110011 + 0o0), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4743 - 4632) + '\062' + '\x33' + chr(0b110010), 53646 - 53638)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\x6f' + chr(0b11 + 0o62) + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x95'), chr(0b11001 + 0o113) + '\145' + chr(0b1100011) + chr(0b101001 + 0o106) + chr(0b1100100) + chr(0b1100101))(chr(4395 - 4278) + '\164' + chr(0b1000101 + 0o41) + chr(0b1100 + 0o41) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def _MTomSOwj9B3(B0ePDhpqxN5n): if PlSM16l2KDPD(B0ePDhpqxN5n, (essMXh4s9f1w, Ou_oEUbhlMXT)): return xafqLlk3kkUe(B0ePDhpqxN5n, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4\xa7\xa2*\x94\xf5\x02'), chr(100) + chr(0b111110 + 0o47) + '\143' + chr(111) + chr(100) + '\x65')(chr(9937 - 9820) + '\164' + chr(2249 - 2147) + chr(868 - 823) + '\x38')) elif PlSM16l2KDPD(B0ePDhpqxN5n, xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\xb5\xa24\x93\xf1\x08'), '\144' + chr(0b1100101) + '\x63' + chr(111) + '\144' + '\145')('\x75' + chr(3568 - 3452) + chr(102) + chr(570 - 525) + chr(910 - 854)))): return XxOW0_jwnido(B0ePDhpqxN5n) return B0ePDhpqxN5n
pandas-dev/pandas
pandas/core/arrays/categorical.py
contains
def contains(cat, key, container): """ Helper for membership check for ``key`` in ``cat``. This is a helper method for :method:`__contains__` and :class:`CategoricalIndex.__contains__`. Returns True if ``key`` is in ``cat.categories`` and the location of ``key`` in ``categories`` is in ``container``. Parameters ---------- cat : :class:`Categorical`or :class:`categoricalIndex` key : a hashable object The key to check membership for. container : Container (e.g. list-like or mapping) The container to check for membership in. Returns ------- is_in : bool True if ``key`` is in ``self.categories`` and location of ``key`` in ``categories`` is in ``container``, else False. Notes ----- This method does not check for NaN values. Do that separately before calling this method. """ hash(key) # get location of key in categories. # If a KeyError, the key isn't in categories, so logically # can't be in container either. try: loc = cat.categories.get_loc(key) except KeyError: return False # loc is the location of key in categories, but also the *value* # for key in container. So, `key` may be in categories, # but still not in `container`. Example ('b' in categories, # but not in values): # 'b' in Categorical(['a'], categories=['a', 'b']) # False if is_scalar(loc): return loc in container else: # if categories is an IntervalIndex, loc is an array. return any(loc_ in container for loc_ in loc)
python
def contains(cat, key, container): """ Helper for membership check for ``key`` in ``cat``. This is a helper method for :method:`__contains__` and :class:`CategoricalIndex.__contains__`. Returns True if ``key`` is in ``cat.categories`` and the location of ``key`` in ``categories`` is in ``container``. Parameters ---------- cat : :class:`Categorical`or :class:`categoricalIndex` key : a hashable object The key to check membership for. container : Container (e.g. list-like or mapping) The container to check for membership in. Returns ------- is_in : bool True if ``key`` is in ``self.categories`` and location of ``key`` in ``categories`` is in ``container``, else False. Notes ----- This method does not check for NaN values. Do that separately before calling this method. """ hash(key) # get location of key in categories. # If a KeyError, the key isn't in categories, so logically # can't be in container either. try: loc = cat.categories.get_loc(key) except KeyError: return False # loc is the location of key in categories, but also the *value* # for key in container. So, `key` may be in categories, # but still not in `container`. Example ('b' in categories, # but not in values): # 'b' in Categorical(['a'], categories=['a', 'b']) # False if is_scalar(loc): return loc in container else: # if categories is an IntervalIndex, loc is an array. return any(loc_ in container for loc_ in loc)
[ "def", "contains", "(", "cat", ",", "key", ",", "container", ")", ":", "hash", "(", "key", ")", "# get location of key in categories.", "# If a KeyError, the key isn't in categories, so logically", "# can't be in container either.", "try", ":", "loc", "=", "cat", ".", "categories", ".", "get_loc", "(", "key", ")", "except", "KeyError", ":", "return", "False", "# loc is the location of key in categories, but also the *value*", "# for key in container. So, `key` may be in categories,", "# but still not in `container`. Example ('b' in categories,", "# but not in values):", "# 'b' in Categorical(['a'], categories=['a', 'b']) # False", "if", "is_scalar", "(", "loc", ")", ":", "return", "loc", "in", "container", "else", ":", "# if categories is an IntervalIndex, loc is an array.", "return", "any", "(", "loc_", "in", "container", "for", "loc_", "in", "loc", ")" ]
Helper for membership check for ``key`` in ``cat``. This is a helper method for :method:`__contains__` and :class:`CategoricalIndex.__contains__`. Returns True if ``key`` is in ``cat.categories`` and the location of ``key`` in ``categories`` is in ``container``. Parameters ---------- cat : :class:`Categorical`or :class:`categoricalIndex` key : a hashable object The key to check membership for. container : Container (e.g. list-like or mapping) The container to check for membership in. Returns ------- is_in : bool True if ``key`` is in ``self.categories`` and location of ``key`` in ``categories`` is in ``container``, else False. Notes ----- This method does not check for NaN values. Do that separately before calling this method.
[ "Helper", "for", "membership", "check", "for", "key", "in", "cat", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L144-L192
train
Returns True if key is in container False otherwise.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF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rokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b111110 + 0o61) + chr(0b110001) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(1902 - 1854) + chr(0b1011101 + 0o22) + chr(0b110001) + '\067' + chr(1712 - 1663), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(1431 - 1380) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\066' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(9070 - 8959) + chr(0b10100 + 0o37) + '\064' + chr(0b10001 + 0o40), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + '\063' + chr(0b101010 + 0o7) + chr(50), 0b1000), ehT0Px3KOsy9(chr(287 - 239) + chr(111) + '\061' + chr(0b110000), 62480 - 62472), ehT0Px3KOsy9('\x30' + chr(7524 - 7413) + '\x34' + chr(295 - 240), 59451 - 59443), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(55) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + chr(0b1 + 0o60) + '\065' + chr(717 - 667), ord("\x08")), ehT0Px3KOsy9(chr(1725 - 1677) + '\157' + chr(0b100111 + 0o13) + '\x33' + chr(827 - 777), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010011 + 0o34) + chr(0b110001) + chr(576 - 524) + chr(2444 - 2394), 0o10), ehT0Px3KOsy9(chr(1767 - 1719) + chr(0b1000000 + 0o57) + chr(49) + chr(0b110011 + 0o1) + chr(0b100101 + 0o20), 0o10), ehT0Px3KOsy9(chr(48) + chr(842 - 731) + chr(53) + chr(0b110010 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110111) + '\061', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(579 - 530) + '\061' + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1662 - 1613) + chr(0b101100 + 0o6) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(50) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + '\x35', 10197 - 10189), ehT0Px3KOsy9(chr(48) + chr(0b1100000 + 0o17) + chr(0b110011) + chr(0b11111 + 0o23), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + '\x33' + '\066', 30117 - 30109), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11011 + 0o30) + chr(55) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(55) + chr(880 - 827), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + chr(0b110010) + '\x36' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000001 + 0o56) + chr(0b110011) + chr(1573 - 1522) + chr(1619 - 1570), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(8112 - 8001) + '\x33' + '\x32' + chr(2226 - 2172), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + '\x36' + chr(48), 0b1000), ehT0Px3KOsy9(chr(865 - 817) + chr(0b1101111) + chr(2108 - 2055), 8), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(111) + chr(2198 - 2149) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(51) + chr(2039 - 1991), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(0b101111 + 0o6) + chr(2681 - 2626), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(50) + '\063', 8), ehT0Px3KOsy9(chr(2119 - 2071) + '\x6f' + '\063' + chr(0b110100) + chr(343 - 289), 54742 - 54734), ehT0Px3KOsy9(chr(1894 - 1846) + chr(111) + chr(216 - 166) + chr(0b110001) + chr(52), 40186 - 40178), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + '\x35' + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10263 - 10152) + chr(921 - 871) + chr(49) + '\064', 8), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(1838 - 1788) + chr(48), 0b1000), ehT0Px3KOsy9(chr(1761 - 1713) + chr(11591 - 11480) + '\x32' + chr(55) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + '\064' + '\x30', 16735 - 16727), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(0b110011) + chr(0b110001), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110101) + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'$'), chr(4861 - 4761) + '\x65' + chr(99) + chr(0b1001 + 0o146) + '\x64' + chr(0b1100101))(chr(0b1000111 + 0o56) + chr(6232 - 6116) + chr(0b1011111 + 0o7) + '\055' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def hJgVZSp3iMlY(re0VVGAVKu27, K3J4ZwSlE0sT, DCCEfdtuXq1i): xfhwxiBOH72k(K3J4ZwSlE0sT) try: MmVY7Id_ODNA = re0VVGAVKu27.categories.get_loc(K3J4ZwSlE0sT) except RQ6CSRrFArYB: return ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110000), 0o10) if aORqH388wQku(MmVY7Id_ODNA): return MmVY7Id_ODNA in DCCEfdtuXq1i else: return UVSi4XW7eBIM((DiEp2P04Q4oi in DCCEfdtuXq1i for DiEp2P04Q4oi in MmVY7Id_ODNA))
pandas-dev/pandas
pandas/core/arrays/categorical.py
_get_codes_for_values
def _get_codes_for_values(values, categories): """ utility routine to turn values into codes given the specified categories """ from pandas.core.algorithms import _get_data_algo, _hashtables dtype_equal = is_dtype_equal(values.dtype, categories.dtype) if dtype_equal: # To prevent erroneous dtype coercion in _get_data_algo, retrieve # the underlying numpy array. gh-22702 values = getattr(values, '_ndarray_values', values) categories = getattr(categories, '_ndarray_values', categories) elif (is_extension_array_dtype(categories.dtype) and is_object_dtype(values)): # Support inferring the correct extension dtype from an array of # scalar objects. e.g. # Categorical(array[Period, Period], categories=PeriodIndex(...)) try: values = ( categories.dtype.construct_array_type()._from_sequence(values) ) except Exception: # but that may fail for any reason, so fall back to object values = ensure_object(values) categories = ensure_object(categories) else: values = ensure_object(values) categories = ensure_object(categories) (hash_klass, vec_klass), vals = _get_data_algo(values, _hashtables) (_, _), cats = _get_data_algo(categories, _hashtables) t = hash_klass(len(cats)) t.map_locations(cats) return coerce_indexer_dtype(t.lookup(vals), cats)
python
def _get_codes_for_values(values, categories): """ utility routine to turn values into codes given the specified categories """ from pandas.core.algorithms import _get_data_algo, _hashtables dtype_equal = is_dtype_equal(values.dtype, categories.dtype) if dtype_equal: # To prevent erroneous dtype coercion in _get_data_algo, retrieve # the underlying numpy array. gh-22702 values = getattr(values, '_ndarray_values', values) categories = getattr(categories, '_ndarray_values', categories) elif (is_extension_array_dtype(categories.dtype) and is_object_dtype(values)): # Support inferring the correct extension dtype from an array of # scalar objects. e.g. # Categorical(array[Period, Period], categories=PeriodIndex(...)) try: values = ( categories.dtype.construct_array_type()._from_sequence(values) ) except Exception: # but that may fail for any reason, so fall back to object values = ensure_object(values) categories = ensure_object(categories) else: values = ensure_object(values) categories = ensure_object(categories) (hash_klass, vec_klass), vals = _get_data_algo(values, _hashtables) (_, _), cats = _get_data_algo(categories, _hashtables) t = hash_klass(len(cats)) t.map_locations(cats) return coerce_indexer_dtype(t.lookup(vals), cats)
[ "def", "_get_codes_for_values", "(", "values", ",", "categories", ")", ":", "from", "pandas", ".", "core", ".", "algorithms", "import", "_get_data_algo", ",", "_hashtables", "dtype_equal", "=", "is_dtype_equal", "(", "values", ".", "dtype", ",", "categories", ".", "dtype", ")", "if", "dtype_equal", ":", "# To prevent erroneous dtype coercion in _get_data_algo, retrieve", "# the underlying numpy array. gh-22702", "values", "=", "getattr", "(", "values", ",", "'_ndarray_values'", ",", "values", ")", "categories", "=", "getattr", "(", "categories", ",", "'_ndarray_values'", ",", "categories", ")", "elif", "(", "is_extension_array_dtype", "(", "categories", ".", "dtype", ")", "and", "is_object_dtype", "(", "values", ")", ")", ":", "# Support inferring the correct extension dtype from an array of", "# scalar objects. e.g.", "# Categorical(array[Period, Period], categories=PeriodIndex(...))", "try", ":", "values", "=", "(", "categories", ".", "dtype", ".", "construct_array_type", "(", ")", ".", "_from_sequence", "(", "values", ")", ")", "except", "Exception", ":", "# but that may fail for any reason, so fall back to object", "values", "=", "ensure_object", "(", "values", ")", "categories", "=", "ensure_object", "(", "categories", ")", "else", ":", "values", "=", "ensure_object", "(", "values", ")", "categories", "=", "ensure_object", "(", "categories", ")", "(", "hash_klass", ",", "vec_klass", ")", ",", "vals", "=", "_get_data_algo", "(", "values", ",", "_hashtables", ")", "(", "_", ",", "_", ")", ",", "cats", "=", "_get_data_algo", "(", "categories", ",", "_hashtables", ")", "t", "=", "hash_klass", "(", "len", "(", "cats", ")", ")", "t", ".", "map_locations", "(", "cats", ")", "return", "coerce_indexer_dtype", "(", "t", ".", "lookup", "(", "vals", ")", ",", "cats", ")" ]
utility routine to turn values into codes given the specified categories
[ "utility", "routine", "to", "turn", "values", "into", "codes", "given", "the", "specified", "categories" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L2549-L2582
train
This utility routine returns the codes given the values and categories.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQ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Wzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010 + 0o1) + chr(0b1001 + 0o55) + chr(2396 - 2344), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + chr(2686 - 2631) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(3958 - 3847) + chr(0b110011) + '\x37' + chr(0b0 + 0o61), 31338 - 31330), ehT0Px3KOsy9(chr(48) + chr(0b11101 + 0o122) + chr(1859 - 1809) + chr(51) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b110101) + chr(0b1101 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(50) + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(75 - 26) + '\062', 51946 - 51938), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101001 + 0o6) + '\x32' + chr(0b1 + 0o60) + chr(0b10110 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000000 + 0o57) + '\063' + '\067' + chr(1384 - 1333), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(1114 - 1062), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010 + 0o145) + chr(50) + chr(0b110101 + 0o2) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1101111) + '\065' + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + '\067' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b1110 + 0o44) + chr(0b1010 + 0o50), 8), ehT0Px3KOsy9(chr(48) + chr(0b11101 + 0o122) + '\061' + chr(322 - 268) + chr(0b11010 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b1101 + 0o52) + chr(49), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101110 + 0o5) + chr(0b101101 + 0o3) + chr(49), 22614 - 22606), ehT0Px3KOsy9(chr(570 - 522) + '\x6f' + '\063' + '\x32' + chr(0b100101 + 0o14), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(1466 - 1415) + '\066', 27871 - 27863), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(0b110010) + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + chr(6182 - 6071) + chr(0b1000 + 0o53) + chr(48) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(0b110100) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(999 - 948) + '\066' + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11000 + 0o33) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(750 - 639) + chr(50) + chr(0b1111 + 0o42) + chr(0b101110 + 0o6), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10111 + 0o130) + chr(786 - 737) + chr(320 - 272) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b111101 + 0o62) + chr(49) + chr(0b110111) + chr(1643 - 1593), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(803 - 753) + chr(0b101101 + 0o10) + chr(53), 0o10), ehT0Px3KOsy9(chr(2128 - 2080) + chr(111) + chr(1070 - 1021) + chr(54) + '\065', 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1382 - 1333) + '\x36' + chr(0b101101 + 0o6), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(720 - 669) + chr(567 - 514) + chr(0b11100 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + chr(0b110001) + '\061' + chr(50), 23697 - 23689), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\062' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + chr(1175 - 1126) + chr(50) + chr(0b11011 + 0o33), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100110 + 0o21) + chr(440 - 385), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\062' + '\x30', 731 - 723), ehT0Px3KOsy9(chr(2270 - 2222) + chr(111) + '\061' + chr(1652 - 1600), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1976 - 1927) + chr(626 - 572) + '\x33', 8), ehT0Px3KOsy9(chr(1772 - 1724) + chr(111) + chr(0b110 + 0o55) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + '\061' + chr(51), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110101) + chr(2059 - 2011), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xda'), chr(0b1100100) + chr(101) + '\143' + '\x6f' + chr(100) + chr(101))(chr(117) + chr(6838 - 6722) + chr(0b1100110) + chr(1292 - 1247) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def SrdNuo8P440p(SPnCNu54H1db, mZZDAT49UzAb): (XXUTrUA1yaHq, LEul_3kw5r1U) = (xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x84]\x97\xfc\x0f!\xa4\xea\x94~\xdc\x04\x1e>\x12\x96\xb3\xb8*~\xad\x92'), chr(0b1000010 + 0o42) + chr(0b1100101) + chr(99) + '\x6f' + chr(0b1001111 + 0o25) + chr(0b110101 + 0o60))('\x75' + '\164' + chr(102) + '\x2d' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xab[\x9c\xec16\xeb\xfd\x9aS\xd8F\x18='), chr(729 - 629) + '\x65' + chr(803 - 704) + '\x6f' + '\144' + '\145')('\165' + chr(116) + chr(102) + chr(0b101101) + chr(0b101001 + 0o17))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x97S\x8b\xfd'), chr(0b1100100) + chr(101) + chr(0b100111 + 0o74) + '\x6f' + chr(0b1100100) + chr(7913 - 7812))('\x75' + chr(0b1100111 + 0o15) + chr(0b1100110) + '\055' + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x95P\x9e\xf7\x1c;\xfe\xe1\x96\x7f'), chr(2470 - 2370) + '\145' + chr(6314 - 6215) + chr(7509 - 7398) + '\x64' + chr(0b1100101))(chr(9267 - 9150) + chr(0b1110100) + chr(9964 - 9862) + chr(1774 - 1729) + chr(0b110111 + 0o1))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xab[\x9c\xec16\xeb\xfd\x9aS\xd8F\x18='), '\144' + '\x65' + chr(3018 - 2919) + chr(111) + '\x64' + chr(101))(chr(0b1011010 + 0o33) + chr(116) + chr(102) + '\055' + chr(0b111000))), xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x84]\x97\xfc\x0f!\xa4\xea\x94~\xdc\x04\x1e>\x12\x96\xb3\xb8*~\xad\x92'), '\x64' + chr(101) + chr(0b1100011) + chr(0b1000001 + 0o56) + chr(4474 - 4374) + '\145')(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xabT\x98\xeb\x06&\xeb\xeb\x97i\xca'), chr(6032 - 5932) + '\145' + chr(99) + '\x6f' + chr(100) + chr(101))(chr(0b1100010 + 0o23) + chr(2292 - 2176) + chr(102) + chr(1745 - 1700) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x97S\x8b\xfd'), chr(5107 - 5007) + chr(101) + '\143' + '\x6f' + chr(100) + chr(9306 - 9205))(chr(117) + chr(116) + chr(0b1100110) + chr(1181 - 1136) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\x95P\x9e\xf7\x1c;\xfe\xe1\x96\x7f'), chr(4716 - 4616) + chr(0b1100101) + chr(5091 - 4992) + chr(0b1101111) + '\144' + '\145')(chr(0b1110101) + chr(0b1110100) + chr(0b1011111 + 0o7) + chr(45) + chr(537 - 481))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xabT\x98\xeb\x06&\xeb\xeb\x97i\xca'), '\x64' + chr(0b1100101) + chr(587 - 488) + '\x6f' + chr(1797 - 1697) + chr(2411 - 2310))(chr(0b1110101) + '\164' + '\146' + chr(45) + chr(2173 - 2117)))) nzq7a3W9hvjF = V1zUTkhQur0z(SPnCNu54H1db.dtype, mZZDAT49UzAb.dtype) if nzq7a3W9hvjF: SPnCNu54H1db = xafqLlk3kkUe(SPnCNu54H1db, xafqLlk3kkUe(SXOLrMavuUCe(b'\xabR\x9d\xf9\x1c \xeb\xf0\xa4z\xd8F\n7\x06'), chr(100) + chr(101) + chr(600 - 501) + chr(0b1101111) + chr(0b1100100) + '\145')('\x75' + chr(0b1110100) + chr(0b1100110) + '\055' + '\070'), SPnCNu54H1db) mZZDAT49UzAb = xafqLlk3kkUe(mZZDAT49UzAb, xafqLlk3kkUe(SXOLrMavuUCe(b'\xabR\x9d\xf9\x1c \xeb\xf0\xa4z\xd8F\n7\x06'), chr(0b1001100 + 0o30) + '\x65' + chr(515 - 416) + '\157' + chr(3239 - 3139) + '\x65')('\165' + chr(116) + chr(102) + chr(45) + chr(683 - 627)), mZZDAT49UzAb) elif BeeaaSlTfmO2(xafqLlk3kkUe(mZZDAT49UzAb, xafqLlk3kkUe(SXOLrMavuUCe(b'\x90H\x80\xe8\x0b'), chr(0b1100100) + chr(0b1000101 + 0o40) + chr(0b1011110 + 0o5) + chr(111) + '\144' + '\145')(chr(0b1011100 + 0o31) + chr(0b1110100) + '\146' + chr(972 - 927) + chr(56)))) and NGkWsclKfnpq(SPnCNu54H1db): try: SPnCNu54H1db = mZZDAT49UzAb.dtype.construct_array_type()._from_sequence(SPnCNu54H1db) except jLmadlzMdunT: SPnCNu54H1db = vd4vF5cOhwLp(SPnCNu54H1db) mZZDAT49UzAb = vd4vF5cOhwLp(mZZDAT49UzAb) else: SPnCNu54H1db = vd4vF5cOhwLp(SPnCNu54H1db) mZZDAT49UzAb = vd4vF5cOhwLp(mZZDAT49UzAb) ((QXaNhVnhbARy, nC3Tem87KLEd), ipy0WJZo1Oft) = XXUTrUA1yaHq(SPnCNu54H1db, LEul_3kw5r1U) ((VNGQdHSFPrso, VNGQdHSFPrso), _IZEDmb5AMbL) = XXUTrUA1yaHq(mZZDAT49UzAb, LEul_3kw5r1U) YeT3l7JgTbWR = QXaNhVnhbARy(c2A0yzQpDQB3(_IZEDmb5AMbL)) xafqLlk3kkUe(YeT3l7JgTbWR, xafqLlk3kkUe(SXOLrMavuUCe(b'\x99]\x89\xc7\x02=\xe9\xe8\x8fe\xd6D\x0c'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(1591 - 1480) + chr(0b1100100) + '\145')(chr(0b1110101) + '\x74' + chr(0b1110 + 0o130) + '\055' + chr(0b100000 + 0o30)))(_IZEDmb5AMbL) return IhoUBFeIAvnv(xafqLlk3kkUe(YeT3l7JgTbWR, xafqLlk3kkUe(SXOLrMavuUCe(b'\x98S\x96\xf3\x1b"'), chr(0b1000110 + 0o36) + chr(5073 - 4972) + chr(0b1100011) + chr(0b1001000 + 0o47) + chr(0b10101 + 0o117) + chr(0b1100101))(chr(117) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(0b111000)))(ipy0WJZo1Oft), _IZEDmb5AMbL)
pandas-dev/pandas
pandas/core/arrays/categorical.py
_recode_for_categories
def _recode_for_categories(codes, old_categories, new_categories): """ Convert a set of codes for to a new set of categories Parameters ---------- codes : array old_categories, new_categories : Index Returns ------- new_codes : array Examples -------- >>> old_cat = pd.Index(['b', 'a', 'c']) >>> new_cat = pd.Index(['a', 'b']) >>> codes = np.array([0, 1, 1, 2]) >>> _recode_for_categories(codes, old_cat, new_cat) array([ 1, 0, 0, -1]) """ from pandas.core.algorithms import take_1d if len(old_categories) == 0: # All null anyway, so just retain the nulls return codes.copy() elif new_categories.equals(old_categories): # Same categories, so no need to actually recode return codes.copy() indexer = coerce_indexer_dtype(new_categories.get_indexer(old_categories), new_categories) new_codes = take_1d(indexer, codes.copy(), fill_value=-1) return new_codes
python
def _recode_for_categories(codes, old_categories, new_categories): """ Convert a set of codes for to a new set of categories Parameters ---------- codes : array old_categories, new_categories : Index Returns ------- new_codes : array Examples -------- >>> old_cat = pd.Index(['b', 'a', 'c']) >>> new_cat = pd.Index(['a', 'b']) >>> codes = np.array([0, 1, 1, 2]) >>> _recode_for_categories(codes, old_cat, new_cat) array([ 1, 0, 0, -1]) """ from pandas.core.algorithms import take_1d if len(old_categories) == 0: # All null anyway, so just retain the nulls return codes.copy() elif new_categories.equals(old_categories): # Same categories, so no need to actually recode return codes.copy() indexer = coerce_indexer_dtype(new_categories.get_indexer(old_categories), new_categories) new_codes = take_1d(indexer, codes.copy(), fill_value=-1) return new_codes
[ "def", "_recode_for_categories", "(", "codes", ",", "old_categories", ",", "new_categories", ")", ":", "from", "pandas", ".", "core", ".", "algorithms", "import", "take_1d", "if", "len", "(", "old_categories", ")", "==", "0", ":", "# All null anyway, so just retain the nulls", "return", "codes", ".", "copy", "(", ")", "elif", "new_categories", ".", "equals", "(", "old_categories", ")", ":", "# Same categories, so no need to actually recode", "return", "codes", ".", "copy", "(", ")", "indexer", "=", "coerce_indexer_dtype", "(", "new_categories", ".", "get_indexer", "(", "old_categories", ")", ",", "new_categories", ")", "new_codes", "=", "take_1d", "(", "indexer", ",", "codes", ".", "copy", "(", ")", ",", "fill_value", "=", "-", "1", ")", "return", "new_codes" ]
Convert a set of codes for to a new set of categories Parameters ---------- codes : array old_categories, new_categories : Index Returns ------- new_codes : array Examples -------- >>> old_cat = pd.Index(['b', 'a', 'c']) >>> new_cat = pd.Index(['a', 'b']) >>> codes = np.array([0, 1, 1, 2]) >>> _recode_for_categories(codes, old_cat, new_cat) array([ 1, 0, 0, -1])
[ "Convert", "a", "set", "of", "codes", "for", "to", "a", "new", "set", "of", "categories" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L2585-L2617
train
Convert a set of codes for to a new set of categories
Pu7Z6IJCgH3a,vcE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qkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\x6f' + '\065' + '\062', 0o10), ehT0Px3KOsy9(chr(1287 - 1239) + chr(0b1101111) + chr(0b110001) + '\066' + chr(0b100000 + 0o20), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b110010) + '\061', 0o10), ehT0Px3KOsy9(chr(459 - 411) + chr(0b1011000 + 0o27) + chr(49) + '\x35' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9674 - 9563) + chr(367 - 313) + '\061', 40895 - 40887), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2317 - 2266) + '\x36' + chr(0b110011), 42036 - 42028), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101111 + 0o3) + chr(905 - 857) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b110101) + '\060', 0b1000), ehT0Px3KOsy9(chr(172 - 124) + '\157' + '\061' + '\064' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(49), 35651 - 35643), ehT0Px3KOsy9('\x30' + chr(0b1000110 + 0o51) + chr(0b11110 + 0o24) + chr(0b110100) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(668 - 620) + chr(0b11000 + 0o127) + '\x33' + chr(55) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(50) + chr(1898 - 1846), 0b1000), ehT0Px3KOsy9(chr(254 - 206) + '\157' + chr(2049 - 1999) + chr(1705 - 1655) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + chr(0b110011) + chr(0b101011 + 0o13) + chr(0b10101 + 0o40), 33939 - 33931), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + '\061' + '\x31' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(0b110001) + chr(0b110011) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1911 - 1858) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100010 + 0o17) + chr(0b110100 + 0o2) + chr(1513 - 1465), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10110 + 0o131) + '\061' + '\060' + '\066', 0o10), ehT0Px3KOsy9(chr(2057 - 2009) + '\x6f' + chr(0b110010) + '\064' + chr(1798 - 1743), 25938 - 25930), ehT0Px3KOsy9(chr(0b110000) + chr(8084 - 7973) + chr(0b1011 + 0o46) + '\064' + '\x30', 5439 - 5431), ehT0Px3KOsy9(chr(2236 - 2188) + chr(5766 - 5655) + '\x33' + '\x31' + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000010 + 0o55) + '\x33' + '\066' + chr(0b110101), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(1876 - 1827) + chr(783 - 733), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(416 - 365) + '\066', 51788 - 51780), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(1623 - 1573) + chr(170 - 121) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(1897 - 1849) + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(1109 - 998) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1265 - 1217) + chr(4868 - 4757) + chr(0b10111 + 0o32) + chr(323 - 270) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\x36' + chr(54), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b10100 + 0o35) + '\062' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b11000 + 0o33) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011 + 0o144) + chr(0b110011) + chr(51) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110100 + 0o73) + '\x31', 8), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + chr(0b110011) + chr(439 - 385), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + '\060' + chr(517 - 464), ord("\x08")), ehT0Px3KOsy9(chr(906 - 858) + chr(111) + chr(0b110011) + chr(0b110100) + chr(53), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + '\065' + chr(0b110000), 16052 - 16044)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x04'), chr(0b1100100) + '\145' + '\143' + '\157' + chr(0b110011 + 0o61) + chr(101))(chr(117) + chr(8013 - 7897) + chr(1552 - 1450) + chr(0b1110 + 0o37) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def V3m1SlhRYSW0(AoWJEgIAbHh_, uMS41nVaCB3S, QVK8u7RnAnpO): (u8JncEabnCrx,) = (xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'Z\x11?\x0eP\x80\xae\x0b\x0bk\xc7\xd7\xb5\xfd\x92"/@\x04\x7f+\xd4'), '\144' + chr(8534 - 8433) + chr(0b10000 + 0o123) + '\x6f' + chr(0b1100000 + 0o4) + chr(0b1001111 + 0o26))(chr(117) + chr(2418 - 2302) + '\x66' + '\055' + chr(1876 - 1820)), xafqLlk3kkUe(SXOLrMavuUCe(b'^\x11:\x0fn\xc2\xe4'), chr(0b1011110 + 0o6) + chr(0b100111 + 0o76) + chr(0b1100011) + chr(5378 - 5267) + chr(0b1100100) + chr(101))(chr(117) + chr(116) + '\x66' + chr(0b101100 + 0o1) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'I\x1f#\x0f'), chr(100) + chr(0b1100101) + chr(99) + chr(10518 - 10407) + '\144' + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b1010000 + 0o26) + '\x2d' + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'K\x1c6\x05C\x9a\xf4\x00\tj'), '\144' + '\x65' + chr(3735 - 3636) + '\157' + '\x64' + chr(10038 - 9937))('\x75' + chr(8322 - 8206) + chr(102) + '\055' + chr(0b10001 + 0o47))), xafqLlk3kkUe(SXOLrMavuUCe(b'^\x11:\x0fn\xc2\xe4'), chr(0b1011111 + 0o5) + '\145' + chr(822 - 723) + chr(0b1101111) + chr(100) + chr(101))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101101) + '\070')),) if c2A0yzQpDQB3(uMS41nVaCB3S) == ehT0Px3KOsy9('\x30' + '\x6f' + chr(1316 - 1268), 10771 - 10763): return xafqLlk3kkUe(AoWJEgIAbHh_, xafqLlk3kkUe(SXOLrMavuUCe(b'C\x17\x05\x02y\xa0\xb4\x02\x13O\xd1\x98'), chr(0b1110 + 0o126) + chr(0b1100101) + chr(8854 - 8755) + chr(111) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1001110 + 0o46) + chr(102) + chr(0b101101) + chr(0b100100 + 0o24)))() elif xafqLlk3kkUe(QVK8u7RnAnpO, xafqLlk3kkUe(SXOLrMavuUCe(b'O\x01$\x0b]\x80'), chr(100) + '\x65' + chr(6460 - 6361) + chr(111) + chr(100) + '\145')(chr(117) + chr(116) + chr(102) + chr(45) + chr(0b11 + 0o65)))(uMS41nVaCB3S): return xafqLlk3kkUe(AoWJEgIAbHh_, xafqLlk3kkUe(SXOLrMavuUCe(b'C\x17\x05\x02y\xa0\xb4\x02\x13O\xd1\x98'), chr(0b1100000 + 0o4) + chr(2351 - 2250) + chr(3647 - 3548) + chr(111) + chr(0b1100100) + '\145')(chr(117) + chr(5613 - 5497) + chr(0b1100110) + chr(0b101101) + '\x38'))() BvJfssszZMhp = IhoUBFeIAvnv(QVK8u7RnAnpO.XZES6opsvx5w(uMS41nVaCB3S), QVK8u7RnAnpO) ZOp_qeUX5QuP = u8JncEabnCrx(BvJfssszZMhp, AoWJEgIAbHh_.igThHS4jwVsa(), fill_value=-ehT0Px3KOsy9('\060' + chr(0b11000 + 0o127) + chr(1234 - 1185), 8)) return ZOp_qeUX5QuP
pandas-dev/pandas
pandas/core/arrays/categorical.py
_factorize_from_iterable
def _factorize_from_iterable(values): """ Factorize an input `values` into `categories` and `codes`. Preserves categorical dtype in `categories`. *This is an internal function* Parameters ---------- values : list-like Returns ------- codes : ndarray categories : Index If `values` has a categorical dtype, then `categories` is a CategoricalIndex keeping the categories and order of `values`. """ from pandas.core.indexes.category import CategoricalIndex if not is_list_like(values): raise TypeError("Input must be list-like") if is_categorical(values): if isinstance(values, (ABCCategoricalIndex, ABCSeries)): values = values._values categories = CategoricalIndex(values.categories, dtype=values.dtype) codes = values.codes else: # The value of ordered is irrelevant since we don't use cat as such, # but only the resulting categories, the order of which is independent # from ordered. Set ordered to False as default. See GH #15457 cat = Categorical(values, ordered=False) categories = cat.categories codes = cat.codes return codes, categories
python
def _factorize_from_iterable(values): """ Factorize an input `values` into `categories` and `codes`. Preserves categorical dtype in `categories`. *This is an internal function* Parameters ---------- values : list-like Returns ------- codes : ndarray categories : Index If `values` has a categorical dtype, then `categories` is a CategoricalIndex keeping the categories and order of `values`. """ from pandas.core.indexes.category import CategoricalIndex if not is_list_like(values): raise TypeError("Input must be list-like") if is_categorical(values): if isinstance(values, (ABCCategoricalIndex, ABCSeries)): values = values._values categories = CategoricalIndex(values.categories, dtype=values.dtype) codes = values.codes else: # The value of ordered is irrelevant since we don't use cat as such, # but only the resulting categories, the order of which is independent # from ordered. Set ordered to False as default. See GH #15457 cat = Categorical(values, ordered=False) categories = cat.categories codes = cat.codes return codes, categories
[ "def", "_factorize_from_iterable", "(", "values", ")", ":", "from", "pandas", ".", "core", ".", "indexes", ".", "category", "import", "CategoricalIndex", "if", "not", "is_list_like", "(", "values", ")", ":", "raise", "TypeError", "(", "\"Input must be list-like\"", ")", "if", "is_categorical", "(", "values", ")", ":", "if", "isinstance", "(", "values", ",", "(", "ABCCategoricalIndex", ",", "ABCSeries", ")", ")", ":", "values", "=", "values", ".", "_values", "categories", "=", "CategoricalIndex", "(", "values", ".", "categories", ",", "dtype", "=", "values", ".", "dtype", ")", "codes", "=", "values", ".", "codes", "else", ":", "# The value of ordered is irrelevant since we don't use cat as such,", "# but only the resulting categories, the order of which is independent", "# from ordered. Set ordered to False as default. See GH #15457", "cat", "=", "Categorical", "(", "values", ",", "ordered", "=", "False", ")", "categories", "=", "cat", ".", "categories", "codes", "=", "cat", ".", "codes", "return", "codes", ",", "categories" ]
Factorize an input `values` into `categories` and `codes`. Preserves categorical dtype in `categories`. *This is an internal function* Parameters ---------- values : list-like Returns ------- codes : ndarray categories : Index If `values` has a categorical dtype, then `categories` is a CategoricalIndex keeping the categories and order of `values`.
[ "Factorize", "an", "input", "values", "into", "categories", "and", "codes", ".", "Preserves", "categorical", "dtype", "in", "categories", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L2635-L2670
train
Factorize an input values into categories and codes. Preserves categorical dtype in categories.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,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rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b100110 + 0o111) + chr(0b110010) + chr(2316 - 2261) + chr(0b110000), 4690 - 4682), ehT0Px3KOsy9(chr(1914 - 1866) + chr(0b1101111) + chr(1760 - 1711) + '\065' + chr(0b110110), 49252 - 49244), ehT0Px3KOsy9('\x30' + chr(0b1101100 + 0o3) + chr(0b10 + 0o61) + '\x37' + chr(0b110111), 554 - 546), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + '\x32' + '\x37', 7403 - 7395), ehT0Px3KOsy9('\060' + chr(0b1111 + 0o140) + chr(2201 - 2150) + chr(0b110001 + 0o2) + chr(0b110011), 44550 - 44542), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + '\x35' + chr(2002 - 1953), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100000 + 0o23) + chr(0b100000 + 0o20) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(0b0 + 0o66) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\157' + '\x31' + chr(485 - 432) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1417 - 1367) + '\067' + '\062', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110101) + chr(0b110100), 65407 - 65399), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(50) + chr(0b101100 + 0o7), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110100 + 0o73) + '\062' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(0b110011) + chr(0b1111 + 0o41), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x37' + chr(0b10100 + 0o37), 32076 - 32068), ehT0Px3KOsy9(chr(1394 - 1346) + '\x6f' + chr(0b100 + 0o57) + '\061', 17447 - 17439), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(51) + chr(51), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + '\064' + chr(52), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(2085 - 2035) + chr(2158 - 2109), 0o10), ehT0Px3KOsy9('\x30' + chr(8052 - 7941) + '\x32' + chr(52) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(1530 - 1419) + '\063' + '\x31' + '\062', 19822 - 19814), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b110101) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110000) + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(0b1000 + 0o147) + chr(2113 - 2064) + chr(54) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(0b10000 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(1225 - 1177) + '\x6f' + chr(1158 - 1109) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1011 + 0o144) + chr(1017 - 968) + chr(0b100111 + 0o20) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + chr(0b110011) + '\064' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + '\060' + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100101 + 0o14) + chr(0b10111 + 0o32) + chr(50), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(2140 - 2087), 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + chr(0b110001) + chr(0b1111 + 0o45) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1686 - 1638) + '\157' + chr(0b110001) + chr(2621 - 2567) + chr(2243 - 2190), 8), ehT0Px3KOsy9('\060' + chr(448 - 337) + chr(1705 - 1654) + '\061' + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10000 + 0o43) + '\067' + chr(0b110111), 8), ehT0Px3KOsy9(chr(0b110000) + chr(3799 - 3688) + '\061' + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x33' + '\063' + chr(0b110001), 26708 - 26700)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10111 + 0o36) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x96'), '\144' + '\x65' + chr(0b111100 + 0o47) + chr(0b1101111) + chr(0b1010001 + 0o23) + chr(0b1001100 + 0o31))('\165' + chr(116) + chr(0b10010 + 0o124) + chr(0b101101) + chr(221 - 165)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def DLdThINXppxL(SPnCNu54H1db): (YH_C7u76pUaX,) = (xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8\x0f\x91\xb3\xba\x1a\xecQ\x00\xc8I\xfd\x7f\xb6_|\xa3\xc1b\x8c{u\xbe\xcc\xe0\x1aer'), '\x64' + '\x65' + chr(0b1100011) + '\x6f' + '\x64' + chr(9079 - 8978))(chr(117) + '\164' + chr(6428 - 6326) + '\x2d' + chr(0b10011 + 0o45)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\x0f\x8b\xb2\xbc\x06\xb0[\x0c\xdb@\x9ax\xbc^a'), chr(100) + '\145' + chr(99) + '\157' + '\x64' + chr(0b1010100 + 0o21))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(1753 - 1697))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\x01\x8d\xb2'), chr(100) + '\x65' + chr(0b1100011) + chr(111) + chr(0b1100100) + '\x65')('\165' + '\x74' + chr(0b1100110) + chr(0b11100 + 0o21) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xd1\x00\x9b\xb2\xa3\x0c\xb1'), '\x64' + chr(0b1100101) + chr(2154 - 2055) + chr(10936 - 10825) + chr(100) + chr(0b110010 + 0o63))(chr(12603 - 12486) + chr(3137 - 3021) + chr(102) + chr(0b101101) + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\x0f\x8b\xb2\xbc\x06\xb0K'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(0b11 + 0o141) + '\x65')('\x75' + '\164' + chr(0b1100010 + 0o4) + chr(1293 - 1248) + chr(914 - 858))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\x0f\x8b\xb2\xbc\x06\xb0[\x0c\xdb@\x9ax\xbc^a'), '\144' + chr(101) + chr(99) + chr(0b1101111) + chr(263 - 163) + chr(8918 - 8817))(chr(0b101 + 0o160) + '\x74' + chr(830 - 728) + chr(0b101101) + '\x38')),) if not bAgBF7jXI53B(SPnCNu54H1db): raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1\x00\x8f\xa2\xafI\xafG\x1c\xce\x0c\xb1s\xf8Wp\xa8\xd0<\xceq\x7f\xaf'), '\144' + chr(4465 - 4364) + '\143' + chr(0b111000 + 0o67) + '\144' + '\x65')(chr(117) + chr(11841 - 11725) + '\146' + '\x2d' + chr(0b101001 + 0o17))) if OywpAkUqi4xT(SPnCNu54H1db): if PlSM16l2KDPD(SPnCNu54H1db, (Ou_oEUbhlMXT, essMXh4s9f1w)): SPnCNu54H1db = SPnCNu54H1db._values mZZDAT49UzAb = YH_C7u76pUaX(SPnCNu54H1db.categories, dtype=SPnCNu54H1db.dtype) AoWJEgIAbHh_ = SPnCNu54H1db.codes else: re0VVGAVKu27 = XxOW0_jwnido(SPnCNu54H1db, ordered=ehT0Px3KOsy9(chr(0b110000) + chr(9902 - 9791) + '\x30', 8)) mZZDAT49UzAb = re0VVGAVKu27.categories AoWJEgIAbHh_ = re0VVGAVKu27.codes return (AoWJEgIAbHh_, mZZDAT49UzAb)
pandas-dev/pandas
pandas/core/arrays/categorical.py
_factorize_from_iterables
def _factorize_from_iterables(iterables): """ A higher-level wrapper over `_factorize_from_iterable`. *This is an internal function* Parameters ---------- iterables : list-like of list-likes Returns ------- codes_list : list of ndarrays categories_list : list of Indexes Notes ----- See `_factorize_from_iterable` for more info. """ if len(iterables) == 0: # For consistency, it should return a list of 2 lists. return [[], []] return map(list, lzip(*[_factorize_from_iterable(it) for it in iterables]))
python
def _factorize_from_iterables(iterables): """ A higher-level wrapper over `_factorize_from_iterable`. *This is an internal function* Parameters ---------- iterables : list-like of list-likes Returns ------- codes_list : list of ndarrays categories_list : list of Indexes Notes ----- See `_factorize_from_iterable` for more info. """ if len(iterables) == 0: # For consistency, it should return a list of 2 lists. return [[], []] return map(list, lzip(*[_factorize_from_iterable(it) for it in iterables]))
[ "def", "_factorize_from_iterables", "(", "iterables", ")", ":", "if", "len", "(", "iterables", ")", "==", "0", ":", "# For consistency, it should return a list of 2 lists.", "return", "[", "[", "]", ",", "[", "]", "]", "return", "map", "(", "list", ",", "lzip", "(", "*", "[", "_factorize_from_iterable", "(", "it", ")", "for", "it", "in", "iterables", "]", ")", ")" ]
A higher-level wrapper over `_factorize_from_iterable`. *This is an internal function* Parameters ---------- iterables : list-like of list-likes Returns ------- codes_list : list of ndarrays categories_list : list of Indexes Notes ----- See `_factorize_from_iterable` for more info.
[ "A", "higher", "-", "level", "wrapper", "over", "_factorize_from_iterable", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L2673-L2695
train
A higher - level wrapper over _factorize_from_iterable.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFAr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,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(9232 - 9121) + chr(0b0 + 0o65) + '\x37', 0b1000), ehT0Px3KOsy9(chr(1465 - 1417) + chr(0b1001001 + 0o46) + '\061' + '\067' + '\x36', 27178 - 27170), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(0b110111) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\x36' + chr(1509 - 1461), ord("\x08")), ehT0Px3KOsy9(chr(504 - 456) + chr(111) + chr(693 - 644) + chr(54) + chr(0b10100 + 0o40), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + '\062' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(0b110011) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(1963 - 1912) + '\067' + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(251 - 202) + chr(53) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(11786 - 11675) + chr(0b110010) + '\x35' + chr(0b110001), 65141 - 65133), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(1392 - 1339) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1115 - 1067) + chr(3639 - 3528) + '\061' + chr(0b110001) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(5120 - 5009) + chr(0b110011) + '\x30' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + '\x32' + chr(2703 - 2650) + chr(0b0 + 0o62), 49365 - 49357), ehT0Px3KOsy9(chr(0b110000) + chr(0b101001 + 0o106) + '\062' + chr(1209 - 1155) + chr(0b110001), 33622 - 33614), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + '\x33' + chr(2106 - 2054) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1347 - 1296) + '\x33' + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(55) + chr(0b100001 + 0o20), 0o10), ehT0Px3KOsy9(chr(1206 - 1158) + '\157' + chr(0b110001) + chr(0b11001 + 0o27), 46163 - 46155), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\067' + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\x32' + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(48) + '\x30', 52551 - 52543), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(0b110111) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(2213 - 2165) + chr(0b1101111) + chr(0b110011) + chr(2329 - 2279), 20391 - 20383), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(49) + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(968 - 918) + chr(0b10 + 0o63) + '\x33', 8), ehT0Px3KOsy9('\060' + chr(875 - 764) + '\x33' + chr(52) + chr(0b1011 + 0o51), 8), ehT0Px3KOsy9('\x30' + chr(0b1010111 + 0o30) + chr(0b1111 + 0o44) + chr(0b11011 + 0o30) + chr(54), 24155 - 24147), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + '\x34' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(53) + chr(53), 0b1000), ehT0Px3KOsy9(chr(1786 - 1738) + chr(0b1101111) + chr(0b11 + 0o56) + chr(0b110010) + '\066', 46210 - 46202), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b110010) + chr(0b100010 + 0o25), 6856 - 6848), ehT0Px3KOsy9('\x30' + chr(0b1001000 + 0o47) + '\063' + chr(0b101 + 0o53) + chr(1963 - 1915), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(0b110010) + '\061' + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(381 - 270) + chr(0b110001) + '\x35' + chr(0b110100 + 0o1), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4904 - 4793) + chr(54) + chr(1361 - 1311), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(12005 - 11894) + chr(52) + '\060', 36131 - 36123), ehT0Px3KOsy9('\060' + chr(0b110010 + 0o75) + chr(2042 - 1993) + chr(0b110010) + '\x30', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110101) + '\x30', 309 - 301)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x01'), chr(0b1000100 + 0o40) + '\145' + chr(0b110000 + 0o63) + chr(111) + chr(100) + chr(101))(chr(0b1110101) + chr(5463 - 5347) + chr(0b1100110) + chr(45) + chr(1198 - 1142)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def E2pgwRlvMYwD(Ymkm2d6mcyoO): if c2A0yzQpDQB3(Ymkm2d6mcyoO) == ehT0Px3KOsy9('\060' + '\x6f' + '\060', 8): return [[], []] return abA97kOQKaLo(YyaZ4tpXu4lf, d_hwvqxFHyy9(*[DLdThINXppxL(SdOiQfoVLiMl) for SdOiQfoVLiMl in Ymkm2d6mcyoO]))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.copy
def copy(self): """ Copy constructor. """ return self._constructor(values=self._codes.copy(), dtype=self.dtype, fastpath=True)
python
def copy(self): """ Copy constructor. """ return self._constructor(values=self._codes.copy(), dtype=self.dtype, fastpath=True)
[ "def", "copy", "(", "self", ")", ":", "return", "self", ".", "_constructor", "(", "values", "=", "self", ".", "_codes", ".", "copy", "(", ")", ",", "dtype", "=", "self", ".", "dtype", ",", "fastpath", "=", "True", ")" ]
Copy constructor.
[ "Copy", "constructor", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L455-L461
train
Copy the object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvs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Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(848 - 737) + chr(0b11010 + 0o30) + chr(1957 - 1908) + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(0b11110 + 0o121) + '\x31' + chr(0b110010) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1101111) + '\063' + chr(53) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(2495 - 2444) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(377 - 328) + chr(549 - 496) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11 + 0o57) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + '\x31' + '\062', 47838 - 47830), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + chr(55) + chr(1965 - 1915), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + chr(0b101 + 0o56) + chr(357 - 302) + chr(1088 - 1034), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11010 + 0o31) + chr(54) + chr(879 - 830), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1333 - 1282) + chr(0b10 + 0o56) + '\060', 0b1000), ehT0Px3KOsy9(chr(1898 - 1850) + chr(8772 - 8661) + '\x37' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010001 + 0o36) + chr(0b110010) + chr(0b110100) + chr(217 - 165), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(2711 - 2600) + '\x31' + chr(50) + chr(0b110001 + 0o6), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\066' + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + '\x33' + '\060', 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1100100 + 0o13) + chr(0b110001) + '\x33' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(677 - 629) + '\157' + '\063' + chr(1274 - 1224), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(0b110001) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(50 - 0), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(53) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + '\x31' + '\062', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + '\064' + chr(1951 - 1901), 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + chr(0b101001 + 0o10) + chr(0b111 + 0o54) + '\060', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1000 + 0o53) + chr(757 - 709) + '\060', 8), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100011 + 0o20) + chr(0b101110 + 0o10), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(0b11110 + 0o30) + chr(683 - 629), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\x33' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(1688 - 1637) + chr(217 - 162), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11388 - 11277) + chr(1799 - 1748) + chr(267 - 212) + chr(425 - 374), 0o10), ehT0Px3KOsy9(chr(1526 - 1478) + '\157' + '\061' + chr(0b110011) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(4993 - 4882) + chr(0b110001) + chr(2201 - 2148) + '\060', 8), ehT0Px3KOsy9(chr(954 - 906) + '\x6f' + chr(0b11010 + 0o30) + '\065' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(2151 - 2103) + chr(8874 - 8763) + '\063' + '\067' + chr(54), 8), ehT0Px3KOsy9(chr(1040 - 992) + chr(0b1101111) + chr(0b110010) + chr(1617 - 1569), 8), ehT0Px3KOsy9(chr(48) + chr(1966 - 1855) + chr(0b110001) + chr(0b110000) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b11011 + 0o124) + chr(0b110001) + '\065' + chr(2382 - 2330), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(817 - 763) + chr(50), 62995 - 62987), ehT0Px3KOsy9(chr(0b110000) + chr(11023 - 10912) + '\x32' + chr(51), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(1934 - 1823) + chr(0b11111 + 0o26) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3'), chr(6785 - 6685) + chr(0b101101 + 0o70) + chr(0b1100011) + chr(0b1001110 + 0o41) + chr(0b100010 + 0o102) + chr(8437 - 8336))(chr(0b1110101) + chr(116) + chr(0b10010 + 0o124) + '\055' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def igThHS4jwVsa(oVre8I6UXc3b): return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd21\x857\x1djb\x7fY\x8a\x9e\xb2'), chr(0b1111 + 0o125) + '\145' + chr(99) + '\x6f' + chr(3327 - 3227) + chr(101))(chr(117) + '\x74' + chr(3645 - 3543) + chr(0b101101) + chr(0b111000)))(values=xafqLlk3kkUe(oVre8I6UXc3b._codes, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe45\xbe1&M$`M\xa8\x82\xa1'), chr(921 - 821) + '\145' + chr(8217 - 8118) + chr(0b1101111) + '\x64' + chr(0b110010 + 0o63))('\x75' + chr(116) + chr(0b10100 + 0o122) + '\x2d' + '\x38'))(), dtype=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9&\x93)\x0b'), chr(6500 - 6400) + '\145' + '\x63' + chr(0b1101111) + '\144' + chr(0b1100101))(chr(6886 - 6769) + '\x74' + '\x66' + chr(0b100110 + 0o7) + '\x38')), fastpath=ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(0b11000 + 0o31), ord("\x08")))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.astype
def astype(self, dtype, copy=True): """ Coerce this type to another dtype Parameters ---------- dtype : numpy dtype or pandas type copy : bool, default True By default, astype always returns a newly allocated object. If copy is set to False and dtype is categorical, the original object is returned. .. versionadded:: 0.19.0 """ if is_categorical_dtype(dtype): # GH 10696/18593 dtype = self.dtype.update_dtype(dtype) self = self.copy() if copy else self if dtype == self.dtype: return self return self._set_dtype(dtype) return np.array(self, dtype=dtype, copy=copy)
python
def astype(self, dtype, copy=True): """ Coerce this type to another dtype Parameters ---------- dtype : numpy dtype or pandas type copy : bool, default True By default, astype always returns a newly allocated object. If copy is set to False and dtype is categorical, the original object is returned. .. versionadded:: 0.19.0 """ if is_categorical_dtype(dtype): # GH 10696/18593 dtype = self.dtype.update_dtype(dtype) self = self.copy() if copy else self if dtype == self.dtype: return self return self._set_dtype(dtype) return np.array(self, dtype=dtype, copy=copy)
[ "def", "astype", "(", "self", ",", "dtype", ",", "copy", "=", "True", ")", ":", "if", "is_categorical_dtype", "(", "dtype", ")", ":", "# GH 10696/18593", "dtype", "=", "self", ".", "dtype", ".", "update_dtype", "(", "dtype", ")", "self", "=", "self", ".", "copy", "(", ")", "if", "copy", "else", "self", "if", "dtype", "==", "self", ".", "dtype", ":", "return", "self", "return", "self", ".", "_set_dtype", "(", "dtype", ")", "return", "np", ".", "array", "(", "self", ",", "dtype", "=", "dtype", ",", "copy", "=", "copy", ")" ]
Coerce this type to another dtype Parameters ---------- dtype : numpy dtype or pandas type copy : bool, default True By default, astype always returns a newly allocated object. If copy is set to False and dtype is categorical, the original object is returned. .. versionadded:: 0.19.0
[ "Coerce", "this", "type", "to", "another", "dtype" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L463-L485
train
Coerce this type to another dtype.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmd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rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + chr(633 - 585), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(312 - 264) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(1489 - 1434) + '\062', 35892 - 35884), ehT0Px3KOsy9(chr(248 - 200) + chr(0b1010111 + 0o30) + '\066' + '\063', 4968 - 4960), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(0b100011 + 0o20) + chr(54), 0b1000), ehT0Px3KOsy9(chr(1521 - 1473) + chr(0b1101111) + '\063' + chr(1486 - 1438) + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(3640 - 3529) + chr(0b10111 + 0o33) + '\x37' + '\062', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + '\060' + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1327 - 1277) + chr(49) + chr(0b10000 + 0o43), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + chr(49) + '\063' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(1916 - 1866) + chr(2281 - 2230) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + '\064' + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(7105 - 6994) + chr(2194 - 2144) + chr(1375 - 1324), 44801 - 44793), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b1101 + 0o45) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(0b110000 + 0o4) + chr(53), 58835 - 58827), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(3070 - 2959) + chr(0b110101) + chr(647 - 596), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2869 - 2758) + '\x33' + chr(0b110010) + chr(0b100 + 0o54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110111), 46882 - 46874), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(48) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\061' + '\x35' + '\x36', 41536 - 41528), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(0b11010 + 0o26) + '\x30', 8), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(50) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(50) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\063' + chr(2382 - 2330), 0b1000), ehT0Px3KOsy9('\060' + chr(3930 - 3819) + chr(51) + chr(1509 - 1460) + chr(0b100010 + 0o16), 0b1000), ehT0Px3KOsy9(chr(137 - 89) + chr(9983 - 9872) + chr(917 - 868) + '\063' + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + '\066' + chr(0b110000 + 0o7), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11100 + 0o27) + chr(53) + '\x30', 4889 - 4881), ehT0Px3KOsy9('\x30' + chr(0b100001 + 0o116) + chr(1863 - 1812) + chr(48) + chr(2139 - 2089), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(48) + '\062', 0o10), ehT0Px3KOsy9(chr(734 - 686) + chr(0b0 + 0o157) + '\061' + chr(0b110000) + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b100100 + 0o20) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(7786 - 7675) + chr(0b110001) + chr(262 - 212) + chr(0b110111), 12060 - 12052), ehT0Px3KOsy9('\x30' + chr(136 - 25) + '\061' + '\065' + '\066', 8), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + chr(0b110100) + chr(0b11110 + 0o26), 29592 - 29584), ehT0Px3KOsy9('\x30' + chr(11542 - 11431) + chr(51) + '\x33' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100000 + 0o117) + '\062' + chr(0b110100) + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + chr(0b101101 + 0o6), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\x34' + chr(50), 8), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(1033 - 983) + '\067' + chr(0b10111 + 0o31), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11 + 0o62) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'.'), chr(0b1100100) + chr(0b1010001 + 0o24) + '\x63' + chr(111) + '\144' + chr(0b1010 + 0o133))('\165' + '\x74' + chr(0b1011111 + 0o7) + chr(45) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def XF6WakKHWOo5(oVre8I6UXc3b, jSV9IKnemH7K, igThHS4jwVsa=ehT0Px3KOsy9(chr(0b110000) + chr(7331 - 7220) + chr(0b110000 + 0o1), 11839 - 11831)): if P9dMe_tcBUdc(jSV9IKnemH7K): jSV9IKnemH7K = oVre8I6UXc3b.dtype.update_dtype(jSV9IKnemH7K) oVre8I6UXc3b = oVre8I6UXc3b.igThHS4jwVsa() if igThHS4jwVsa else oVre8I6UXc3b if jSV9IKnemH7K == xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'd\xb4\xc3C\xfb'), '\144' + chr(101) + chr(0b1100011) + '\x6f' + chr(0b101011 + 0o71) + chr(0b1100101))(chr(117) + chr(5315 - 5199) + '\x66' + chr(0b10100 + 0o31) + '\070')): return oVre8I6UXc3b return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'_\xb3\xdfG\xc1\xa5\xce\xba\xfb<'), chr(100) + chr(101) + chr(99) + chr(6266 - 6155) + chr(0b1100100) + chr(3848 - 3747))('\165' + chr(0b111010 + 0o72) + '\146' + '\055' + chr(0b111000)))(jSV9IKnemH7K) return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'a\xb2\xc8R\xe7'), '\x64' + '\x65' + '\143' + '\157' + chr(100) + chr(101))(chr(4309 - 4192) + chr(0b1000110 + 0o56) + chr(102) + chr(1842 - 1797) + '\070'))(oVre8I6UXc3b, dtype=jSV9IKnemH7K, copy=igThHS4jwVsa)
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical._from_inferred_categories
def _from_inferred_categories(cls, inferred_categories, inferred_codes, dtype, true_values=None): """ Construct a Categorical from inferred values. For inferred categories (`dtype` is None) the categories are sorted. For explicit `dtype`, the `inferred_categories` are cast to the appropriate type. Parameters ---------- inferred_categories : Index inferred_codes : Index dtype : CategoricalDtype or 'category' true_values : list, optional If none are provided, the default ones are "True", "TRUE", and "true." Returns ------- Categorical """ from pandas import Index, to_numeric, to_datetime, to_timedelta cats = Index(inferred_categories) known_categories = (isinstance(dtype, CategoricalDtype) and dtype.categories is not None) if known_categories: # Convert to a specialized type with `dtype` if specified. if dtype.categories.is_numeric(): cats = to_numeric(inferred_categories, errors="coerce") elif is_datetime64_dtype(dtype.categories): cats = to_datetime(inferred_categories, errors="coerce") elif is_timedelta64_dtype(dtype.categories): cats = to_timedelta(inferred_categories, errors="coerce") elif dtype.categories.is_boolean(): if true_values is None: true_values = ["True", "TRUE", "true"] cats = cats.isin(true_values) if known_categories: # Recode from observation order to dtype.categories order. categories = dtype.categories codes = _recode_for_categories(inferred_codes, cats, categories) elif not cats.is_monotonic_increasing: # Sort categories and recode for unknown categories. unsorted = cats.copy() categories = cats.sort_values() codes = _recode_for_categories(inferred_codes, unsorted, categories) dtype = CategoricalDtype(categories, ordered=False) else: dtype = CategoricalDtype(cats, ordered=False) codes = inferred_codes return cls(codes, dtype=dtype, fastpath=True)
python
def _from_inferred_categories(cls, inferred_categories, inferred_codes, dtype, true_values=None): """ Construct a Categorical from inferred values. For inferred categories (`dtype` is None) the categories are sorted. For explicit `dtype`, the `inferred_categories` are cast to the appropriate type. Parameters ---------- inferred_categories : Index inferred_codes : Index dtype : CategoricalDtype or 'category' true_values : list, optional If none are provided, the default ones are "True", "TRUE", and "true." Returns ------- Categorical """ from pandas import Index, to_numeric, to_datetime, to_timedelta cats = Index(inferred_categories) known_categories = (isinstance(dtype, CategoricalDtype) and dtype.categories is not None) if known_categories: # Convert to a specialized type with `dtype` if specified. if dtype.categories.is_numeric(): cats = to_numeric(inferred_categories, errors="coerce") elif is_datetime64_dtype(dtype.categories): cats = to_datetime(inferred_categories, errors="coerce") elif is_timedelta64_dtype(dtype.categories): cats = to_timedelta(inferred_categories, errors="coerce") elif dtype.categories.is_boolean(): if true_values is None: true_values = ["True", "TRUE", "true"] cats = cats.isin(true_values) if known_categories: # Recode from observation order to dtype.categories order. categories = dtype.categories codes = _recode_for_categories(inferred_codes, cats, categories) elif not cats.is_monotonic_increasing: # Sort categories and recode for unknown categories. unsorted = cats.copy() categories = cats.sort_values() codes = _recode_for_categories(inferred_codes, unsorted, categories) dtype = CategoricalDtype(categories, ordered=False) else: dtype = CategoricalDtype(cats, ordered=False) codes = inferred_codes return cls(codes, dtype=dtype, fastpath=True)
[ "def", "_from_inferred_categories", "(", "cls", ",", "inferred_categories", ",", "inferred_codes", ",", "dtype", ",", "true_values", "=", "None", ")", ":", "from", "pandas", "import", "Index", ",", "to_numeric", ",", "to_datetime", ",", "to_timedelta", "cats", "=", "Index", "(", "inferred_categories", ")", "known_categories", "=", "(", "isinstance", "(", "dtype", ",", "CategoricalDtype", ")", "and", "dtype", ".", "categories", "is", "not", "None", ")", "if", "known_categories", ":", "# Convert to a specialized type with `dtype` if specified.", "if", "dtype", ".", "categories", ".", "is_numeric", "(", ")", ":", "cats", "=", "to_numeric", "(", "inferred_categories", ",", "errors", "=", "\"coerce\"", ")", "elif", "is_datetime64_dtype", "(", "dtype", ".", "categories", ")", ":", "cats", "=", "to_datetime", "(", "inferred_categories", ",", "errors", "=", "\"coerce\"", ")", "elif", "is_timedelta64_dtype", "(", "dtype", ".", "categories", ")", ":", "cats", "=", "to_timedelta", "(", "inferred_categories", ",", "errors", "=", "\"coerce\"", ")", "elif", "dtype", ".", "categories", ".", "is_boolean", "(", ")", ":", "if", "true_values", "is", "None", ":", "true_values", "=", "[", "\"True\"", ",", "\"TRUE\"", ",", "\"true\"", "]", "cats", "=", "cats", ".", "isin", "(", "true_values", ")", "if", "known_categories", ":", "# Recode from observation order to dtype.categories order.", "categories", "=", "dtype", ".", "categories", "codes", "=", "_recode_for_categories", "(", "inferred_codes", ",", "cats", ",", "categories", ")", "elif", "not", "cats", ".", "is_monotonic_increasing", ":", "# Sort categories and recode for unknown categories.", "unsorted", "=", "cats", ".", "copy", "(", ")", "categories", "=", "cats", ".", "sort_values", "(", ")", "codes", "=", "_recode_for_categories", "(", "inferred_codes", ",", "unsorted", ",", "categories", ")", "dtype", "=", "CategoricalDtype", "(", "categories", ",", "ordered", "=", "False", ")", "else", ":", "dtype", "=", "CategoricalDtype", "(", "cats", ",", "ordered", "=", "False", ")", "codes", "=", "inferred_codes", "return", "cls", "(", "codes", ",", "dtype", "=", "dtype", ",", "fastpath", "=", "True", ")" ]
Construct a Categorical from inferred values. For inferred categories (`dtype` is None) the categories are sorted. For explicit `dtype`, the `inferred_categories` are cast to the appropriate type. Parameters ---------- inferred_categories : Index inferred_codes : Index dtype : CategoricalDtype or 'category' true_values : list, optional If none are provided, the default ones are "True", "TRUE", and "true." Returns ------- Categorical
[ "Construct", "a", "Categorical", "from", "inferred", "values", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L528-L586
train
Construct a Categorical from inferred values.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G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ZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1900 - 1852) + chr(111) + chr(0b101010 + 0o10) + '\x35' + '\x32', 55123 - 55115), ehT0Px3KOsy9('\060' + chr(5599 - 5488) + chr(0b1110 + 0o44) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010011 + 0o34) + '\x33' + '\x31' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100111 + 0o110) + chr(0b110011) + chr(0b100011 + 0o23) + '\x36', 0o10), ehT0Px3KOsy9(chr(1994 - 1946) + '\157' + '\061' + chr(0b1011 + 0o46) + '\067', 0o10), ehT0Px3KOsy9(chr(2275 - 2227) + chr(111) + '\x32' + '\066' + chr(714 - 666), 56336 - 56328), ehT0Px3KOsy9('\x30' + chr(0b1010011 + 0o34) + '\x32' + chr(1939 - 1884) + chr(338 - 284), 11380 - 11372), ehT0Px3KOsy9(chr(48) + chr(0b101000 + 0o107) + '\061' + chr(542 - 489) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(7080 - 6969) + chr(2591 - 2537) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(54) + chr(0b100100 + 0o22), 0o10), ehT0Px3KOsy9(chr(818 - 770) + '\x6f' + chr(0b100110 + 0o20) + chr(0b100000 + 0o24), 8), ehT0Px3KOsy9(chr(1388 - 1340) + '\157' + chr(0b110010) + chr(0b110001) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(981 - 933) + chr(0b101110 + 0o101) + '\062' + '\060' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3445 - 3334) + chr(0b110010) + chr(48) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(2456 - 2402) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(863 - 815) + '\x6f' + chr(2350 - 2299) + chr(710 - 658) + '\x37', 0o10), ehT0Px3KOsy9(chr(930 - 882) + chr(111) + '\062' + chr(1221 - 1171) + '\x37', 39999 - 39991), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(0b110011) + chr(50) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(538 - 490) + chr(0b1100101 + 0o12) + chr(0b1000 + 0o51) + '\062' + '\x30', 38751 - 38743), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(12034 - 11923) + '\062' + chr(52) + chr(2209 - 2158), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + '\x32', 34171 - 34163), ehT0Px3KOsy9(chr(857 - 809) + chr(148 - 37) + chr(50) + '\x32' + chr(0b11010 + 0o34), 20059 - 20051), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + chr(49) + '\065' + chr(0b110100), 24338 - 24330), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b100101 + 0o17) + '\x35', 42135 - 42127), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b0 + 0o63) + chr(665 - 614) + chr(0b11001 + 0o36), ord("\x08")), ehT0Px3KOsy9('\060' + chr(10385 - 10274) + '\x31' + '\x33' + chr(824 - 774), 0b1000), ehT0Px3KOsy9('\060' + chr(11283 - 11172) + '\062' + chr(55) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(51) + chr(2915 - 2860), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b111 + 0o57) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\063' + chr(0b101110 + 0o2), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + '\x34' + '\x30', 4301 - 4293), ehT0Px3KOsy9('\060' + '\x6f' + '\x31', 45986 - 45978), ehT0Px3KOsy9(chr(1111 - 1063) + '\157' + chr(0b110001) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + '\x32' + chr(175 - 125) + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(0b1001 + 0o50) + chr(53) + '\x36', 8), ehT0Px3KOsy9(chr(48) + chr(6237 - 6126) + chr(49) + '\x34' + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1001101 + 0o42) + chr(0b110010) + chr(0b110101) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + '\x32' + '\x37' + chr(0b1101 + 0o45), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9129 - 9018) + chr(53) + '\061', 0o10), ehT0Px3KOsy9(chr(491 - 443) + chr(111) + chr(0b10100 + 0o37) + chr(0b11100 + 0o24) + '\x33', 28202 - 28194)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1000001 + 0o56) + chr(0b100110 + 0o17) + chr(1571 - 1523), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x84'), chr(0b1011001 + 0o13) + '\145' + '\x63' + '\157' + chr(100) + chr(4134 - 4033))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ydSewXnOdd9k(NSstowUUZlxS, kSTOB7MpzlDk, aKSlaOrC7I1g, jSV9IKnemH7K, t6baE7EFJavV=None): (EJkE1Nx1bysb, D3UiWg6YVSO0, IF08dLE993_s, o52vswvoQUMc) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdaw\xa2\x92.\xc3'), chr(0b1000 + 0o134) + '\x65' + chr(99) + chr(0b1101111) + '\144' + chr(10040 - 9939))(chr(0b1110101) + chr(2303 - 2187) + '\146' + chr(1045 - 1000) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3x\xa8\x937'), chr(0b110101 + 0o57) + chr(101) + chr(0b111110 + 0o45) + chr(0b1011100 + 0o23) + '\x64' + chr(5865 - 5764))(chr(0b1110101) + '\164' + '\x66' + '\x2d' + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3x\xa8\x937'), chr(0b1010111 + 0o15) + chr(101) + chr(0b110011 + 0o60) + chr(111) + chr(0b1011001 + 0o13) + '\x65')('\x75' + '\x74' + chr(0b1100110) + '\055' + chr(0b111000))), xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdaw\xa2\x92.\xc3'), chr(100) + chr(0b1110 + 0o127) + chr(0b1100011) + chr(111) + '\x64' + '\x65')(chr(117) + '\164' + chr(0b1100110) + chr(45) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdey\x93\x98:\xdd\xdb\x1c]\xd5'), '\x64' + '\145' + chr(0b1 + 0o142) + '\x6f' + '\x64' + chr(0b100011 + 0o102))(chr(0b1110101) + '\x74' + chr(1192 - 1090) + '\x2d' + chr(0b110 + 0o62))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdey\x93\x98:\xdd\xdb\x1c]\xd5'), chr(2522 - 2422) + '\145' + chr(0b1100011) + chr(5311 - 5200) + '\x64' + chr(9304 - 9203))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b111000))), xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdaw\xa2\x92.\xc3'), '\144' + chr(0b1100101) + chr(0b100 + 0o137) + chr(0b10111 + 0o130) + chr(100) + chr(0b1100101))(chr(117) + chr(0b1001000 + 0o54) + '\146' + chr(0b10101 + 0o30) + chr(282 - 226)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdey\x93\x92.\xc4\xdb\x1a]\xdbQ'), chr(100) + chr(0b1100101) + chr(1102 - 1003) + '\157' + '\144' + chr(0b1100101))('\x75' + '\x74' + chr(0b1000001 + 0o45) + chr(0b101101) + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdey\x93\x92.\xc4\xdb\x1a]\xdbQ'), '\x64' + '\145' + chr(99) + '\157' + '\144' + chr(0b1100101))('\x75' + chr(0b1110100) + '\146' + chr(0b101101) + '\070')), xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdaw\xa2\x92.\xc3'), chr(0b1100100) + chr(0b1 + 0o144) + chr(0b1100011) + chr(0b1101111) + chr(0b1000011 + 0o41) + chr(1096 - 995))(chr(5007 - 4890) + chr(0b1011000 + 0o34) + chr(0b1100110) + '\x2d' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdey\x93\x82&\xdd\xdb\nQ\xda@\xea'), '\144' + chr(101) + chr(0b1100011) + chr(0b1101111) + '\x64' + '\145')('\x75' + chr(1281 - 1165) + chr(0b1100110) + chr(45) + '\x38')), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdey\x93\x82&\xdd\xdb\nQ\xda@\xea'), '\x64' + chr(0b1001001 + 0o34) + chr(0b1100011) + chr(111) + '\x64' + chr(296 - 195))('\x75' + chr(116) + '\x66' + '\x2d' + chr(0b1001 + 0o57)))) _IZEDmb5AMbL = EJkE1Nx1bysb(kSTOB7MpzlDk) fsMVcjitw7pK = PlSM16l2KDPD(jSV9IKnemH7K, CBSVoRj_kvTn) and jSV9IKnemH7K.categories is not None if fsMVcjitw7pK: if xafqLlk3kkUe(jSV9IKnemH7K.categories, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3e\x93\x98:\xdd\xdb\x1c]\xd5'), chr(100) + chr(5517 - 5416) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(6525 - 6408) + '\164' + chr(0b1100110) + chr(0b10000 + 0o35) + '\x38'))(): _IZEDmb5AMbL = D3UiWg6YVSO0(kSTOB7MpzlDk, errors=xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9y\xa9\x84,\xd5'), chr(0b1100100) + '\145' + chr(9593 - 9494) + '\x6f' + chr(6878 - 6778) + chr(0b1100101))(chr(11164 - 11047) + '\164' + chr(0b1001001 + 0o35) + chr(185 - 140) + chr(56))) elif o97MkxKQGNoK(xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9w\xb8\x93(\xdf\xcc\x07Q\xc5'), chr(0b1100100) + chr(1175 - 1074) + chr(0b1011000 + 0o13) + chr(111) + chr(0b1100100) + '\145')(chr(0b1011101 + 0o30) + '\x74' + chr(102) + chr(0b100100 + 0o11) + '\x38'))): _IZEDmb5AMbL = IF08dLE993_s(kSTOB7MpzlDk, errors=xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9y\xa9\x84,\xd5'), chr(0b11110 + 0o106) + '\145' + chr(99) + chr(0b1101111) + chr(2651 - 2551) + chr(101))(chr(0b1101110 + 0o7) + chr(0b1110100) + chr(0b11001 + 0o115) + chr(0b100110 + 0o7) + chr(0b0 + 0o70))) elif n1ufouZS6xrY(xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9w\xb8\x93(\xdf\xcc\x07Q\xc5'), chr(0b1100100) + chr(101) + chr(0b1010 + 0o131) + '\x6f' + '\x64' + '\x65')('\x75' + '\164' + chr(102) + chr(1296 - 1251) + '\x38'))): _IZEDmb5AMbL = o52vswvoQUMc(kSTOB7MpzlDk, errors=xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9y\xa9\x84,\xd5'), '\144' + '\x65' + chr(0b1010111 + 0o14) + '\x6f' + chr(0b1001100 + 0o30) + chr(0b111110 + 0o47))('\165' + chr(0b1110100) + chr(0b111010 + 0o54) + '\055' + chr(56))) elif xafqLlk3kkUe(jSV9IKnemH7K.categories, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3e\x93\x94 \xdf\xd2\x0bU\xd8'), chr(0b100111 + 0o75) + chr(0b10101 + 0o120) + chr(9005 - 8906) + chr(111) + '\x64' + chr(101))(chr(0b1110101) + chr(13134 - 13018) + '\146' + '\055' + '\x38'))(): if t6baE7EFJavV is None: t6baE7EFJavV = [xafqLlk3kkUe(SXOLrMavuUCe(b'\xfed\xb9\x93'), chr(0b111010 + 0o52) + chr(0b1100101) + '\x63' + chr(1779 - 1668) + chr(0b1010101 + 0o17) + '\145')('\165' + chr(0b1100010 + 0o22) + chr(102) + chr(0b101101) + chr(0b100001 + 0o27)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfeD\x99\xb3'), chr(1531 - 1431) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(2039 - 1938))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xded\xb9\x93'), chr(0b1100100) + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + chr(1208 - 1107))('\165' + '\164' + chr(102) + '\x2d' + '\070')] _IZEDmb5AMbL = _IZEDmb5AMbL.isin(t6baE7EFJavV) if fsMVcjitw7pK: mZZDAT49UzAb = jSV9IKnemH7K.categories AoWJEgIAbHh_ = V3m1SlhRYSW0(aKSlaOrC7I1g, _IZEDmb5AMbL, mZZDAT49UzAb) elif not xafqLlk3kkUe(_IZEDmb5AMbL, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3e\x93\x9b \xde\xd1\x1a[\xd8]\xe8\xd9\xeb\x1d\x84\xe5\xb21\xd0s\xf8\x0b'), '\x64' + '\145' + chr(0b1100011) + chr(0b100011 + 0o114) + chr(100) + chr(0b110100 + 0o61))('\165' + '\164' + chr(0b111101 + 0o51) + '\x2d' + chr(56))): pdUUd5kyzN3b = _IZEDmb5AMbL.igThHS4jwVsa() mZZDAT49UzAb = _IZEDmb5AMbL.sort_values() AoWJEgIAbHh_ = V3m1SlhRYSW0(aKSlaOrC7I1g, pdUUd5kyzN3b, mZZDAT49UzAb) jSV9IKnemH7K = CBSVoRj_kvTn(mZZDAT49UzAb, ordered=ehT0Px3KOsy9('\060' + chr(1305 - 1194) + chr(48), ord("\x08"))) else: jSV9IKnemH7K = CBSVoRj_kvTn(_IZEDmb5AMbL, ordered=ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1001 + 0o47), 8)) AoWJEgIAbHh_ = aKSlaOrC7I1g return NSstowUUZlxS(AoWJEgIAbHh_, dtype=jSV9IKnemH7K, fastpath=ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001), 8))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.from_codes
def from_codes(cls, codes, categories=None, ordered=None, dtype=None): """ Make a Categorical type from codes and categories or dtype. This constructor is useful if you already have codes and categories/dtype and so do not need the (computation intensive) factorization step, which is usually done on the constructor. If your data does not follow this convention, please use the normal constructor. Parameters ---------- codes : array-like, integers An integer array, where each integer points to a category in categories or dtype.categories, or else is -1 for NaN. categories : index-like, optional The categories for the categorical. Items need to be unique. If the categories are not given here, then they must be provided in `dtype`. ordered : bool, optional Whether or not this categorical is treated as an ordered categorical. If not given here or in `dtype`, the resulting categorical will be unordered. dtype : CategoricalDtype or the string "category", optional If :class:`CategoricalDtype`, cannot be used together with `categories` or `ordered`. .. versionadded:: 0.24.0 When `dtype` is provided, neither `categories` nor `ordered` should be provided. Examples -------- >>> dtype = pd.CategoricalDtype(['a', 'b'], ordered=True) >>> pd.Categorical.from_codes(codes=[0, 1, 0, 1], dtype=dtype) [a, b, a, b] Categories (2, object): [a < b] """ dtype = CategoricalDtype._from_values_or_dtype(categories=categories, ordered=ordered, dtype=dtype) if dtype.categories is None: msg = ("The categories must be provided in 'categories' or " "'dtype'. Both were None.") raise ValueError(msg) codes = np.asarray(codes) # #21767 if not is_integer_dtype(codes): msg = "codes need to be array-like integers" if is_float_dtype(codes): icodes = codes.astype('i8') if (icodes == codes).all(): msg = None codes = icodes warn(("float codes will be disallowed in the future and " "raise a ValueError"), FutureWarning, stacklevel=2) if msg: raise ValueError(msg) if len(codes) and ( codes.max() >= len(dtype.categories) or codes.min() < -1): raise ValueError("codes need to be between -1 and " "len(categories)-1") return cls(codes, dtype=dtype, fastpath=True)
python
def from_codes(cls, codes, categories=None, ordered=None, dtype=None): """ Make a Categorical type from codes and categories or dtype. This constructor is useful if you already have codes and categories/dtype and so do not need the (computation intensive) factorization step, which is usually done on the constructor. If your data does not follow this convention, please use the normal constructor. Parameters ---------- codes : array-like, integers An integer array, where each integer points to a category in categories or dtype.categories, or else is -1 for NaN. categories : index-like, optional The categories for the categorical. Items need to be unique. If the categories are not given here, then they must be provided in `dtype`. ordered : bool, optional Whether or not this categorical is treated as an ordered categorical. If not given here or in `dtype`, the resulting categorical will be unordered. dtype : CategoricalDtype or the string "category", optional If :class:`CategoricalDtype`, cannot be used together with `categories` or `ordered`. .. versionadded:: 0.24.0 When `dtype` is provided, neither `categories` nor `ordered` should be provided. Examples -------- >>> dtype = pd.CategoricalDtype(['a', 'b'], ordered=True) >>> pd.Categorical.from_codes(codes=[0, 1, 0, 1], dtype=dtype) [a, b, a, b] Categories (2, object): [a < b] """ dtype = CategoricalDtype._from_values_or_dtype(categories=categories, ordered=ordered, dtype=dtype) if dtype.categories is None: msg = ("The categories must be provided in 'categories' or " "'dtype'. Both were None.") raise ValueError(msg) codes = np.asarray(codes) # #21767 if not is_integer_dtype(codes): msg = "codes need to be array-like integers" if is_float_dtype(codes): icodes = codes.astype('i8') if (icodes == codes).all(): msg = None codes = icodes warn(("float codes will be disallowed in the future and " "raise a ValueError"), FutureWarning, stacklevel=2) if msg: raise ValueError(msg) if len(codes) and ( codes.max() >= len(dtype.categories) or codes.min() < -1): raise ValueError("codes need to be between -1 and " "len(categories)-1") return cls(codes, dtype=dtype, fastpath=True)
[ "def", "from_codes", "(", "cls", ",", "codes", ",", "categories", "=", "None", ",", "ordered", "=", "None", ",", "dtype", "=", "None", ")", ":", "dtype", "=", "CategoricalDtype", ".", "_from_values_or_dtype", "(", "categories", "=", "categories", ",", "ordered", "=", "ordered", ",", "dtype", "=", "dtype", ")", "if", "dtype", ".", "categories", "is", "None", ":", "msg", "=", "(", "\"The categories must be provided in 'categories' or \"", "\"'dtype'. Both were None.\"", ")", "raise", "ValueError", "(", "msg", ")", "codes", "=", "np", ".", "asarray", "(", "codes", ")", "# #21767", "if", "not", "is_integer_dtype", "(", "codes", ")", ":", "msg", "=", "\"codes need to be array-like integers\"", "if", "is_float_dtype", "(", "codes", ")", ":", "icodes", "=", "codes", ".", "astype", "(", "'i8'", ")", "if", "(", "icodes", "==", "codes", ")", ".", "all", "(", ")", ":", "msg", "=", "None", "codes", "=", "icodes", "warn", "(", "(", "\"float codes will be disallowed in the future and \"", "\"raise a ValueError\"", ")", ",", "FutureWarning", ",", "stacklevel", "=", "2", ")", "if", "msg", ":", "raise", "ValueError", "(", "msg", ")", "if", "len", "(", "codes", ")", "and", "(", "codes", ".", "max", "(", ")", ">=", "len", "(", "dtype", ".", "categories", ")", "or", "codes", ".", "min", "(", ")", "<", "-", "1", ")", ":", "raise", "ValueError", "(", "\"codes need to be between -1 and \"", "\"len(categories)-1\"", ")", "return", "cls", "(", "codes", ",", "dtype", "=", "dtype", ",", "fastpath", "=", "True", ")" ]
Make a Categorical type from codes and categories or dtype. This constructor is useful if you already have codes and categories/dtype and so do not need the (computation intensive) factorization step, which is usually done on the constructor. If your data does not follow this convention, please use the normal constructor. Parameters ---------- codes : array-like, integers An integer array, where each integer points to a category in categories or dtype.categories, or else is -1 for NaN. categories : index-like, optional The categories for the categorical. Items need to be unique. If the categories are not given here, then they must be provided in `dtype`. ordered : bool, optional Whether or not this categorical is treated as an ordered categorical. If not given here or in `dtype`, the resulting categorical will be unordered. dtype : CategoricalDtype or the string "category", optional If :class:`CategoricalDtype`, cannot be used together with `categories` or `ordered`. .. versionadded:: 0.24.0 When `dtype` is provided, neither `categories` nor `ordered` should be provided. Examples -------- >>> dtype = pd.CategoricalDtype(['a', 'b'], ordered=True) >>> pd.Categorical.from_codes(codes=[0, 1, 0, 1], dtype=dtype) [a, b, a, b] Categories (2, object): [a < b]
[ "Make", "a", "Categorical", "type", "from", "codes", "and", "categories", "or", "dtype", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L589-L655
train
Create a new instance of the class with the given codes and categories and dtype.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,y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ytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1101111) + chr(2201 - 2152) + chr(53) + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(0b10110 + 0o131) + chr(0b110011) + chr(0b110000) + '\x31', 0b1000), ehT0Px3KOsy9(chr(85 - 37) + '\157' + chr(0b110010) + chr(54) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(3171 - 3060) + '\x33' + chr(0b101010 + 0o11) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x35' + chr(72 - 23), 0o10), ehT0Px3KOsy9('\x30' + chr(5124 - 5013) + chr(0b11011 + 0o27) + chr(0b110000) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9764 - 9653) + chr(51) + chr(1500 - 1448) + chr(0b1110 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1401 - 1352) + chr(1588 - 1540) + chr(663 - 608), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + '\x31' + chr(0b110111) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(7402 - 7291) + chr(2480 - 2425), 0b1000), ehT0Px3KOsy9(chr(1853 - 1805) + chr(5745 - 5634) + '\x33' + '\065', 12427 - 12419), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + chr(51) + chr(0b110110) + chr(288 - 233), ord("\x08")), ehT0Px3KOsy9(chr(212 - 164) + chr(111) + chr(50) + chr(673 - 622) + chr(0b10010 + 0o36), 60784 - 60776), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(3053 - 2942) + chr(50) + chr(0b100 + 0o61) + '\064', 63060 - 63052), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(983 - 933) + chr(64 - 13) + chr(0b11010 + 0o30), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + chr(0b101000 + 0o11) + chr(1253 - 1202) + chr(0b1011 + 0o54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\x31' + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(0b101100 + 0o103) + chr(0b10001 + 0o42) + '\066' + chr(414 - 363), 34631 - 34623), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + '\x31' + chr(1260 - 1211) + chr(49), 0b1000), ehT0Px3KOsy9(chr(1443 - 1395) + '\x6f' + chr(0b110011) + chr(0b110100) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110101 + 0o72) + chr(1675 - 1620) + chr(1090 - 1042), 2207 - 2199), ehT0Px3KOsy9('\060' + chr(0b100 + 0o153) + '\062' + '\062' + chr(0b11110 + 0o30), ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + chr(0b110010) + '\062' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + chr(237 - 188) + chr(0b110100), 24406 - 24398), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110101) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\061' + chr(0b110100), 37293 - 37285), ehT0Px3KOsy9(chr(484 - 436) + chr(0b1101111) + chr(50 - 1) + '\067' + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101010 + 0o5) + chr(49) + chr(872 - 817) + '\x35', 33807 - 33799), ehT0Px3KOsy9(chr(48) + '\157' + '\061', 44982 - 44974), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b110100) + chr(0b110100 + 0o2), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111 + 0o0) + chr(1797 - 1745) + chr(50), 20231 - 20223), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(53) + chr(0b10 + 0o62), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + '\061' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(111) + chr(0b110110) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\065' + '\x34', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(1503 - 1452) + chr(0b1100 + 0o52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(0b10 + 0o61) + chr(0b11001 + 0o33), 0o10), ehT0Px3KOsy9('\060' + chr(0b10010 + 0o135) + chr(0b110001) + chr(1767 - 1715) + chr(947 - 895), 53989 - 53981), ehT0Px3KOsy9(chr(797 - 749) + chr(1621 - 1510) + chr(51) + '\066', 48196 - 48188), ehT0Px3KOsy9(chr(0b110000) + chr(0b110001 + 0o76) + chr(0b110010) + chr(1321 - 1273) + chr(0b110010), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110101) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'D'), chr(0b1100100) + chr(0b1100101) + '\143' + '\x6f' + chr(9346 - 9246) + '\145')(chr(4744 - 4627) + chr(0b1100011 + 0o21) + chr(102) + chr(0b100 + 0o51) + chr(1819 - 1763)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def AEefMUpzcPbT(NSstowUUZlxS, AoWJEgIAbHh_, mZZDAT49UzAb=None, TillFngeGqII=None, jSV9IKnemH7K=None): jSV9IKnemH7K = CBSVoRj_kvTn._from_values_or_dtype(categories=mZZDAT49UzAb, ordered=TillFngeGqII, dtype=jSV9IKnemH7K) if xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xa0\xc4\xbaN\xec\x92.\x19t'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b1010011 + 0o34) + '\x64' + '\x65')(chr(117) + chr(116) + chr(0b11001 + 0o115) + chr(0b101101) + '\070')) is None: jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'>\xa9\xd5\xffJ\xe2\x94"\x1bho\x9e\xfd\xdf\xba2\xba\x80=\xc2Z\xf3\xb5|\\\xe3\x08\x14e\x03F\x0c\xe4Y\x0c\xb9\xbf\x05j\xe7\r\xae\xc2\xb6L\xf0\xc7g\x13u=\xd0\xfc\xd8\xe3/\xaa\xd4g\xc2z\xf9\xe1d\x0e\xfb\x1b\x0fdFlC\xe3R\x02'), chr(0b111011 + 0o51) + '\x65' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b110000 + 0o65))(chr(0b1110101) + chr(7040 - 6924) + chr(0b1010011 + 0o23) + chr(341 - 296) + chr(0b111000)) raise q1QCh3W88sgk(jtbovtaIYjRB) AoWJEgIAbHh_ = WqUC3KWvYVup.asarray(AoWJEgIAbHh_) if not vbqhcY5kX820(AoWJEgIAbHh_): jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xae\xd4\xbaZ\xa3\x8e"\x19c=\x83\xf7\x8c\xf8:\xef\x92;\x90Y\xef\xb8`G\xe7\x1b]h\x08VI\xeaR^\xed'), chr(100) + chr(101) + chr(577 - 478) + chr(0b1011101 + 0o22) + '\x64' + chr(101))(chr(117) + chr(7138 - 7022) + chr(5933 - 5831) + '\055' + chr(213 - 157)) if GID6_fWM6lkY(AoWJEgIAbHh_): W2PA20tqRUOX = AoWJEgIAbHh_.astype(xafqLlk3kkUe(SXOLrMavuUCe(b'\x03\xf9'), chr(0b1011010 + 0o12) + chr(101) + '\143' + chr(0b1101111) + chr(1751 - 1651) + '\145')(chr(117) + chr(116) + '\x66' + '\055' + chr(0b111000))) if xafqLlk3kkUe(W2PA20tqRUOX == AoWJEgIAbHh_, xafqLlk3kkUe(SXOLrMavuUCe(b'.\xad\x84\xe7G\xe9\xd15\x1en/\xc4'), '\144' + chr(0b1100101) + '\143' + chr(3659 - 3548) + chr(6465 - 6365) + '\x65')(chr(117) + chr(0b11111 + 0o125) + chr(0b1100110) + chr(0b10010 + 0o33) + chr(0b101000 + 0o20)))(): jtbovtaIYjRB = None AoWJEgIAbHh_ = W2PA20tqRUOX nDEnNBabFNKm(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\xad\xdf\xbe]\xa3\x83(\x18bn\xd7\xef\xc5\xf63\xef\x91,\xc2\\\xff\xe6mB\xe0\x11\nd\x02\x02E\xe3\x17X\xf6\xb9Dx\xf7\x1e\xb4\xc2\xba\t\xe2\x8e#\\u|\x9e\xeb\xc9\xba>\xef\xa5(\x8eM\xf3\xd0~\\\xe3\x0c'), '\x64' + chr(0b1100101) + '\x63' + chr(0b1000101 + 0o52) + chr(0b100011 + 0o101) + '\145')(chr(0b10011 + 0o142) + chr(116) + chr(0b1100 + 0o132) + chr(1732 - 1687) + chr(0b0 + 0o70)), VHAt7CcYKC2T, stacklevel=ehT0Px3KOsy9('\060' + chr(11832 - 11721) + chr(0b100111 + 0o13), 31745 - 31737)) if jtbovtaIYjRB: raise q1QCh3W88sgk(jtbovtaIYjRB) if c2A0yzQpDQB3(AoWJEgIAbHh_) and (xafqLlk3kkUe(AoWJEgIAbHh_, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\xb2\xd4\xb5_\xef\x87/E`Y\xa7'), chr(599 - 499) + chr(3474 - 3373) + '\x63' + '\x6f' + '\x64' + chr(6228 - 6127))(chr(0b1110101) + chr(0b101001 + 0o113) + chr(102) + chr(0b101101) + '\x38'))() >= c2A0yzQpDQB3(xafqLlk3kkUe(jSV9IKnemH7K, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xa0\xc4\xbaN\xec\x92.\x19t'), chr(0b101111 + 0o65) + chr(0b1100101) + chr(99) + chr(111) + chr(0b1100100) + chr(0b1100101))(chr(0b100001 + 0o124) + '\164' + chr(102) + '\x2d' + chr(56)))) or xafqLlk3kkUe(AoWJEgIAbHh_, xafqLlk3kkUe(SXOLrMavuUCe(b'.\xb9\x82\xedK\xe8\xab\x17\x18s(\x93'), chr(0b1100100) + chr(0b1100101) + chr(0b10100 + 0o117) + chr(111) + '\144' + '\145')(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\055' + '\x38'))() < -ehT0Px3KOsy9('\060' + '\x6f' + chr(1079 - 1030), 8)): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xae\xd4\xbaZ\xa3\x8e"\x19c=\x83\xf7\x8c\xf8:\xef\x91,\x96O\xf3\xf0b\x0e\xa1O]`\x08F\x0c\xe1RB\xb6\xbf\x05j\xe7\r\xae\xc2\xb6L\xf0\xc9jM'), '\144' + chr(109 - 8) + chr(99) + chr(0b1011011 + 0o24) + chr(0b111101 + 0o47) + chr(0b1100101))(chr(117) + '\164' + chr(7843 - 7741) + chr(0b101101) + chr(0b111000))) return NSstowUUZlxS(AoWJEgIAbHh_, dtype=jSV9IKnemH7K, fastpath=ehT0Px3KOsy9('\060' + chr(0b110011 + 0o74) + chr(1636 - 1587), 8))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical._get_codes
def _get_codes(self): """ Get the codes. Returns ------- codes : integer array view A non writable view of the `codes` array. """ v = self._codes.view() v.flags.writeable = False return v
python
def _get_codes(self): """ Get the codes. Returns ------- codes : integer array view A non writable view of the `codes` array. """ v = self._codes.view() v.flags.writeable = False return v
[ "def", "_get_codes", "(", "self", ")", ":", "v", "=", "self", ".", "_codes", ".", "view", "(", ")", "v", ".", "flags", ".", "writeable", "=", "False", "return", "v" ]
Get the codes. Returns ------- codes : integer array view A non writable view of the `codes` array.
[ "Get", "the", "codes", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L659-L670
train
Returns a view of the codes array.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5Fy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tyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + chr(249 - 198) + chr(0b110110) + chr(344 - 296), 52346 - 52338), ehT0Px3KOsy9(chr(1402 - 1354) + chr(111) + '\067' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + '\x34' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(72 - 24) + chr(111) + chr(0b1111 + 0o42) + chr(0b110110) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001100 + 0o43) + chr(0b10000 + 0o41) + '\061' + '\x32', 0o10), ehT0Px3KOsy9(chr(102 - 54) + '\x6f' + chr(50) + chr(52) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + chr(299 - 246) + chr(0b11011 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\x31' + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(9116 - 9005) + chr(0b110001) + chr(0b110101) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b10000 + 0o41) + chr(1305 - 1252), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(7621 - 7510) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110110) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + '\062' + chr(0b110101) + chr(0b11011 + 0o26), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110111) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b110110) + chr(48), 8), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(52) + '\x36', 1953 - 1945), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(1968 - 1919) + '\x33', 25999 - 25991), ehT0Px3KOsy9(chr(1103 - 1055) + chr(0b1100011 + 0o14) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110000 + 0o3) + chr(0b110110) + chr(52), 0o10), ehT0Px3KOsy9(chr(69 - 21) + '\157' + '\062' + chr(0b110011) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11110 + 0o25) + chr(2346 - 2295) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2317 - 2267) + chr(0b110101) + chr(2834 - 2780), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10 + 0o155) + chr(51) + '\x31', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(546 - 492) + chr(305 - 257), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(1411 - 1356) + '\064', 27480 - 27472), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1100 + 0o46) + '\066' + chr(1347 - 1299), 0b1000), ehT0Px3KOsy9(chr(1512 - 1464) + chr(10642 - 10531) + chr(885 - 835) + '\x33' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\065', 37163 - 37155), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(158 - 108) + '\x34' + '\x35', 8), ehT0Px3KOsy9('\060' + chr(0b1000011 + 0o54) + chr(0b110011) + chr(0b110000) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1444 - 1390), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(699 - 646) + chr(1339 - 1286), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(5694 - 5583) + '\x33' + '\060' + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10010 + 0o135) + '\062' + '\066' + chr(0b110011), 6303 - 6295), ehT0Px3KOsy9(chr(48) + chr(10365 - 10254) + chr(153 - 104) + chr(50) + chr(0b101010 + 0o7), 0b1000), ehT0Px3KOsy9('\x30' + chr(7843 - 7732) + chr(0b110011) + chr(49) + chr(0b100011 + 0o17), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + chr(49) + chr(315 - 261) + '\067', 0o10), ehT0Px3KOsy9(chr(2099 - 2051) + chr(6279 - 6168) + '\x31' + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(906 - 856) + chr(0b110010) + chr(2880 - 2826), 0o10), ehT0Px3KOsy9('\x30' + chr(0b110111 + 0o70) + '\065' + chr(1841 - 1786), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + chr(0b1001 + 0o54) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xde'), '\x64' + chr(101) + chr(0b101101 + 0o66) + chr(111) + '\x64' + chr(9885 - 9784))(chr(4704 - 4587) + '\164' + chr(2079 - 1977) + chr(0b11101 + 0o20) + chr(0b101111 + 0o11)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def BbN0WlDsCeqK(oVre8I6UXc3b): cMbll0QYhULo = oVre8I6UXc3b._codes.view() cMbll0QYhULo.flags.rdGsi_SWQw7q = ehT0Px3KOsy9('\x30' + chr(6941 - 6830) + chr(0b100110 + 0o12), ord("\x08")) return cMbll0QYhULo
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical._set_categories
def _set_categories(self, categories, fastpath=False): """ Sets new categories inplace Parameters ---------- fastpath : bool, default False Don't perform validation of the categories for uniqueness or nulls Examples -------- >>> c = pd.Categorical(['a', 'b']) >>> c [a, b] Categories (2, object): [a, b] >>> c._set_categories(pd.Index(['a', 'c'])) >>> c [a, c] Categories (2, object): [a, c] """ if fastpath: new_dtype = CategoricalDtype._from_fastpath(categories, self.ordered) else: new_dtype = CategoricalDtype(categories, ordered=self.ordered) if (not fastpath and self.dtype.categories is not None and len(new_dtype.categories) != len(self.dtype.categories)): raise ValueError("new categories need to have the same number of " "items than the old categories!") self._dtype = new_dtype
python
def _set_categories(self, categories, fastpath=False): """ Sets new categories inplace Parameters ---------- fastpath : bool, default False Don't perform validation of the categories for uniqueness or nulls Examples -------- >>> c = pd.Categorical(['a', 'b']) >>> c [a, b] Categories (2, object): [a, b] >>> c._set_categories(pd.Index(['a', 'c'])) >>> c [a, c] Categories (2, object): [a, c] """ if fastpath: new_dtype = CategoricalDtype._from_fastpath(categories, self.ordered) else: new_dtype = CategoricalDtype(categories, ordered=self.ordered) if (not fastpath and self.dtype.categories is not None and len(new_dtype.categories) != len(self.dtype.categories)): raise ValueError("new categories need to have the same number of " "items than the old categories!") self._dtype = new_dtype
[ "def", "_set_categories", "(", "self", ",", "categories", ",", "fastpath", "=", "False", ")", ":", "if", "fastpath", ":", "new_dtype", "=", "CategoricalDtype", ".", "_from_fastpath", "(", "categories", ",", "self", ".", "ordered", ")", "else", ":", "new_dtype", "=", "CategoricalDtype", "(", "categories", ",", "ordered", "=", "self", ".", "ordered", ")", "if", "(", "not", "fastpath", "and", "self", ".", "dtype", ".", "categories", "is", "not", "None", "and", "len", "(", "new_dtype", ".", "categories", ")", "!=", "len", "(", "self", ".", "dtype", ".", "categories", ")", ")", ":", "raise", "ValueError", "(", "\"new categories need to have the same number of \"", "\"items than the old categories!\"", ")", "self", ".", "_dtype", "=", "new_dtype" ]
Sets new categories inplace Parameters ---------- fastpath : bool, default False Don't perform validation of the categories for uniqueness or nulls Examples -------- >>> c = pd.Categorical(['a', 'b']) >>> c [a, b] Categories (2, object): [a, b] >>> c._set_categories(pd.Index(['a', 'c'])) >>> c [a, c] Categories (2, object): [a, c]
[ "Sets", "new", "categories", "inplace" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L680-L712
train
Sets new categories in the current object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7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WkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + '\x35' + chr(0b101000 + 0o15), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100011 + 0o14) + chr(0b110011 + 0o0) + '\067' + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + '\066' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + '\061' + chr(1583 - 1529) + chr(495 - 443), 0b1000), ehT0Px3KOsy9(chr(1820 - 1772) + chr(5523 - 5412) + chr(1125 - 1072), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\x35' + '\063', 0b1000), ehT0Px3KOsy9(chr(2004 - 1956) + '\x6f' + '\x37' + '\x36', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\066' + chr(2292 - 2244), 34211 - 34203), ehT0Px3KOsy9(chr(48) + chr(3336 - 3225) + '\x35' + chr(0b110011), 5115 - 5107), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b10001 + 0o136) + '\x32' + chr(52) + chr(0b1000 + 0o56), 58916 - 58908), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(2239 - 2190) + chr(51), 1152 - 1144), ehT0Px3KOsy9(chr(48) + chr(0b1010101 + 0o32) + chr(0b110001) + '\060' + chr(1451 - 1396), 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101110 + 0o1) + '\062' + '\x37' + chr(0b110 + 0o53), 25209 - 25201), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + '\x37' + chr(0b110101), 64259 - 64251), ehT0Px3KOsy9(chr(1971 - 1923) + chr(9422 - 9311) + chr(50) + chr(52) + '\x34', 13163 - 13155), ehT0Px3KOsy9(chr(2227 - 2179) + chr(7219 - 7108) + '\x32' + chr(0b110011) + chr(49), 0o10), ehT0Px3KOsy9(chr(976 - 928) + chr(0b111001 + 0o66) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(48) + chr(0b110001), 5319 - 5311), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\x6f' + chr(0b110001) + '\x34' + '\066', 33003 - 32995), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1955 - 1907) + chr(0b11111 + 0o120) + chr(0b100011 + 0o22) + '\x36', 7933 - 7925), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + '\x34' + chr(48), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(0b1111 + 0o46) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100111 + 0o110) + '\061' + chr(0b10010 + 0o40) + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(54) + chr(0b110101), 18790 - 18782), ehT0Px3KOsy9(chr(48) + chr(410 - 299) + chr(0b110101) + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1100 + 0o47) + '\x33' + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110000 + 0o0), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100 + 0o153) + chr(51) + chr(54) + '\066', 19139 - 19131), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\x30' + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b110101) + chr(0b10111 + 0o40), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b110111 + 0o70) + chr(0b100111 + 0o12) + chr(0b110010) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(879 - 830) + chr(0b11 + 0o61) + chr(848 - 796), 4747 - 4739), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + chr(0b110011) + chr(0b110011) + chr(0b1101 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + chr(279 - 230) + chr(51) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(10027 - 9916) + '\x33' + '\x32' + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(10257 - 10146) + '\063' + chr(54) + chr(0b110010), 8), ehT0Px3KOsy9(chr(1412 - 1364) + chr(0b10110 + 0o131) + chr(49) + '\061' + '\064', 63433 - 63425), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\060' + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(54) + chr(0b110011), 46092 - 46084)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1081 - 1033) + '\157' + chr(53) + chr(1482 - 1434), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'C'), '\x64' + chr(101) + chr(0b1100011) + '\157' + '\144' + chr(0b1100101))('\165' + '\x74' + chr(0b1100110) + chr(1916 - 1871) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def SAjQFizxjgt3(oVre8I6UXc3b, mZZDAT49UzAb, pc1tSsQK7sha=ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + chr(0b110000), 8)): if pc1tSsQK7sha: H6Aqpf9qhdEs = CBSVoRj_kvTn._from_fastpath(mZZDAT49UzAb, oVre8I6UXc3b.ordered) else: H6Aqpf9qhdEs = CBSVoRj_kvTn(mZZDAT49UzAb, ordered=oVre8I6UXc3b.ordered) if not pc1tSsQK7sha and xafqLlk3kkUe(oVre8I6UXc3b.dtype, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e\x9f\x86\x11b\x84L\x19N\xd5'), '\144' + chr(101) + chr(7404 - 7305) + chr(9178 - 9067) + chr(0b1100100) + chr(0b0 + 0o145))(chr(0b1110101) + chr(0b1101001 + 0o13) + chr(9433 - 9331) + '\055' + '\070')) is not None and (c2A0yzQpDQB3(xafqLlk3kkUe(H6Aqpf9qhdEs, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e\x9f\x86\x11b\x84L\x19N\xd5'), '\144' + chr(0b1100101) + chr(8058 - 7959) + chr(4433 - 4322) + chr(0b111000 + 0o54) + '\145')(chr(117) + chr(0b1110100) + chr(0b1010111 + 0o17) + chr(0b1111 + 0o36) + chr(56)))) != c2A0yzQpDQB3(xafqLlk3kkUe(oVre8I6UXc3b.dtype, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e\x9f\x86\x11b\x84L\x19N\xd5'), chr(100) + chr(0b1000001 + 0o44) + '\143' + chr(4186 - 4075) + chr(0b1100100) + chr(0b100100 + 0o101))(chr(0b101100 + 0o111) + chr(10867 - 10751) + chr(102) + chr(45) + '\x38')))): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x03\x9b\x85Tf\x8aJ\x15L\xc9\xb9.\xdc\xce\x84\xf7f$\x02&Z\xcf\x8e=T\\\xbc \x82\xa9\x8ar\x17\xba2\xb4\xd2"\xb7\x9e\x0f\x9b\x80Tj\x8d\x1e\x19_\xc3\xa64\x99\xc9\xcc\xf8ma\x12nK\x80\xc19Q\n\xbaa\x82\xa4\x88=\x16\xb2:\xa2\xd3'), '\x64' + chr(7531 - 7430) + chr(99) + chr(0b1101111) + chr(0b100111 + 0o75) + chr(0b110 + 0o137))('\165' + chr(0b1000101 + 0o57) + '\x66' + chr(1370 - 1325) + chr(56))) oVre8I6UXc3b.z2oVGDR5m1eh = H6Aqpf9qhdEs
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical._set_dtype
def _set_dtype(self, dtype): """ Internal method for directly updating the CategoricalDtype Parameters ---------- dtype : CategoricalDtype Notes ----- We don't do any validation here. It's assumed that the dtype is a (valid) instance of `CategoricalDtype`. """ codes = _recode_for_categories(self.codes, self.categories, dtype.categories) return type(self)(codes, dtype=dtype, fastpath=True)
python
def _set_dtype(self, dtype): """ Internal method for directly updating the CategoricalDtype Parameters ---------- dtype : CategoricalDtype Notes ----- We don't do any validation here. It's assumed that the dtype is a (valid) instance of `CategoricalDtype`. """ codes = _recode_for_categories(self.codes, self.categories, dtype.categories) return type(self)(codes, dtype=dtype, fastpath=True)
[ "def", "_set_dtype", "(", "self", ",", "dtype", ")", ":", "codes", "=", "_recode_for_categories", "(", "self", ".", "codes", ",", "self", ".", "categories", ",", "dtype", ".", "categories", ")", "return", "type", "(", "self", ")", "(", "codes", ",", "dtype", "=", "dtype", ",", "fastpath", "=", "True", ")" ]
Internal method for directly updating the CategoricalDtype Parameters ---------- dtype : CategoricalDtype Notes ----- We don't do any validation here. It's assumed that the dtype is a (valid) instance of `CategoricalDtype`.
[ "Internal", "method", "for", "directly", "updating", "the", "CategoricalDtype" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L714-L729
train
Internal method for directly updating the CategoricalDtype object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Y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7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\x6f' + chr(2470 - 2420) + chr(270 - 216) + '\061', 0o10), ehT0Px3KOsy9('\060' + chr(11446 - 11335) + chr(1111 - 1061) + chr(0b11000 + 0o30) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(2038 - 1927) + '\x33' + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b100110 + 0o15) + '\x30' + '\x30', 43835 - 43827), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + chr(0b1011 + 0o46) + chr(1175 - 1124) + chr(0b110111), 9210 - 9202), ehT0Px3KOsy9('\060' + '\x6f' + chr(1609 - 1558) + chr(1502 - 1453) + '\063', 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + '\061' + chr(962 - 912) + '\x35', 20523 - 20515), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1101111) + chr(0b110111) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\x36' + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110100) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(48) + chr(0b10 + 0o56), 21945 - 21937), ehT0Px3KOsy9('\x30' + chr(10977 - 10866) + chr(0b110101) + '\067', 0b1000), ehT0Px3KOsy9(chr(1958 - 1910) + chr(0b10111 + 0o130) + chr(55) + '\067', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b110100) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(88 - 38) + '\060' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110100 + 0o73) + chr(1514 - 1459) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + '\063' + chr(0b1010 + 0o53), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110111) + chr(0b110111), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001101 + 0o42) + chr(0b110001) + '\x31' + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(0b110010) + chr(1781 - 1732), 0b1000), ehT0Px3KOsy9('\x30' + chr(6774 - 6663) + chr(0b1111 + 0o43) + '\063' + chr(54), 4738 - 4730), ehT0Px3KOsy9(chr(878 - 830) + chr(0b1101111) + chr(0b10111 + 0o36) + '\x31', 0o10), ehT0Px3KOsy9(chr(1518 - 1470) + chr(11759 - 11648) + '\x31' + chr(0b101000 + 0o15) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10010 + 0o135) + chr(0b110100) + chr(0b100100 + 0o21), 0o10), ehT0Px3KOsy9(chr(1705 - 1657) + chr(0b1000000 + 0o57) + '\063' + chr(0b110010) + chr(2350 - 2295), 10359 - 10351), ehT0Px3KOsy9(chr(1936 - 1888) + chr(0b110111 + 0o70) + '\062' + chr(593 - 539) + chr(0b1100 + 0o51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10111 + 0o33) + chr(212 - 157) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110101) + '\x35', 28440 - 28432), ehT0Px3KOsy9(chr(807 - 759) + '\157' + '\063' + chr(0b10001 + 0o44) + chr(1037 - 988), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(316 - 268) + '\x6f' + chr(50) + chr(478 - 426) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\064' + chr(55), 8), ehT0Px3KOsy9(chr(1995 - 1947) + chr(111) + chr(0b110100) + chr(0b1001 + 0o54), 8), ehT0Px3KOsy9('\060' + chr(8564 - 8453) + '\x33' + '\067' + chr(1353 - 1299), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(206 - 154) + chr(0b1000 + 0o50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100010 + 0o115) + chr(0b101100 + 0o12) + chr(0b110101), 55482 - 55474), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + chr(357 - 309), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1001 + 0o54) + '\x31', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(746 - 692), 0b1000), ehT0Px3KOsy9(chr(1651 - 1603) + chr(0b1101111) + '\066' + chr(0b110011), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(0b1001 + 0o54) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f'), '\x64' + chr(4773 - 4672) + '\143' + chr(111) + '\x64' + chr(101))(chr(0b1110101) + '\164' + chr(2808 - 2706) + chr(0b101010 + 0o3) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def G5nLqUq0Bn7h(oVre8I6UXc3b, jSV9IKnemH7K): AoWJEgIAbHh_ = V3m1SlhRYSW0(oVre8I6UXc3b.codes, oVre8I6UXc3b.categories, jSV9IKnemH7K.categories) return wmQmyeWBmUpv(oVre8I6UXc3b)(AoWJEgIAbHh_, dtype=jSV9IKnemH7K, fastpath=ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + chr(0b110001), ord("\x08")))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.set_ordered
def set_ordered(self, value, inplace=False): """ Set the ordered attribute to the boolean value. Parameters ---------- value : bool Set whether this categorical is ordered (True) or not (False). inplace : bool, default False Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to the value. """ inplace = validate_bool_kwarg(inplace, 'inplace') new_dtype = CategoricalDtype(self.categories, ordered=value) cat = self if inplace else self.copy() cat._dtype = new_dtype if not inplace: return cat
python
def set_ordered(self, value, inplace=False): """ Set the ordered attribute to the boolean value. Parameters ---------- value : bool Set whether this categorical is ordered (True) or not (False). inplace : bool, default False Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to the value. """ inplace = validate_bool_kwarg(inplace, 'inplace') new_dtype = CategoricalDtype(self.categories, ordered=value) cat = self if inplace else self.copy() cat._dtype = new_dtype if not inplace: return cat
[ "def", "set_ordered", "(", "self", ",", "value", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "new_dtype", "=", "CategoricalDtype", "(", "self", ".", "categories", ",", "ordered", "=", "value", ")", "cat", "=", "self", "if", "inplace", "else", "self", ".", "copy", "(", ")", "cat", ".", "_dtype", "=", "new_dtype", "if", "not", "inplace", ":", "return", "cat" ]
Set the ordered attribute to the boolean value. Parameters ---------- value : bool Set whether this categorical is ordered (True) or not (False). inplace : bool, default False Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to the value.
[ "Set", "the", "ordered", "attribute", "to", "the", "boolean", "value", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L731-L748
train
Sets the ordered attribute of the categorical.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY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9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(10537 - 10426) + chr(1878 - 1829) + '\x34' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(50) + chr(1400 - 1349), ord("\x08")), ehT0Px3KOsy9(chr(509 - 461) + chr(0b1101110 + 0o1) + '\063' + chr(52) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(10464 - 10353) + '\x33' + chr(1734 - 1682) + chr(0b11110 + 0o31), 22965 - 22957), ehT0Px3KOsy9('\060' + '\x6f' + chr(549 - 498) + '\x36' + chr(1213 - 1163), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\067' + chr(495 - 446), 14150 - 14142), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(534 - 484) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1001101 + 0o42) + chr(0b11100 + 0o27) + chr(0b1111 + 0o41) + '\066', 42287 - 42279), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(49) + chr(0b101100 + 0o12) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + chr(0b110010) + chr(55) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(0b101100 + 0o103) + '\061' + chr(0b100 + 0o60) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(975 - 922) + chr(0b100001 + 0o17), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + '\x34' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(407 - 359) + chr(111) + '\061' + chr(0b110000) + chr(1113 - 1062), 0b1000), ehT0Px3KOsy9(chr(1097 - 1049) + chr(111) + chr(50) + '\x30' + chr(1725 - 1671), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(65 - 15) + chr(0b11011 + 0o25) + chr(273 - 224), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + '\061' + chr(0b110001) + chr(1702 - 1650), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2106 - 2057) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b110100) + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101011 + 0o4) + '\061' + chr(755 - 703) + chr(0b1010 + 0o46), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10110 + 0o34) + '\063' + chr(48), 57985 - 57977), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(1891 - 1842) + chr(1485 - 1431), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(703 - 652), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1331 - 1281) + chr(0b101111 + 0o1), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x37' + chr(0b10101 + 0o33), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(1051 - 998) + chr(0b100100 + 0o17), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + '\x34' + chr(51), 8), ehT0Px3KOsy9(chr(2002 - 1954) + '\157' + chr(49) + chr(0b10110 + 0o41) + chr(48), 57230 - 57222), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110111) + chr(1229 - 1178), 0o10), ehT0Px3KOsy9(chr(1831 - 1783) + '\x6f' + '\x31' + chr(50) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1056 - 945) + chr(0b1110 + 0o45) + chr(1671 - 1620) + chr(2213 - 2161), 46140 - 46132), ehT0Px3KOsy9('\060' + '\x6f' + chr(1531 - 1476) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + chr(0b11011 + 0o27) + '\x37' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(1230 - 1182) + '\x6f' + chr(50) + chr(53) + '\x36', 20808 - 20800), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(0b110011) + chr(1432 - 1382) + chr(50), 36119 - 36111), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + '\061' + chr(327 - 278) + chr(53), 29258 - 29250), ehT0Px3KOsy9(chr(0b110000) + chr(150 - 39) + chr(51) + chr(0b11010 + 0o34) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(2190 - 2142) + '\x6f' + chr(49) + chr(638 - 583) + chr(55), 58604 - 58596), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(0b110110) + chr(0b1000 + 0o50), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(1142 - 1031) + chr(1739 - 1686) + '\060', 22904 - 22896)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'J'), chr(100) + chr(0b100 + 0o141) + chr(287 - 188) + chr(111) + '\144' + '\145')(chr(11505 - 11388) + chr(0b1110100) + '\x66' + '\x2d' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def p1ml1ttknzuh(oVre8I6UXc3b, QmmgWUB13VCJ, KhzrMpzISODo=ehT0Px3KOsy9('\060' + chr(111) + '\060', 54415 - 54407)): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'\r\xfd\x90\x8b\x93Z4'), chr(3422 - 3322) + chr(101) + chr(2517 - 2418) + '\157' + chr(0b1100100) + chr(0b1111 + 0o126))(chr(3521 - 3404) + chr(116) + '\x66' + chr(45) + chr(0b111000))) H6Aqpf9qhdEs = CBSVoRj_kvTn(oVre8I6UXc3b.categories, ordered=QmmgWUB13VCJ) re0VVGAVKu27 = oVre8I6UXc3b if KhzrMpzISODo else oVre8I6UXc3b.igThHS4jwVsa() re0VVGAVKu27.z2oVGDR5m1eh = H6Aqpf9qhdEs if not KhzrMpzISODo: return re0VVGAVKu27
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.as_ordered
def as_ordered(self, inplace=False): """ Set the Categorical to be ordered. Parameters ---------- inplace : bool, default False Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to True. """ inplace = validate_bool_kwarg(inplace, 'inplace') return self.set_ordered(True, inplace=inplace)
python
def as_ordered(self, inplace=False): """ Set the Categorical to be ordered. Parameters ---------- inplace : bool, default False Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to True. """ inplace = validate_bool_kwarg(inplace, 'inplace') return self.set_ordered(True, inplace=inplace)
[ "def", "as_ordered", "(", "self", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "return", "self", ".", "set_ordered", "(", "True", ",", "inplace", "=", "inplace", ")" ]
Set the Categorical to be ordered. Parameters ---------- inplace : bool, default False Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to True.
[ "Set", "the", "Categorical", "to", "be", "ordered", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L750-L761
train
Set the Categorical to be ordered.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9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QB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + '\x37' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(1105 - 1057) + chr(209 - 158), 0o10), ehT0Px3KOsy9(chr(1334 - 1286) + chr(0b10100 + 0o133) + chr(0b110010) + chr(0b101100 + 0o12), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\066' + chr(0b1110 + 0o51), ord("\x08")), ehT0Px3KOsy9(chr(1404 - 1356) + '\157' + '\061' + chr(1496 - 1444) + chr(0b1 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(1250 - 1202) + chr(111) + chr(291 - 242) + chr(1129 - 1080) + chr(0b101110 + 0o7), 64208 - 64200), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(3250 - 3139) + chr(0b110011) + chr(51) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + '\x34' + chr(0b101100 + 0o7), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + '\x33' + '\060' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(655 - 605) + chr(1705 - 1657) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(49) + chr(0b11100 + 0o24), 0b1000), ehT0Px3KOsy9('\x30' + chr(7818 - 7707) + chr(50) + chr(984 - 936) + chr(2030 - 1979), 40188 - 40180), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + '\061' + chr(1173 - 1123) + chr(1811 - 1759), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + chr(0b110001) + chr(806 - 752) + chr(50), 10247 - 10239), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b110001) + chr(52), 18785 - 18777), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001 + 0o6) + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1003 - 951) + chr(1788 - 1734), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(2080 - 2025) + '\x33', 20877 - 20869), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010010 + 0o35) + chr(1248 - 1193) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10111 + 0o130) + chr(0b110001) + chr(1060 - 1006) + '\x32', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(145 - 92) + chr(0b1100 + 0o50), 10022 - 10014), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + '\x33' + chr(0b100010 + 0o20) + chr(0b10001 + 0o46), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001 + 0o4) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(0b110011) + chr(177 - 124), ord("\x08")), ehT0Px3KOsy9(chr(1477 - 1429) + chr(111) + chr(0b11001 + 0o27), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100100 + 0o15) + chr(0b1010 + 0o54) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010100 + 0o33) + '\067', 8275 - 8267), ehT0Px3KOsy9(chr(48) + chr(0b100100 + 0o113) + chr(243 - 191) + chr(54), 8), ehT0Px3KOsy9(chr(0b110000) + chr(6757 - 6646) + chr(371 - 321) + '\060' + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110000 + 0o1) + '\067' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11111 + 0o24) + '\064' + chr(0b11011 + 0o31), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(0b110101) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(0b110001) + chr(996 - 944), 43991 - 43983), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(111) + chr(0b11101 + 0o25) + '\067' + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(11135 - 11024) + chr(0b100000 + 0o21) + chr(0b110011) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101 + 0o55) + chr(50) + '\x36', 57238 - 57230), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(52) + chr(599 - 547), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110000), 8), ehT0Px3KOsy9(chr(207 - 159) + chr(111) + '\063' + chr(55) + chr(0b110100), 37853 - 37845)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + chr(2124 - 2076), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x17'), '\144' + chr(2401 - 2300) + chr(0b11110 + 0o105) + '\157' + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b1110 + 0o146) + chr(950 - 848) + chr(45) + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def kBRXWRM8mmjl(oVre8I6UXc3b, KhzrMpzISODo=ehT0Px3KOsy9(chr(0b110000) + chr(0b11110 + 0o121) + chr(0b101011 + 0o5), 8)): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'P-f\xdb\x01.\xba'), '\x64' + chr(101) + '\x63' + chr(0b1011000 + 0o27) + chr(5486 - 5386) + chr(101))(chr(0b10100 + 0o141) + chr(9742 - 9626) + chr(0b1100110) + chr(1225 - 1180) + '\x38')) return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'J&b\xe8\x0f?\xbb\x86\xb6\xe7\xac'), '\x64' + chr(0b1100101) + chr(0b11101 + 0o106) + chr(0b111111 + 0o60) + chr(100) + chr(0b1000 + 0o135))(chr(0b110111 + 0o76) + chr(116) + '\146' + '\x2d' + '\070'))(ehT0Px3KOsy9('\x30' + '\157' + chr(1656 - 1607), 0o10), inplace=KhzrMpzISODo)
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.as_unordered
def as_unordered(self, inplace=False): """ Set the Categorical to be unordered. Parameters ---------- inplace : bool, default False Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to False. """ inplace = validate_bool_kwarg(inplace, 'inplace') return self.set_ordered(False, inplace=inplace)
python
def as_unordered(self, inplace=False): """ Set the Categorical to be unordered. Parameters ---------- inplace : bool, default False Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to False. """ inplace = validate_bool_kwarg(inplace, 'inplace') return self.set_ordered(False, inplace=inplace)
[ "def", "as_unordered", "(", "self", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "return", "self", ".", "set_ordered", "(", "False", ",", "inplace", "=", "inplace", ")" ]
Set the Categorical to be unordered. Parameters ---------- inplace : bool, default False Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to False.
[ "Set", "the", "Categorical", "to", "be", "unordered", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L763-L774
train
Set the Categorical to be unordered.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1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gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1000011 + 0o54) + chr(0b100110 + 0o13) + chr(0b1 + 0o57) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\066' + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11010 + 0o30) + chr(0b110111) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(48) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b110000 + 0o77) + '\x31' + chr(0b11001 + 0o30), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(1935 - 1881), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b101000 + 0o13) + '\x30', 22186 - 22178), ehT0Px3KOsy9(chr(48) + chr(0b1001011 + 0o44) + chr(0b110001) + chr(0b110101) + chr(0b110111), 45856 - 45848), ehT0Px3KOsy9('\060' + chr(0b1000001 + 0o56) + '\066' + chr(83 - 35), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(53) + '\x33', 0o10), ehT0Px3KOsy9(chr(990 - 942) + chr(0b11110 + 0o121) + chr(0b110001) + chr(0b110110) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x37' + '\063', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(2041 - 1988) + '\063', 39139 - 39131), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + '\062' + chr(0b1111 + 0o42), 3617 - 3609), ehT0Px3KOsy9('\x30' + chr(2174 - 2063) + chr(2462 - 2411) + chr(0b110100) + chr(635 - 584), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(49) + chr(0b101100 + 0o7) + chr(0b10101 + 0o35), 59933 - 59925), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + '\063' + chr(0b100110 + 0o16) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110111 + 0o70) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1100 + 0o143) + '\062' + '\x31' + chr(0b1000 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x36' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + chr(1175 - 1124) + chr(0b100000 + 0o20) + chr(361 - 313), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100000 + 0o22), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10350 - 10239) + chr(988 - 938) + chr(0b110001) + '\062', 829 - 821), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061', 8), ehT0Px3KOsy9(chr(344 - 296) + chr(111) + chr(0b110001) + chr(0b100110 + 0o16) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101011 + 0o10) + chr(48) + chr(327 - 274), 36600 - 36592), ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + chr(0b110011) + chr(365 - 311) + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(1545 - 1491), 8), ehT0Px3KOsy9(chr(48) + chr(0b1011110 + 0o21) + '\x34' + chr(2192 - 2143), ord("\x08")), ehT0Px3KOsy9(chr(2274 - 2226) + '\x6f' + '\065' + chr(0b10001 + 0o44), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + chr(0b110010) + '\x35' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(680 - 632) + chr(0b1100100 + 0o13) + '\062' + '\066' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + chr(5171 - 5060) + '\x33' + chr(1285 - 1237) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b110011) + chr(1088 - 1037), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\066', 8), ehT0Px3KOsy9('\060' + chr(0b1011000 + 0o27) + '\061' + chr(0b1110 + 0o51) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(1751 - 1702) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(1706 - 1658) + chr(7633 - 7522) + '\066' + '\067', 8), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + '\063' + chr(49), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(0b110111) + '\x36', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110101) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'i'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(100) + chr(101))('\165' + chr(116) + chr(102) + '\x2d' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def aRDmNSIrUzoV(oVre8I6UXc3b, KhzrMpzISODo=ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(48), 0b1000)): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'.Z\xc8\xaehu\xfd'), '\144' + chr(0b1100101) + '\x63' + '\157' + chr(7551 - 7451) + '\x65')(chr(0b1110101) + chr(0b110 + 0o156) + '\146' + '\055' + chr(0b10 + 0o66))) return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'4Q\xcc\x9dfd\xfc\nB\x8e\x17'), chr(0b1100100) + chr(1591 - 1490) + chr(0b1100011) + '\x6f' + chr(100) + chr(0b1100101))('\x75' + chr(0b1110100) + chr(6581 - 6479) + chr(45) + '\x38'))(ehT0Px3KOsy9(chr(1906 - 1858) + chr(111) + chr(315 - 267), 8), inplace=KhzrMpzISODo)
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.set_categories
def set_categories(self, new_categories, ordered=None, rename=False, inplace=False): """ Set the categories to the specified new_categories. `new_categories` can include new categories (which will result in unused categories) or remove old categories (which results in values set to NaN). If `rename==True`, the categories will simple be renamed (less or more items than in old categories will result in values set to NaN or in unused categories respectively). This method can be used to perform more than one action of adding, removing, and reordering simultaneously and is therefore faster than performing the individual steps via the more specialised methods. On the other hand this methods does not do checks (e.g., whether the old categories are included in the new categories on a reorder), which can result in surprising changes, for example when using special string dtypes on python3, which does not considers a S1 string equal to a single char python string. Parameters ---------- new_categories : Index-like The categories in new order. ordered : bool, default False Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information. rename : bool, default False Whether or not the new_categories should be considered as a rename of the old categories or as reordered categories. inplace : bool, default False Whether or not to reorder the categories in-place or return a copy of this categorical with reordered categories. Returns ------- Categorical with reordered categories or None if inplace. Raises ------ ValueError If new_categories does not validate as categories See Also -------- rename_categories reorder_categories add_categories remove_categories remove_unused_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') if ordered is None: ordered = self.dtype.ordered new_dtype = CategoricalDtype(new_categories, ordered=ordered) cat = self if inplace else self.copy() if rename: if (cat.dtype.categories is not None and len(new_dtype.categories) < len(cat.dtype.categories)): # remove all _codes which are larger and set to -1/NaN cat._codes[cat._codes >= len(new_dtype.categories)] = -1 else: codes = _recode_for_categories(cat.codes, cat.categories, new_dtype.categories) cat._codes = codes cat._dtype = new_dtype if not inplace: return cat
python
def set_categories(self, new_categories, ordered=None, rename=False, inplace=False): """ Set the categories to the specified new_categories. `new_categories` can include new categories (which will result in unused categories) or remove old categories (which results in values set to NaN). If `rename==True`, the categories will simple be renamed (less or more items than in old categories will result in values set to NaN or in unused categories respectively). This method can be used to perform more than one action of adding, removing, and reordering simultaneously and is therefore faster than performing the individual steps via the more specialised methods. On the other hand this methods does not do checks (e.g., whether the old categories are included in the new categories on a reorder), which can result in surprising changes, for example when using special string dtypes on python3, which does not considers a S1 string equal to a single char python string. Parameters ---------- new_categories : Index-like The categories in new order. ordered : bool, default False Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information. rename : bool, default False Whether or not the new_categories should be considered as a rename of the old categories or as reordered categories. inplace : bool, default False Whether or not to reorder the categories in-place or return a copy of this categorical with reordered categories. Returns ------- Categorical with reordered categories or None if inplace. Raises ------ ValueError If new_categories does not validate as categories See Also -------- rename_categories reorder_categories add_categories remove_categories remove_unused_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') if ordered is None: ordered = self.dtype.ordered new_dtype = CategoricalDtype(new_categories, ordered=ordered) cat = self if inplace else self.copy() if rename: if (cat.dtype.categories is not None and len(new_dtype.categories) < len(cat.dtype.categories)): # remove all _codes which are larger and set to -1/NaN cat._codes[cat._codes >= len(new_dtype.categories)] = -1 else: codes = _recode_for_categories(cat.codes, cat.categories, new_dtype.categories) cat._codes = codes cat._dtype = new_dtype if not inplace: return cat
[ "def", "set_categories", "(", "self", ",", "new_categories", ",", "ordered", "=", "None", ",", "rename", "=", "False", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "if", "ordered", "is", "None", ":", "ordered", "=", "self", ".", "dtype", ".", "ordered", "new_dtype", "=", "CategoricalDtype", "(", "new_categories", ",", "ordered", "=", "ordered", ")", "cat", "=", "self", "if", "inplace", "else", "self", ".", "copy", "(", ")", "if", "rename", ":", "if", "(", "cat", ".", "dtype", ".", "categories", "is", "not", "None", "and", "len", "(", "new_dtype", ".", "categories", ")", "<", "len", "(", "cat", ".", "dtype", ".", "categories", ")", ")", ":", "# remove all _codes which are larger and set to -1/NaN", "cat", ".", "_codes", "[", "cat", ".", "_codes", ">=", "len", "(", "new_dtype", ".", "categories", ")", "]", "=", "-", "1", "else", ":", "codes", "=", "_recode_for_categories", "(", "cat", ".", "codes", ",", "cat", ".", "categories", ",", "new_dtype", ".", "categories", ")", "cat", ".", "_codes", "=", "codes", "cat", ".", "_dtype", "=", "new_dtype", "if", "not", "inplace", ":", "return", "cat" ]
Set the categories to the specified new_categories. `new_categories` can include new categories (which will result in unused categories) or remove old categories (which results in values set to NaN). If `rename==True`, the categories will simple be renamed (less or more items than in old categories will result in values set to NaN or in unused categories respectively). This method can be used to perform more than one action of adding, removing, and reordering simultaneously and is therefore faster than performing the individual steps via the more specialised methods. On the other hand this methods does not do checks (e.g., whether the old categories are included in the new categories on a reorder), which can result in surprising changes, for example when using special string dtypes on python3, which does not considers a S1 string equal to a single char python string. Parameters ---------- new_categories : Index-like The categories in new order. ordered : bool, default False Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information. rename : bool, default False Whether or not the new_categories should be considered as a rename of the old categories or as reordered categories. inplace : bool, default False Whether or not to reorder the categories in-place or return a copy of this categorical with reordered categories. Returns ------- Categorical with reordered categories or None if inplace. Raises ------ ValueError If new_categories does not validate as categories See Also -------- rename_categories reorder_categories add_categories remove_categories remove_unused_categories
[ "Set", "the", "categories", "to", "the", "specified", "new_categories", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L776-L846
train
Set the categories of the current entry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GM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Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1223 - 1174) + chr(54) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + chr(1576 - 1526) + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(0b1010011 + 0o34) + chr(53) + chr(0b100010 + 0o25), 37298 - 37290), ehT0Px3KOsy9('\060' + '\157' + chr(0b101111 + 0o2) + '\067' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2586 - 2534) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(1272 - 1161) + chr(0b11000 + 0o31) + '\065' + '\x36', 44020 - 44012), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(0b110010) + chr(0b110101), 58283 - 58275), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(681 - 570) + chr(0b110101) + chr(2534 - 2481), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + '\x32' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b110010) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101101 + 0o2) + '\063' + '\066' + chr(50), 57560 - 57552), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(632 - 583) + chr(0b10001 + 0o37) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + '\x33' + chr(50) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b110101) + '\065', 3582 - 3574), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110111), 48324 - 48316), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(2803 - 2748) + chr(474 - 422), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000111 + 0o50) + chr(49) + '\067' + chr(52), 8), ehT0Px3KOsy9(chr(1068 - 1020) + '\157' + chr(1347 - 1297) + chr(52) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(1377 - 1329) + chr(111) + '\061' + chr(294 - 242) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11101 + 0o24) + '\064' + '\x32', 7449 - 7441), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(52), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o22) + chr(1620 - 1570) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(1979 - 1925) + '\063', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10101 + 0o34) + chr(48) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1529 - 1418) + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(1733 - 1679) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(1603 - 1552) + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001 + 0o0) + '\067' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(52) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(2002 - 1949) + chr(693 - 640), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100011 + 0o20) + chr(51) + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(332 - 281) + chr(0b110100) + chr(0b11011 + 0o26), 63424 - 63416), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x35' + '\064', 37009 - 37001), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\x31' + '\062', 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1101111) + chr(51) + chr(53) + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(1699 - 1649) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1100 + 0o47) + '\064' + chr(0b0 + 0o63), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(0b11110 + 0o26) + chr(697 - 646), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11011 + 0o27) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\x6f' + '\063' + chr(52) + chr(0b110101), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(0b110000 + 0o5) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'Z'), chr(100) + chr(0b101000 + 0o75) + chr(6176 - 6077) + '\x6f' + chr(100) + '\x65')(chr(8207 - 8090) + '\x74' + '\146' + chr(0b1010 + 0o43) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def KzgqdkB_rZuv(oVre8I6UXc3b, QVK8u7RnAnpO, TillFngeGqII=None, WOgai73LTEHG=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\060', 0o10), KhzrMpzISODo=ehT0Px3KOsy9(chr(48) + chr(3841 - 3730) + chr(1387 - 1339), 8)): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1d}_\x14E\r\xb0'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(7674 - 7563) + chr(0b111001 + 0o53) + chr(101))('\x75' + chr(9697 - 9581) + chr(0b1100110) + chr(0b101101) + '\x38')) if TillFngeGqII is None: TillFngeGqII = oVre8I6UXc3b.dtype.ordered H6Aqpf9qhdEs = CBSVoRj_kvTn(QVK8u7RnAnpO, ordered=TillFngeGqII) re0VVGAVKu27 = oVre8I6UXc3b if KhzrMpzISODo else oVre8I6UXc3b.igThHS4jwVsa() if WOgai73LTEHG: if xafqLlk3kkUe(re0VVGAVKu27.dtype, xafqLlk3kkUe(SXOLrMavuUCe(b'\x17r[\x1dC\x01\xa7Dr\xa5'), '\144' + chr(101) + chr(0b1100011) + '\157' + '\x64' + chr(3052 - 2951))(chr(0b1110101) + chr(116) + chr(0b1 + 0o145) + '\055' + chr(1539 - 1483))) is not None and c2A0yzQpDQB3(xafqLlk3kkUe(H6Aqpf9qhdEs, xafqLlk3kkUe(SXOLrMavuUCe(b'\x17r[\x1dC\x01\xa7Dr\xa5'), '\144' + chr(6248 - 6147) + chr(0b101001 + 0o72) + chr(111) + chr(0b1100100) + chr(0b1100010 + 0o3))(chr(2451 - 2334) + chr(530 - 414) + chr(287 - 185) + chr(45) + chr(2738 - 2682)))) < c2A0yzQpDQB3(xafqLlk3kkUe(re0VVGAVKu27.dtype, xafqLlk3kkUe(SXOLrMavuUCe(b'\x17r[\x1dC\x01\xa7Dr\xa5'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))(chr(117) + '\164' + chr(3441 - 3339) + chr(45) + chr(0b1010 + 0o56)))): re0VVGAVKu27.d5BDZJl_zDsu[re0VVGAVKu27.d5BDZJl_zDsu >= c2A0yzQpDQB3(H6Aqpf9qhdEs.mZZDAT49UzAb)] = -ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + '\061', 8) else: AoWJEgIAbHh_ = V3m1SlhRYSW0(re0VVGAVKu27.codes, re0VVGAVKu27.mZZDAT49UzAb, H6Aqpf9qhdEs.mZZDAT49UzAb) re0VVGAVKu27.d5BDZJl_zDsu = AoWJEgIAbHh_ re0VVGAVKu27.z2oVGDR5m1eh = H6Aqpf9qhdEs if not KhzrMpzISODo: return re0VVGAVKu27
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.rename_categories
def rename_categories(self, new_categories, inplace=False): """ Rename categories. Parameters ---------- new_categories : list-like, dict-like or callable * list-like: all items must be unique and the number of items in the new categories must match the existing number of categories. * dict-like: specifies a mapping from old categories to new. Categories not contained in the mapping are passed through and extra categories in the mapping are ignored. .. versionadded:: 0.21.0 * callable : a callable that is called on all items in the old categories and whose return values comprise the new categories. .. versionadded:: 0.23.0 .. warning:: Currently, Series are considered list like. In a future version of pandas they'll be considered dict-like. inplace : bool, default False Whether or not to rename the categories inplace or return a copy of this categorical with renamed categories. Returns ------- cat : Categorical or None With ``inplace=False``, the new categorical is returned. With ``inplace=True``, there is no return value. Raises ------ ValueError If new categories are list-like and do not have the same number of items than the current categories or do not validate as categories See Also -------- reorder_categories add_categories remove_categories remove_unused_categories set_categories Examples -------- >>> c = pd.Categorical(['a', 'a', 'b']) >>> c.rename_categories([0, 1]) [0, 0, 1] Categories (2, int64): [0, 1] For dict-like ``new_categories``, extra keys are ignored and categories not in the dictionary are passed through >>> c.rename_categories({'a': 'A', 'c': 'C'}) [A, A, b] Categories (2, object): [A, b] You may also provide a callable to create the new categories >>> c.rename_categories(lambda x: x.upper()) [A, A, B] Categories (2, object): [A, B] """ inplace = validate_bool_kwarg(inplace, 'inplace') cat = self if inplace else self.copy() if isinstance(new_categories, ABCSeries): msg = ("Treating Series 'new_categories' as a list-like and using " "the values. In a future version, 'rename_categories' will " "treat Series like a dictionary.\n" "For dict-like, use 'new_categories.to_dict()'\n" "For list-like, use 'new_categories.values'.") warn(msg, FutureWarning, stacklevel=2) new_categories = list(new_categories) if is_dict_like(new_categories): cat.categories = [new_categories.get(item, item) for item in cat.categories] elif callable(new_categories): cat.categories = [new_categories(item) for item in cat.categories] else: cat.categories = new_categories if not inplace: return cat
python
def rename_categories(self, new_categories, inplace=False): """ Rename categories. Parameters ---------- new_categories : list-like, dict-like or callable * list-like: all items must be unique and the number of items in the new categories must match the existing number of categories. * dict-like: specifies a mapping from old categories to new. Categories not contained in the mapping are passed through and extra categories in the mapping are ignored. .. versionadded:: 0.21.0 * callable : a callable that is called on all items in the old categories and whose return values comprise the new categories. .. versionadded:: 0.23.0 .. warning:: Currently, Series are considered list like. In a future version of pandas they'll be considered dict-like. inplace : bool, default False Whether or not to rename the categories inplace or return a copy of this categorical with renamed categories. Returns ------- cat : Categorical or None With ``inplace=False``, the new categorical is returned. With ``inplace=True``, there is no return value. Raises ------ ValueError If new categories are list-like and do not have the same number of items than the current categories or do not validate as categories See Also -------- reorder_categories add_categories remove_categories remove_unused_categories set_categories Examples -------- >>> c = pd.Categorical(['a', 'a', 'b']) >>> c.rename_categories([0, 1]) [0, 0, 1] Categories (2, int64): [0, 1] For dict-like ``new_categories``, extra keys are ignored and categories not in the dictionary are passed through >>> c.rename_categories({'a': 'A', 'c': 'C'}) [A, A, b] Categories (2, object): [A, b] You may also provide a callable to create the new categories >>> c.rename_categories(lambda x: x.upper()) [A, A, B] Categories (2, object): [A, B] """ inplace = validate_bool_kwarg(inplace, 'inplace') cat = self if inplace else self.copy() if isinstance(new_categories, ABCSeries): msg = ("Treating Series 'new_categories' as a list-like and using " "the values. In a future version, 'rename_categories' will " "treat Series like a dictionary.\n" "For dict-like, use 'new_categories.to_dict()'\n" "For list-like, use 'new_categories.values'.") warn(msg, FutureWarning, stacklevel=2) new_categories = list(new_categories) if is_dict_like(new_categories): cat.categories = [new_categories.get(item, item) for item in cat.categories] elif callable(new_categories): cat.categories = [new_categories(item) for item in cat.categories] else: cat.categories = new_categories if not inplace: return cat
[ "def", "rename_categories", "(", "self", ",", "new_categories", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "cat", "=", "self", "if", "inplace", "else", "self", ".", "copy", "(", ")", "if", "isinstance", "(", "new_categories", ",", "ABCSeries", ")", ":", "msg", "=", "(", "\"Treating Series 'new_categories' as a list-like and using \"", "\"the values. In a future version, 'rename_categories' will \"", "\"treat Series like a dictionary.\\n\"", "\"For dict-like, use 'new_categories.to_dict()'\\n\"", "\"For list-like, use 'new_categories.values'.\"", ")", "warn", "(", "msg", ",", "FutureWarning", ",", "stacklevel", "=", "2", ")", "new_categories", "=", "list", "(", "new_categories", ")", "if", "is_dict_like", "(", "new_categories", ")", ":", "cat", ".", "categories", "=", "[", "new_categories", ".", "get", "(", "item", ",", "item", ")", "for", "item", "in", "cat", ".", "categories", "]", "elif", "callable", "(", "new_categories", ")", ":", "cat", ".", "categories", "=", "[", "new_categories", "(", "item", ")", "for", "item", "in", "cat", ".", "categories", "]", "else", ":", "cat", ".", "categories", "=", "new_categories", "if", "not", "inplace", ":", "return", "cat" ]
Rename categories. Parameters ---------- new_categories : list-like, dict-like or callable * list-like: all items must be unique and the number of items in the new categories must match the existing number of categories. * dict-like: specifies a mapping from old categories to new. Categories not contained in the mapping are passed through and extra categories in the mapping are ignored. .. versionadded:: 0.21.0 * callable : a callable that is called on all items in the old categories and whose return values comprise the new categories. .. versionadded:: 0.23.0 .. warning:: Currently, Series are considered list like. In a future version of pandas they'll be considered dict-like. inplace : bool, default False Whether or not to rename the categories inplace or return a copy of this categorical with renamed categories. Returns ------- cat : Categorical or None With ``inplace=False``, the new categorical is returned. With ``inplace=True``, there is no return value. Raises ------ ValueError If new categories are list-like and do not have the same number of items than the current categories or do not validate as categories See Also -------- reorder_categories add_categories remove_categories remove_unused_categories set_categories Examples -------- >>> c = pd.Categorical(['a', 'a', 'b']) >>> c.rename_categories([0, 1]) [0, 0, 1] Categories (2, int64): [0, 1] For dict-like ``new_categories``, extra keys are ignored and categories not in the dictionary are passed through >>> c.rename_categories({'a': 'A', 'c': 'C'}) [A, A, b] Categories (2, object): [A, b] You may also provide a callable to create the new categories >>> c.rename_categories(lambda x: x.upper()) [A, A, B] Categories (2, object): [A, B]
[ "Rename", "categories", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L848-L940
train
Returns a new categorical with renamed categories.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjf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k3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + '\063' + '\x31' + '\x31', 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(6075 - 5964) + '\063' + chr(0b110101), 19700 - 19692), ehT0Px3KOsy9('\060' + '\157' + chr(1375 - 1322) + chr(0b110110), 62347 - 62339), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(48) + '\063', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(422 - 373) + '\064' + '\067', 63214 - 63206), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b111 + 0o150) + '\x31' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6225 - 6114) + chr(54) + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b10000 + 0o43) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(51) + chr(0b110010 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\x30' + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100011 + 0o16) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(1659 - 1611) + '\157' + chr(1459 - 1404) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b101111 + 0o2) + '\x32' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001110 + 0o41) + '\x33' + chr(54) + '\066', 37242 - 37234), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(54) + chr(53), 8), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + '\065', 8), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b100010 + 0o25) + chr(0b10011 + 0o35), 0b1000), ehT0Px3KOsy9(chr(461 - 413) + chr(0b1101111) + chr(972 - 921) + chr(52) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2211 - 2160) + chr(51) + chr(48), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1000 + 0o53) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11887 - 11776) + chr(717 - 667) + chr(54) + '\x31', 18456 - 18448), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(53) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + '\067', 8), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(5591 - 5480) + chr(0b1011 + 0o46) + chr(0b110000) + '\x32', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(96 - 47) + '\066' + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1100 + 0o143) + chr(0b101010 + 0o10) + chr(53) + chr(478 - 426), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10000 + 0o43) + chr(1106 - 1053) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(428 - 379) + chr(431 - 380) + chr(0b1101 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(1212 - 1164) + chr(111) + chr(51) + '\x30' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11101 + 0o122) + chr(1051 - 1000), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + '\064' + chr(363 - 314), 0b1000), ehT0Px3KOsy9('\x30' + chr(2077 - 1966) + '\x34' + chr(2100 - 2046), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + chr(0b100100 + 0o23) + chr(1706 - 1651), 33354 - 33346), ehT0Px3KOsy9('\060' + '\x6f' + chr(2274 - 2219), 48930 - 48922), ehT0Px3KOsy9(chr(2148 - 2100) + chr(111) + '\061' + chr(1286 - 1231), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(564 - 514) + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x34' + chr(251 - 196), 0o10), ehT0Px3KOsy9(chr(1789 - 1741) + chr(0b1101111) + chr(0b10011 + 0o40) + chr(477 - 427) + chr(0b110110), 22879 - 22871), ehT0Px3KOsy9(chr(48) + chr(0b1010010 + 0o35) + '\061' + chr(50) + chr(0b1010 + 0o47), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(236 - 188) + chr(0b1101111) + chr(0b110101) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7'), chr(0b1100100) + '\x65' + chr(4190 - 4091) + '\x6f' + '\144' + '\145')('\x75' + '\x74' + '\146' + '\x2d' + chr(0b0 + 0o70)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def l2WwN095Ives(oVre8I6UXc3b, QVK8u7RnAnpO, KhzrMpzISODo=ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100011 + 0o15), 0o10)): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0s^\xaf\x06lP'), chr(100) + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + chr(0b1001001 + 0o34))('\x75' + chr(7720 - 7604) + '\146' + chr(0b101101) + chr(0b110001 + 0o7))) re0VVGAVKu27 = oVre8I6UXc3b if KhzrMpzISODo else oVre8I6UXc3b.igThHS4jwVsa() if PlSM16l2KDPD(QVK8u7RnAnpO, essMXh4s9f1w): jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'\x9doK\xa2\x13f[9\xfc\x15hH>\x93F-\x1f\x8b\xbdh\xee\xcdn6\x16\xcbi\x996\xa5p\x06\x06^t/7\x07\xba8\xbai\x03\xaf\x0edP~\xbd(i\x1a"\x85\\c_\xc5\xacw\xd4\x8ey#\x1f\xd9c\x98q\xe0JO\x06^\'i#S\xa3#\xac=X\xa6\x15|\\1\xb2j-\x1d%\x93[lU\x80\x87|\xd0\xdaj%\x1c\xdeo\x8e,\xe7#VOSk/"U\xb30\xbd=}\xa6\x15fP-\xfc*dQ2\xd6T-\\\x8c\xbbk\xd8\xc1a#\x01\xd5(\xe1\x19\xafq\x01BVd{{K\xbf:\xac1\x0e\xb6\x14j\x15y\xb2#ze4\x97Ah_\x8a\xaav\xd4\xdd!6\x1c\xf3b\x82<\xb4+\x08\x015A`$\x07\xba8\xbai\x03\xaf\x0edPr\xfc3~_w\xd1[hO\xba\xbb~\xc5\xcbh-\x01\xc5c\x98q\xb6bMSZt(x'), chr(0b1100100) + '\145' + '\143' + chr(9936 - 9825) + chr(0b1100100) + chr(0b1100101))(chr(0b100101 + 0o120) + '\164' + chr(9871 - 9769) + '\x2d' + chr(0b10110 + 0o42)) nDEnNBabFNKm(jtbovtaIYjRB, VHAt7CcYKC2T, stacklevel=ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1000 + 0o52), ord("\x08"))) QVK8u7RnAnpO = YyaZ4tpXu4lf(QVK8u7RnAnpO) if KwJXno8t8wVV(QVK8u7RnAnpO): re0VVGAVKu27.mZZDAT49UzAb = [QVK8u7RnAnpO.get(N7j7ePTXzzI0, N7j7ePTXzzI0) for N7j7ePTXzzI0 in re0VVGAVKu27.mZZDAT49UzAb] elif tzcpInYwBvYW(QVK8u7RnAnpO): re0VVGAVKu27.mZZDAT49UzAb = [QVK8u7RnAnpO(N7j7ePTXzzI0) for N7j7ePTXzzI0 in re0VVGAVKu27.mZZDAT49UzAb] else: re0VVGAVKu27.mZZDAT49UzAb = QVK8u7RnAnpO if not KhzrMpzISODo: return re0VVGAVKu27
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.reorder_categories
def reorder_categories(self, new_categories, ordered=None, inplace=False): """ Reorder categories as specified in new_categories. `new_categories` need to include all old categories and no new category items. Parameters ---------- new_categories : Index-like The categories in new order. ordered : bool, optional Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information. inplace : bool, default False Whether or not to reorder the categories inplace or return a copy of this categorical with reordered categories. Returns ------- cat : Categorical with reordered categories or None if inplace. Raises ------ ValueError If the new categories do not contain all old category items or any new ones See Also -------- rename_categories add_categories remove_categories remove_unused_categories set_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') if set(self.dtype.categories) != set(new_categories): raise ValueError("items in new_categories are not the same as in " "old categories") return self.set_categories(new_categories, ordered=ordered, inplace=inplace)
python
def reorder_categories(self, new_categories, ordered=None, inplace=False): """ Reorder categories as specified in new_categories. `new_categories` need to include all old categories and no new category items. Parameters ---------- new_categories : Index-like The categories in new order. ordered : bool, optional Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information. inplace : bool, default False Whether or not to reorder the categories inplace or return a copy of this categorical with reordered categories. Returns ------- cat : Categorical with reordered categories or None if inplace. Raises ------ ValueError If the new categories do not contain all old category items or any new ones See Also -------- rename_categories add_categories remove_categories remove_unused_categories set_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') if set(self.dtype.categories) != set(new_categories): raise ValueError("items in new_categories are not the same as in " "old categories") return self.set_categories(new_categories, ordered=ordered, inplace=inplace)
[ "def", "reorder_categories", "(", "self", ",", "new_categories", ",", "ordered", "=", "None", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "if", "set", "(", "self", ".", "dtype", ".", "categories", ")", "!=", "set", "(", "new_categories", ")", ":", "raise", "ValueError", "(", "\"items in new_categories are not the same as in \"", "\"old categories\"", ")", "return", "self", ".", "set_categories", "(", "new_categories", ",", "ordered", "=", "ordered", ",", "inplace", "=", "inplace", ")" ]
Reorder categories as specified in new_categories. `new_categories` need to include all old categories and no new category items. Parameters ---------- new_categories : Index-like The categories in new order. ordered : bool, optional Whether or not the categorical is treated as a ordered categorical. If not given, do not change the ordered information. inplace : bool, default False Whether or not to reorder the categories inplace or return a copy of this categorical with reordered categories. Returns ------- cat : Categorical with reordered categories or None if inplace. Raises ------ ValueError If the new categories do not contain all old category items or any new ones See Also -------- rename_categories add_categories remove_categories remove_unused_categories set_categories
[ "Reorder", "categories", "as", "specified", "in", "new_categories", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L942-L983
train
Reorder the categories of the current object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEa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mY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b1011 + 0o53) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(48) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(344 - 296) + chr(0b1001110 + 0o41) + chr(0b10101 + 0o41) + chr(124 - 75), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + chr(0b110011) + '\x37' + chr(51), 0b1000), ehT0Px3KOsy9(chr(2017 - 1969) + chr(1532 - 1421) + chr(0b110010) + chr(1056 - 1008) + chr(0b110001 + 0o0), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b110001) + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b110011) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + '\x33' + '\060' + chr(1930 - 1880), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7008 - 6897) + chr(0b11000 + 0o36) + '\x31', 8), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(5071 - 4960) + chr(1413 - 1362) + chr(2340 - 2286) + chr(0b110000), 57397 - 57389), ehT0Px3KOsy9(chr(1099 - 1051) + '\157' + chr(0b1000 + 0o53) + chr(1347 - 1298) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110110) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(11669 - 11558) + chr(1854 - 1805) + chr(0b10010 + 0o42) + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100110 + 0o11) + '\062' + chr(0b110 + 0o54), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(0b110010) + '\x36' + chr(0b100011 + 0o24), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\061' + chr(0b110001 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(989 - 941) + chr(0b1101010 + 0o5) + chr(0b110001) + '\x35' + chr(51), 34059 - 34051), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + chr(1236 - 1185) + chr(52), 56568 - 56560), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(6849 - 6738) + chr(0b10100 + 0o36) + chr(0b101 + 0o53) + chr(605 - 551), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1001 + 0o53) + '\062', 60363 - 60355), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1 + 0o61) + chr(49) + chr(2331 - 2281), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1354 - 1305) + chr(53) + '\x30', 5671 - 5663), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(0b110000 + 0o0) + '\065', 0b1000), ehT0Px3KOsy9('\060' + chr(8001 - 7890) + chr(0b110010) + '\x30' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\x37' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + '\x33' + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b111000 + 0o67) + chr(0b100001 + 0o21) + chr(1316 - 1262) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10000 + 0o42) + chr(0b101100 + 0o5) + chr(0b10100 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11010 + 0o30) + '\x31' + chr(0b110101), 8), ehT0Px3KOsy9(chr(964 - 916) + chr(0b0 + 0o157) + '\063' + chr(0b100 + 0o62) + chr(0b11000 + 0o34), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(645 - 534) + '\x34' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1011010 + 0o25) + chr(181 - 128) + chr(55), 55001 - 54993), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1780 - 1730) + chr(560 - 511) + chr(1312 - 1261), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100111 + 0o10) + chr(2085 - 2036) + chr(51) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(153 - 105) + chr(1045 - 934) + chr(1116 - 1067) + chr(0b11100 + 0o31) + '\x32', 27676 - 27668), ehT0Px3KOsy9('\x30' + chr(2772 - 2661) + chr(0b110001) + chr(0b110001) + '\x34', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11000 + 0o35) + '\065', 46079 - 46071), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1101 + 0o46) + chr(1102 - 1050) + chr(577 - 529), 53397 - 53389), ehT0Px3KOsy9(chr(1895 - 1847) + chr(0b110001 + 0o76) + chr(50) + chr(0b110001) + chr(50), 8), ehT0Px3KOsy9(chr(0b110000) + chr(8033 - 7922) + chr(246 - 192) + chr(0b11100 + 0o24), 21194 - 21186)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(2152 - 2104) + chr(10825 - 10714) + '\065' + chr(1916 - 1868), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9e'), chr(0b1011110 + 0o6) + chr(0b101011 + 0o72) + chr(0b1100011) + chr(685 - 574) + '\x64' + '\x65')(chr(0b1011110 + 0o27) + '\164' + chr(102) + chr(0b1011 + 0o42) + chr(2604 - 2548)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ess1BMPfSOtZ(oVre8I6UXc3b, QVK8u7RnAnpO, TillFngeGqII=None, KhzrMpzISODo=ehT0Px3KOsy9(chr(195 - 147) + chr(0b1101111) + chr(0b110000), 0o10)): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd9\xabA\x97\xe0\xac\xfb'), chr(100) + chr(101) + chr(0b101000 + 0o73) + chr(0b10100 + 0o133) + chr(0b1000100 + 0o40) + chr(0b111110 + 0o47))('\165' + chr(0b1110100) + chr(0b101011 + 0o73) + '\055' + '\070')) if MVEN8G6CxlvR(xafqLlk3kkUe(oVre8I6UXc3b.dtype, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\x9fk\xbf\xc0\x9b\xaa\xfbd\x8a\x89W'), '\144' + chr(0b1100101) + '\x63' + '\157' + chr(6135 - 6035) + '\x65')(chr(2801 - 2684) + '\x74' + '\146' + chr(0b10110 + 0o27) + '\x38'))) != MVEN8G6CxlvR(QVK8u7RnAnpO): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd9\xb1T\x96\xf2\xef\xf7\xac\x11\x9e\xadB:q\xd6\xfa\x0e{\xe9P\xe3\r6\xa7\xd8h\xd3\xad\xe3\x9bW\x0f\xff2\x0fl^\x81\xe7U\x90\xa4B\xdb\xe8\xa1\xbe\xad]\x94\xe8V\x04f\xd2\xe9\x04n\xefG\xf9'), chr(1634 - 1534) + chr(101) + chr(3533 - 3434) + chr(0b1101111) + chr(9728 - 9628) + '\145')(chr(0b1011101 + 0o30) + '\x74' + chr(0b1001010 + 0o34) + chr(45) + '\070')) return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3\xa0E\xa4\xe2\xae\xea\xa7V\x9f\xba\\\x00a'), chr(100) + chr(101) + chr(7466 - 7367) + chr(0b1001100 + 0o43) + chr(4250 - 4150) + '\x65')(chr(117) + chr(0b1110100) + '\x66' + chr(45) + chr(0b100 + 0o64)))(QVK8u7RnAnpO, ordered=TillFngeGqII, inplace=KhzrMpzISODo)
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.add_categories
def add_categories(self, new_categories, inplace=False): """ Add new categories. `new_categories` will be included at the last/highest place in the categories and will be unused directly after this call. Parameters ---------- new_categories : category or list-like of category The new categories to be included. inplace : bool, default False Whether or not to add the categories inplace or return a copy of this categorical with added categories. Returns ------- cat : Categorical with new categories added or None if inplace. Raises ------ ValueError If the new categories include old categories or do not validate as categories See Also -------- rename_categories reorder_categories remove_categories remove_unused_categories set_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') if not is_list_like(new_categories): new_categories = [new_categories] already_included = set(new_categories) & set(self.dtype.categories) if len(already_included) != 0: msg = ("new categories must not include old categories: " "{already_included!s}") raise ValueError(msg.format(already_included=already_included)) new_categories = list(self.dtype.categories) + list(new_categories) new_dtype = CategoricalDtype(new_categories, self.ordered) cat = self if inplace else self.copy() cat._dtype = new_dtype cat._codes = coerce_indexer_dtype(cat._codes, new_dtype.categories) if not inplace: return cat
python
def add_categories(self, new_categories, inplace=False): """ Add new categories. `new_categories` will be included at the last/highest place in the categories and will be unused directly after this call. Parameters ---------- new_categories : category or list-like of category The new categories to be included. inplace : bool, default False Whether or not to add the categories inplace or return a copy of this categorical with added categories. Returns ------- cat : Categorical with new categories added or None if inplace. Raises ------ ValueError If the new categories include old categories or do not validate as categories See Also -------- rename_categories reorder_categories remove_categories remove_unused_categories set_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') if not is_list_like(new_categories): new_categories = [new_categories] already_included = set(new_categories) & set(self.dtype.categories) if len(already_included) != 0: msg = ("new categories must not include old categories: " "{already_included!s}") raise ValueError(msg.format(already_included=already_included)) new_categories = list(self.dtype.categories) + list(new_categories) new_dtype = CategoricalDtype(new_categories, self.ordered) cat = self if inplace else self.copy() cat._dtype = new_dtype cat._codes = coerce_indexer_dtype(cat._codes, new_dtype.categories) if not inplace: return cat
[ "def", "add_categories", "(", "self", ",", "new_categories", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "if", "not", "is_list_like", "(", "new_categories", ")", ":", "new_categories", "=", "[", "new_categories", "]", "already_included", "=", "set", "(", "new_categories", ")", "&", "set", "(", "self", ".", "dtype", ".", "categories", ")", "if", "len", "(", "already_included", ")", "!=", "0", ":", "msg", "=", "(", "\"new categories must not include old categories: \"", "\"{already_included!s}\"", ")", "raise", "ValueError", "(", "msg", ".", "format", "(", "already_included", "=", "already_included", ")", ")", "new_categories", "=", "list", "(", "self", ".", "dtype", ".", "categories", ")", "+", "list", "(", "new_categories", ")", "new_dtype", "=", "CategoricalDtype", "(", "new_categories", ",", "self", ".", "ordered", ")", "cat", "=", "self", "if", "inplace", "else", "self", ".", "copy", "(", ")", "cat", ".", "_dtype", "=", "new_dtype", "cat", ".", "_codes", "=", "coerce_indexer_dtype", "(", "cat", ".", "_codes", ",", "new_dtype", ".", "categories", ")", "if", "not", "inplace", ":", "return", "cat" ]
Add new categories. `new_categories` will be included at the last/highest place in the categories and will be unused directly after this call. Parameters ---------- new_categories : category or list-like of category The new categories to be included. inplace : bool, default False Whether or not to add the categories inplace or return a copy of this categorical with added categories. Returns ------- cat : Categorical with new categories added or None if inplace. Raises ------ ValueError If the new categories include old categories or do not validate as categories See Also -------- rename_categories reorder_categories remove_categories remove_unused_categories set_categories
[ "Add", "new", "categories", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L985-L1033
train
Add new categories to the internal Categorical.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVg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o,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + '\x36' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b100111 + 0o11) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(51) + chr(0b101 + 0o53) + chr(55), 24515 - 24507), ehT0Px3KOsy9(chr(48) + chr(0b1001011 + 0o44) + '\x31' + '\061' + chr(0b110001), 1910 - 1902), ehT0Px3KOsy9(chr(48) + chr(5309 - 5198) + chr(486 - 431), 59981 - 59973), ehT0Px3KOsy9('\060' + '\157' + chr(2411 - 2358) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100111 + 0o110) + chr(0b11101 + 0o25) + chr(0b100 + 0o54) + '\062', 15492 - 15484), ehT0Px3KOsy9(chr(0b110000) + chr(0b11110 + 0o121) + chr(51) + chr(0b101000 + 0o15) + chr(0b110111), 25927 - 25919), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(2378 - 2324) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110110) + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(11289 - 11178) + chr(0b110011) + '\067' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10 + 0o62) + chr(645 - 593), 42073 - 42065), ehT0Px3KOsy9(chr(621 - 573) + chr(111) + '\061' + chr(1109 - 1061) + '\x33', 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101110 + 0o3) + chr(52) + '\x36', 0o10), ehT0Px3KOsy9(chr(1065 - 1017) + '\x6f' + '\066' + chr(0b101001 + 0o13), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10111 + 0o35) + chr(52), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11110 + 0o24) + chr(0b110000) + chr(1667 - 1615), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(0b10010 + 0o37) + '\065', 50513 - 50505), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1101011 + 0o4) + chr(0b110010) + '\062' + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11101 + 0o26) + chr(1524 - 1474) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(0b110100) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\061' + '\x32', 31661 - 31653), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(51) + chr(55) + chr(923 - 868), 0o10), ehT0Px3KOsy9(chr(1055 - 1007) + chr(0b1101111) + '\062' + chr(0b11101 + 0o24) + chr(1777 - 1725), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\065', 0o10), ehT0Px3KOsy9(chr(1417 - 1369) + chr(4679 - 4568) + chr(0b1011 + 0o52) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(48) + '\062', 8), ehT0Px3KOsy9('\x30' + chr(7907 - 7796) + chr(51) + '\x33' + chr(48), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + '\x34' + chr(0b110001), 26567 - 26559), ehT0Px3KOsy9(chr(1670 - 1622) + '\157' + chr(0b110011) + chr(49) + chr(50), 30099 - 30091), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100101 + 0o16) + chr(51), 0b1000), ehT0Px3KOsy9(chr(1627 - 1579) + chr(0b1101111) + '\061' + chr(2221 - 2173) + '\x31', 28290 - 28282), ehT0Px3KOsy9('\060' + chr(0b111100 + 0o63) + chr(0b110011) + chr(0b101 + 0o62), 0o10), ehT0Px3KOsy9('\060' + chr(0b1001101 + 0o42) + chr(51) + chr(54) + chr(1185 - 1133), 0o10), ehT0Px3KOsy9(chr(48) + chr(10403 - 10292) + chr(0b11 + 0o60) + chr(0b110001) + chr(765 - 717), 26318 - 26310), ehT0Px3KOsy9('\060' + chr(8948 - 8837) + '\062' + '\062' + chr(2235 - 2181), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(53) + '\066', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(49) + chr(1269 - 1221), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(11187 - 11076) + chr(752 - 703) + chr(0b110000) + '\x30', 63905 - 63897), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + chr(0b10110 + 0o35) + '\x32' + '\066', 1834 - 1826)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(558 - 447) + chr(0b110101) + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e'), chr(100) + '\x65' + '\143' + '\x6f' + '\144' + '\x65')('\x75' + chr(0b100111 + 0o115) + chr(0b1000 + 0o136) + '\055' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def T12YUpmkwUUQ(oVre8I6UXc3b, QVK8u7RnAnpO, KhzrMpzISODo=ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + chr(48), 48223 - 48215)): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'Y-\xb7%fM\xe7'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\157' + chr(1567 - 1467) + chr(101))(chr(0b1100110 + 0o17) + chr(12995 - 12879) + '\x66' + '\055' + chr(0b110001 + 0o7))) if not bAgBF7jXI53B(QVK8u7RnAnpO): QVK8u7RnAnpO = [QVK8u7RnAnpO] nJumMb6bGXlz = MVEN8G6CxlvR(QVK8u7RnAnpO) & MVEN8G6CxlvR(oVre8I6UXc3b.dtype.mZZDAT49UzAb) if c2A0yzQpDQB3(nJumMb6bGXlz) != ehT0Px3KOsy9(chr(791 - 743) + chr(111) + '\x30', 8): jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'^&\xb0idO\xf6\x8a\xd2[\x8fM&\x15\x14I\xf1\xfe\xe3\xf0\x8d%\x8b\xacdE\xe1\xb4\x94\xae~ap\x98\xac\xb6M\xe94\xb3W,\xb5 b]\xb8\xcf\xceU\x91V&\x07P]\xdb\xe4\xf9\xb3\x8f?\x9b\xe9i\n\xf1\xa5'), '\144' + chr(0b1100101 + 0o0) + '\143' + chr(111) + chr(0b10101 + 0o117) + '\145')(chr(0b1110101) + chr(116) + '\x66' + chr(45) + chr(56)) raise q1QCh3W88sgk(xafqLlk3kkUe(jtbovtaIYjRB, xafqLlk3kkUe(SXOLrMavuUCe(b'V,\xb5$fZ'), '\x64' + chr(7022 - 6921) + chr(99) + chr(0b100010 + 0o115) + chr(0b1100100) + chr(101))('\165' + '\x74' + '\146' + '\055' + '\x38'))(already_included=nJumMb6bGXlz)) QVK8u7RnAnpO = YyaZ4tpXu4lf(oVre8I6UXc3b.dtype.mZZDAT49UzAb) + YyaZ4tpXu4lf(QVK8u7RnAnpO) H6Aqpf9qhdEs = CBSVoRj_kvTn(QVK8u7RnAnpO, oVre8I6UXc3b.ordered) re0VVGAVKu27 = oVre8I6UXc3b if KhzrMpzISODo else oVre8I6UXc3b.igThHS4jwVsa() re0VVGAVKu27.z2oVGDR5m1eh = H6Aqpf9qhdEs re0VVGAVKu27.d5BDZJl_zDsu = IhoUBFeIAvnv(re0VVGAVKu27.d5BDZJl_zDsu, H6Aqpf9qhdEs.mZZDAT49UzAb) if not KhzrMpzISODo: return re0VVGAVKu27
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.remove_categories
def remove_categories(self, removals, inplace=False): """ Remove the specified categories. `removals` must be included in the old categories. Values which were in the removed categories will be set to NaN Parameters ---------- removals : category or list of categories The categories which should be removed. inplace : bool, default False Whether or not to remove the categories inplace or return a copy of this categorical with removed categories. Returns ------- cat : Categorical with removed categories or None if inplace. Raises ------ ValueError If the removals are not contained in the categories See Also -------- rename_categories reorder_categories add_categories remove_unused_categories set_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') if not is_list_like(removals): removals = [removals] removal_set = set(list(removals)) not_included = removal_set - set(self.dtype.categories) new_categories = [c for c in self.dtype.categories if c not in removal_set] # GH 10156 if any(isna(removals)): not_included = [x for x in not_included if notna(x)] new_categories = [x for x in new_categories if notna(x)] if len(not_included) != 0: msg = "removals must all be in old categories: {not_included!s}" raise ValueError(msg.format(not_included=not_included)) return self.set_categories(new_categories, ordered=self.ordered, rename=False, inplace=inplace)
python
def remove_categories(self, removals, inplace=False): """ Remove the specified categories. `removals` must be included in the old categories. Values which were in the removed categories will be set to NaN Parameters ---------- removals : category or list of categories The categories which should be removed. inplace : bool, default False Whether or not to remove the categories inplace or return a copy of this categorical with removed categories. Returns ------- cat : Categorical with removed categories or None if inplace. Raises ------ ValueError If the removals are not contained in the categories See Also -------- rename_categories reorder_categories add_categories remove_unused_categories set_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') if not is_list_like(removals): removals = [removals] removal_set = set(list(removals)) not_included = removal_set - set(self.dtype.categories) new_categories = [c for c in self.dtype.categories if c not in removal_set] # GH 10156 if any(isna(removals)): not_included = [x for x in not_included if notna(x)] new_categories = [x for x in new_categories if notna(x)] if len(not_included) != 0: msg = "removals must all be in old categories: {not_included!s}" raise ValueError(msg.format(not_included=not_included)) return self.set_categories(new_categories, ordered=self.ordered, rename=False, inplace=inplace)
[ "def", "remove_categories", "(", "self", ",", "removals", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "if", "not", "is_list_like", "(", "removals", ")", ":", "removals", "=", "[", "removals", "]", "removal_set", "=", "set", "(", "list", "(", "removals", ")", ")", "not_included", "=", "removal_set", "-", "set", "(", "self", ".", "dtype", ".", "categories", ")", "new_categories", "=", "[", "c", "for", "c", "in", "self", ".", "dtype", ".", "categories", "if", "c", "not", "in", "removal_set", "]", "# GH 10156", "if", "any", "(", "isna", "(", "removals", ")", ")", ":", "not_included", "=", "[", "x", "for", "x", "in", "not_included", "if", "notna", "(", "x", ")", "]", "new_categories", "=", "[", "x", "for", "x", "in", "new_categories", "if", "notna", "(", "x", ")", "]", "if", "len", "(", "not_included", ")", "!=", "0", ":", "msg", "=", "\"removals must all be in old categories: {not_included!s}\"", "raise", "ValueError", "(", "msg", ".", "format", "(", "not_included", "=", "not_included", ")", ")", "return", "self", ".", "set_categories", "(", "new_categories", ",", "ordered", "=", "self", ".", "ordered", ",", "rename", "=", "False", ",", "inplace", "=", "inplace", ")" ]
Remove the specified categories. `removals` must be included in the old categories. Values which were in the removed categories will be set to NaN Parameters ---------- removals : category or list of categories The categories which should be removed. inplace : bool, default False Whether or not to remove the categories inplace or return a copy of this categorical with removed categories. Returns ------- cat : Categorical with removed categories or None if inplace. Raises ------ ValueError If the removals are not contained in the categories See Also -------- rename_categories reorder_categories add_categories remove_unused_categories set_categories
[ "Remove", "the", "specified", "categories", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1035-L1086
train
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jv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(55) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(2030 - 1980) + chr(0b110111) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(52) + chr(586 - 537), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b110001) + chr(1955 - 1902), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(995 - 946) + '\063' + chr(0b10 + 0o65), 56222 - 56214), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(628 - 576), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b110011), 8), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(50) + '\x35' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b110011) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + '\x31' + chr(1026 - 973), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + '\060' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + chr(54) + chr(55), 0b1000), ehT0Px3KOsy9(chr(1297 - 1249) + chr(7716 - 7605) + chr(0b110010) + chr(800 - 745), ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + '\x33' + '\066' + chr(0b1 + 0o63), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9367 - 9256) + chr(566 - 515) + chr(0b110110) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(1834 - 1786) + '\x6f' + '\x33' + chr(0b110111) + chr(0b100101 + 0o22), 53139 - 53131), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(3383 - 3272) + chr(0b110010) + chr(2500 - 2447) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1000 + 0o53) + '\067' + '\x30', 0b1000), ehT0Px3KOsy9(chr(876 - 828) + '\x6f' + '\063' + chr(0b100101 + 0o16), 12803 - 12795), ehT0Px3KOsy9(chr(0b110000) + chr(11460 - 11349) + chr(49) + '\x35' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110111 + 0o70) + chr(0b100010 + 0o20) + chr(0b101001 + 0o11) + chr(2868 - 2814), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + chr(0b110011) + '\x37', 58511 - 58503), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + chr(1976 - 1927) + chr(55) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001110 + 0o41) + '\063' + chr(417 - 364) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(303 - 255) + chr(2966 - 2855) + chr(0b110011) + '\x36' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(0b110001) + chr(54) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(48) + chr(226 - 176), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(51) + '\062' + chr(55), 0b1000), ehT0Px3KOsy9(chr(1618 - 1570) + chr(0b1101111) + '\x32' + chr(2687 - 2635) + chr(0b110100), 45418 - 45410), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(0b110000) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(55) + chr(1398 - 1346), 0b1000), ehT0Px3KOsy9(chr(499 - 451) + chr(2568 - 2457) + chr(0b110010) + chr(0b110111) + chr(49), 25872 - 25864), ehT0Px3KOsy9('\060' + chr(0b1011010 + 0o25) + '\063' + '\x36' + chr(1115 - 1063), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x34' + chr(0b100001 + 0o20), 8), ehT0Px3KOsy9(chr(271 - 223) + '\157' + '\x36' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101101 + 0o102) + chr(0b110011) + chr(0b101 + 0o56) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11490 - 11379) + '\063' + '\x34' + chr(0b10100 + 0o37), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001010 + 0o45) + '\061' + chr(0b110110) + chr(676 - 624), 55627 - 55619)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2542 - 2489) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'P'), chr(100) + chr(101) + chr(0b1011001 + 0o12) + '\x6f' + '\144' + '\145')(chr(117) + chr(0b10100 + 0o140) + '\146' + '\x2d' + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def eI3weCqOA7C6(oVre8I6UXc3b, R6218UBYa3T8, KhzrMpzISODo=ehT0Px3KOsy9('\060' + chr(111) + chr(0b110000), 0o10)): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x17e\xc8M\xac<i'), chr(0b1100100) + chr(101) + chr(0b1111 + 0o124) + '\157' + chr(100) + '\x65')('\165' + chr(0b1010111 + 0o35) + chr(0b1100110) + chr(45) + chr(2467 - 2411))) if not bAgBF7jXI53B(R6218UBYa3T8): R6218UBYa3T8 = [R6218UBYa3T8] vtFm0h5piBgB = MVEN8G6CxlvR(YyaZ4tpXu4lf(R6218UBYa3T8)) NYdqA7LfA4xB = vtFm0h5piBgB - MVEN8G6CxlvR(oVre8I6UXc3b.dtype.mZZDAT49UzAb) QVK8u7RnAnpO = [qzn1Ctg9WgNh for qzn1Ctg9WgNh in oVre8I6UXc3b.dtype.mZZDAT49UzAb if qzn1Ctg9WgNh not in vtFm0h5piBgB] if UVSi4XW7eBIM(yBUx5qcFiTz6(R6218UBYa3T8)): NYdqA7LfA4xB = [OeWW0F1dBPRQ for OeWW0F1dBPRQ in NYdqA7LfA4xB if QYo7qglrtH1q(OeWW0F1dBPRQ)] QVK8u7RnAnpO = [OeWW0F1dBPRQ for OeWW0F1dBPRQ in QVK8u7RnAnpO if QYo7qglrtH1q(OeWW0F1dBPRQ)] if c2A0yzQpDQB3(NYdqA7LfA4xB) != ehT0Px3KOsy9(chr(106 - 58) + '\157' + '\060', 8): jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'\x0cn\xd5N\xbb>`x\x8e\xf78\xf7C7\x95\x9b\x93\x8a\x9a~J\xfft?\x14\x82\x96P!\xb6\xd0\xa2\xdb\xd6\x86HW\xac\xd9T\x05e\xd7U\x926bh\xc2\xef)\xe1S6\x87\x8a'), chr(100) + '\x65' + chr(0b1100011) + '\x6f' + chr(100) + '\145')(chr(708 - 591) + chr(116) + chr(102) + chr(0b101000 + 0o5) + '\x38') raise q1QCh3W88sgk(xafqLlk3kkUe(jtbovtaIYjRB, xafqLlk3kkUe(SXOLrMavuUCe(b'\x18d\xcaL\xac+'), chr(0b1100100) + '\x65' + chr(99) + chr(0b1101111) + chr(0b111111 + 0o45) + '\x65')('\x75' + chr(116) + chr(0b1100110) + chr(1769 - 1724) + chr(56)))(not_included=NYdqA7LfA4xB)) return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\rn\xcc~\xae>xn\xc9\xf5?\xedRd'), chr(7552 - 7452) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(7506 - 7406) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\146' + chr(45) + chr(0b111000)))(QVK8u7RnAnpO, ordered=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x11y\xdcD\xbf:h'), '\x64' + chr(0b0 + 0o145) + chr(0b11011 + 0o110) + '\157' + chr(7133 - 7033) + '\x65')('\165' + chr(0b1110100) + '\x66' + chr(0b101101) + chr(1696 - 1640))), rename=ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b110011 + 0o74) + chr(0b110000), 8), inplace=KhzrMpzISODo)
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.remove_unused_categories
def remove_unused_categories(self, inplace=False): """ Remove categories which are not used. Parameters ---------- inplace : bool, default False Whether or not to drop unused categories inplace or return a copy of this categorical with unused categories dropped. Returns ------- cat : Categorical with unused categories dropped or None if inplace. See Also -------- rename_categories reorder_categories add_categories remove_categories set_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') cat = self if inplace else self.copy() idx, inv = np.unique(cat._codes, return_inverse=True) if idx.size != 0 and idx[0] == -1: # na sentinel idx, inv = idx[1:], inv - 1 new_categories = cat.dtype.categories.take(idx) new_dtype = CategoricalDtype._from_fastpath(new_categories, ordered=self.ordered) cat._dtype = new_dtype cat._codes = coerce_indexer_dtype(inv, new_dtype.categories) if not inplace: return cat
python
def remove_unused_categories(self, inplace=False): """ Remove categories which are not used. Parameters ---------- inplace : bool, default False Whether or not to drop unused categories inplace or return a copy of this categorical with unused categories dropped. Returns ------- cat : Categorical with unused categories dropped or None if inplace. See Also -------- rename_categories reorder_categories add_categories remove_categories set_categories """ inplace = validate_bool_kwarg(inplace, 'inplace') cat = self if inplace else self.copy() idx, inv = np.unique(cat._codes, return_inverse=True) if idx.size != 0 and idx[0] == -1: # na sentinel idx, inv = idx[1:], inv - 1 new_categories = cat.dtype.categories.take(idx) new_dtype = CategoricalDtype._from_fastpath(new_categories, ordered=self.ordered) cat._dtype = new_dtype cat._codes = coerce_indexer_dtype(inv, new_dtype.categories) if not inplace: return cat
[ "def", "remove_unused_categories", "(", "self", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "cat", "=", "self", "if", "inplace", "else", "self", ".", "copy", "(", ")", "idx", ",", "inv", "=", "np", ".", "unique", "(", "cat", ".", "_codes", ",", "return_inverse", "=", "True", ")", "if", "idx", ".", "size", "!=", "0", "and", "idx", "[", "0", "]", "==", "-", "1", ":", "# na sentinel", "idx", ",", "inv", "=", "idx", "[", "1", ":", "]", ",", "inv", "-", "1", "new_categories", "=", "cat", ".", "dtype", ".", "categories", ".", "take", "(", "idx", ")", "new_dtype", "=", "CategoricalDtype", ".", "_from_fastpath", "(", "new_categories", ",", "ordered", "=", "self", ".", "ordered", ")", "cat", ".", "_dtype", "=", "new_dtype", "cat", ".", "_codes", "=", "coerce_indexer_dtype", "(", "inv", ",", "new_dtype", ".", "categories", ")", "if", "not", "inplace", ":", "return", "cat" ]
Remove categories which are not used. Parameters ---------- inplace : bool, default False Whether or not to drop unused categories inplace or return a copy of this categorical with unused categories dropped. Returns ------- cat : Categorical with unused categories dropped or None if inplace. See Also -------- rename_categories reorder_categories add_categories remove_categories set_categories
[ "Remove", "categories", "which", "are", "not", "used", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1088-L1124
train
Returns a copy of the Categorical with unused categories dropped.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp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SX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b101101 + 0o12) + chr(1007 - 954), 30763 - 30755), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100000 + 0o21) + '\x35' + chr(1758 - 1709), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10000 + 0o43) + chr(0b11001 + 0o27) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(2012 - 1959) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(466 - 418) + chr(0b1101111) + chr(51) + chr(0b110110) + chr(48), 35799 - 35791), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(0b110000) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1057 - 1009) + chr(8928 - 8817) + '\x31' + chr(0b1001 + 0o50) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(0b11010 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100001 + 0o22) + '\066', 39601 - 39593), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(0b110000 + 0o2) + '\x31' + chr(0b1111 + 0o50), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\066', 0b1000), ehT0Px3KOsy9(chr(69 - 21) + chr(0b1011010 + 0o25) + chr(2326 - 2277) + chr(0b10 + 0o65) + chr(0b10001 + 0o44), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9749 - 9638) + '\x33' + chr(0b110101), 8), ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + chr(0b111 + 0o53) + chr(55) + '\063', 65070 - 65062), ehT0Px3KOsy9('\x30' + chr(0b1011101 + 0o22) + chr(0b110110) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\065', 8), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1100010 + 0o15) + chr(163 - 112) + chr(55) + chr(283 - 233), ord("\x08")), ehT0Px3KOsy9(chr(1962 - 1914) + chr(0b110101 + 0o72) + '\067' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011 + 0o144) + '\067' + chr(1801 - 1746), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(55) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(831 - 783) + chr(111) + '\061' + '\x37' + '\x36', 17711 - 17703), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(93 - 43) + chr(794 - 740) + chr(2320 - 2266), 0o10), ehT0Px3KOsy9('\060' + chr(10708 - 10597) + '\062' + '\066' + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100101 + 0o16) + '\067' + chr(2888 - 2834), ord("\x08")), ehT0Px3KOsy9(chr(2231 - 2183) + chr(111) + '\x37' + '\063', 27140 - 27132), ehT0Px3KOsy9('\060' + chr(0b111011 + 0o64) + chr(0b100001 + 0o22) + '\x33' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111 + 0o0) + chr(0b1101 + 0o50) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110111) + chr(0b110001 + 0o1), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(7580 - 7469) + chr(1287 - 1237) + chr(0b110011) + '\x35', 0o10), ehT0Px3KOsy9('\060' + chr(0b111110 + 0o61) + chr(0b110011) + '\060' + chr(1391 - 1337), 8), ehT0Px3KOsy9('\060' + chr(0b110111 + 0o70) + '\063' + chr(0b1110 + 0o44) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(54) + '\x33', 53961 - 53953), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b110111) + '\061', 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(11163 - 11052) + chr(1094 - 1045) + '\060' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(0b110100) + chr(0b101 + 0o56), 0o10), ehT0Px3KOsy9(chr(1312 - 1264) + '\x6f' + chr(0b110000 + 0o3) + chr(2058 - 2007) + chr(0b101001 + 0o13), 17812 - 17804), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(55) + chr(0b1001 + 0o56), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(296 - 246) + chr(49) + chr(0b110 + 0o52), 0b1000), ehT0Px3KOsy9(chr(1354 - 1306) + chr(281 - 170) + chr(0b11100 + 0o27) + chr(0b1001 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(412 - 359), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(11802 - 11691) + chr(53) + chr(0b10111 + 0o31), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3'), '\x64' + chr(101) + '\x63' + chr(9936 - 9825) + '\x64' + chr(0b1000111 + 0o36))('\165' + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b11100 + 0o34)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def ZUGds4TDZ2hq(oVre8I6UXc3b, KhzrMpzISODo=ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\060', 0b1000)): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x94\x07\xb6\xc7\x91\xa7,'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(101))(chr(0b1001011 + 0o52) + '\x74' + '\146' + chr(45) + chr(2687 - 2631))) re0VVGAVKu27 = oVre8I6UXc3b if KhzrMpzISODo else oVre8I6UXc3b.igThHS4jwVsa() (YlqusYB6InkM, b4EpukviFgdO) = WqUC3KWvYVup.unique(re0VVGAVKu27.d5BDZJl_zDsu, return_inverse=ehT0Px3KOsy9('\060' + '\157' + '\061', 0o10)) if xafqLlk3kkUe(YlqusYB6InkM, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e\x00\xbc\xce'), chr(0b100011 + 0o101) + '\x65' + '\x63' + '\157' + '\x64' + chr(101))(chr(117) + '\164' + '\x66' + '\x2d' + chr(0b110101 + 0o3))) != ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\060', 8) and YlqusYB6InkM[ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1101111) + chr(2047 - 1999), 8)] == -ehT0Px3KOsy9('\060' + '\x6f' + chr(49), 8): (YlqusYB6InkM, b4EpukviFgdO) = (YlqusYB6InkM[ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(0b110001), 8):], b4EpukviFgdO - ehT0Px3KOsy9(chr(1116 - 1068) + chr(111) + chr(0b110001), 8)) QVK8u7RnAnpO = re0VVGAVKu27.dtype.categories.take(YlqusYB6InkM) H6Aqpf9qhdEs = CBSVoRj_kvTn._from_fastpath(QVK8u7RnAnpO, ordered=oVre8I6UXc3b.ordered) re0VVGAVKu27.z2oVGDR5m1eh = H6Aqpf9qhdEs re0VVGAVKu27.d5BDZJl_zDsu = IhoUBFeIAvnv(b4EpukviFgdO, H6Aqpf9qhdEs.mZZDAT49UzAb) if not KhzrMpzISODo: return re0VVGAVKu27
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.map
def map(self, mapper): """ Map categories using input correspondence (dict, Series, or function). Maps the categories to new categories. If the mapping correspondence is one-to-one the result is a :class:`~pandas.Categorical` which has the same order property as the original, otherwise a :class:`~pandas.Index` is returned. NaN values are unaffected. If a `dict` or :class:`~pandas.Series` is used any unmapped category is mapped to `NaN`. Note that if this happens an :class:`~pandas.Index` will be returned. Parameters ---------- mapper : function, dict, or Series Mapping correspondence. Returns ------- pandas.Categorical or pandas.Index Mapped categorical. See Also -------- CategoricalIndex.map : Apply a mapping correspondence on a :class:`~pandas.CategoricalIndex`. Index.map : Apply a mapping correspondence on an :class:`~pandas.Index`. Series.map : Apply a mapping correspondence on a :class:`~pandas.Series`. Series.apply : Apply more complex functions on a :class:`~pandas.Series`. Examples -------- >>> cat = pd.Categorical(['a', 'b', 'c']) >>> cat [a, b, c] Categories (3, object): [a, b, c] >>> cat.map(lambda x: x.upper()) [A, B, C] Categories (3, object): [A, B, C] >>> cat.map({'a': 'first', 'b': 'second', 'c': 'third'}) [first, second, third] Categories (3, object): [first, second, third] If the mapping is one-to-one the ordering of the categories is preserved: >>> cat = pd.Categorical(['a', 'b', 'c'], ordered=True) >>> cat [a, b, c] Categories (3, object): [a < b < c] >>> cat.map({'a': 3, 'b': 2, 'c': 1}) [3, 2, 1] Categories (3, int64): [3 < 2 < 1] If the mapping is not one-to-one an :class:`~pandas.Index` is returned: >>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'}) Index(['first', 'second', 'first'], dtype='object') If a `dict` is used, all unmapped categories are mapped to `NaN` and the result is an :class:`~pandas.Index`: >>> cat.map({'a': 'first', 'b': 'second'}) Index(['first', 'second', nan], dtype='object') """ new_categories = self.categories.map(mapper) try: return self.from_codes(self._codes.copy(), categories=new_categories, ordered=self.ordered) except ValueError: # NA values are represented in self._codes with -1 # np.take causes NA values to take final element in new_categories if np.any(self._codes == -1): new_categories = new_categories.insert(len(new_categories), np.nan) return np.take(new_categories, self._codes)
python
def map(self, mapper): """ Map categories using input correspondence (dict, Series, or function). Maps the categories to new categories. If the mapping correspondence is one-to-one the result is a :class:`~pandas.Categorical` which has the same order property as the original, otherwise a :class:`~pandas.Index` is returned. NaN values are unaffected. If a `dict` or :class:`~pandas.Series` is used any unmapped category is mapped to `NaN`. Note that if this happens an :class:`~pandas.Index` will be returned. Parameters ---------- mapper : function, dict, or Series Mapping correspondence. Returns ------- pandas.Categorical or pandas.Index Mapped categorical. See Also -------- CategoricalIndex.map : Apply a mapping correspondence on a :class:`~pandas.CategoricalIndex`. Index.map : Apply a mapping correspondence on an :class:`~pandas.Index`. Series.map : Apply a mapping correspondence on a :class:`~pandas.Series`. Series.apply : Apply more complex functions on a :class:`~pandas.Series`. Examples -------- >>> cat = pd.Categorical(['a', 'b', 'c']) >>> cat [a, b, c] Categories (3, object): [a, b, c] >>> cat.map(lambda x: x.upper()) [A, B, C] Categories (3, object): [A, B, C] >>> cat.map({'a': 'first', 'b': 'second', 'c': 'third'}) [first, second, third] Categories (3, object): [first, second, third] If the mapping is one-to-one the ordering of the categories is preserved: >>> cat = pd.Categorical(['a', 'b', 'c'], ordered=True) >>> cat [a, b, c] Categories (3, object): [a < b < c] >>> cat.map({'a': 3, 'b': 2, 'c': 1}) [3, 2, 1] Categories (3, int64): [3 < 2 < 1] If the mapping is not one-to-one an :class:`~pandas.Index` is returned: >>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'}) Index(['first', 'second', 'first'], dtype='object') If a `dict` is used, all unmapped categories are mapped to `NaN` and the result is an :class:`~pandas.Index`: >>> cat.map({'a': 'first', 'b': 'second'}) Index(['first', 'second', nan], dtype='object') """ new_categories = self.categories.map(mapper) try: return self.from_codes(self._codes.copy(), categories=new_categories, ordered=self.ordered) except ValueError: # NA values are represented in self._codes with -1 # np.take causes NA values to take final element in new_categories if np.any(self._codes == -1): new_categories = new_categories.insert(len(new_categories), np.nan) return np.take(new_categories, self._codes)
[ "def", "map", "(", "self", ",", "mapper", ")", ":", "new_categories", "=", "self", ".", "categories", ".", "map", "(", "mapper", ")", "try", ":", "return", "self", ".", "from_codes", "(", "self", ".", "_codes", ".", "copy", "(", ")", ",", "categories", "=", "new_categories", ",", "ordered", "=", "self", ".", "ordered", ")", "except", "ValueError", ":", "# NA values are represented in self._codes with -1", "# np.take causes NA values to take final element in new_categories", "if", "np", ".", "any", "(", "self", ".", "_codes", "==", "-", "1", ")", ":", "new_categories", "=", "new_categories", ".", "insert", "(", "len", "(", "new_categories", ")", ",", "np", ".", "nan", ")", "return", "np", ".", "take", "(", "new_categories", ",", "self", ".", "_codes", ")" ]
Map categories using input correspondence (dict, Series, or function). Maps the categories to new categories. If the mapping correspondence is one-to-one the result is a :class:`~pandas.Categorical` which has the same order property as the original, otherwise a :class:`~pandas.Index` is returned. NaN values are unaffected. If a `dict` or :class:`~pandas.Series` is used any unmapped category is mapped to `NaN`. Note that if this happens an :class:`~pandas.Index` will be returned. Parameters ---------- mapper : function, dict, or Series Mapping correspondence. Returns ------- pandas.Categorical or pandas.Index Mapped categorical. See Also -------- CategoricalIndex.map : Apply a mapping correspondence on a :class:`~pandas.CategoricalIndex`. Index.map : Apply a mapping correspondence on an :class:`~pandas.Index`. Series.map : Apply a mapping correspondence on a :class:`~pandas.Series`. Series.apply : Apply more complex functions on a :class:`~pandas.Series`. Examples -------- >>> cat = pd.Categorical(['a', 'b', 'c']) >>> cat [a, b, c] Categories (3, object): [a, b, c] >>> cat.map(lambda x: x.upper()) [A, B, C] Categories (3, object): [A, B, C] >>> cat.map({'a': 'first', 'b': 'second', 'c': 'third'}) [first, second, third] Categories (3, object): [first, second, third] If the mapping is one-to-one the ordering of the categories is preserved: >>> cat = pd.Categorical(['a', 'b', 'c'], ordered=True) >>> cat [a, b, c] Categories (3, object): [a < b < c] >>> cat.map({'a': 3, 'b': 2, 'c': 1}) [3, 2, 1] Categories (3, int64): [3 < 2 < 1] If the mapping is not one-to-one an :class:`~pandas.Index` is returned: >>> cat.map({'a': 'first', 'b': 'second', 'c': 'first'}) Index(['first', 'second', 'first'], dtype='object') If a `dict` is used, all unmapped categories are mapped to `NaN` and the result is an :class:`~pandas.Index`: >>> cat.map({'a': 'first', 'b': 'second'}) Index(['first', 'second', nan], dtype='object')
[ "Map", "categories", "using", "input", "correspondence", "(", "dict", "Series", "or", "function", ")", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1126-L1206
train
Maps the categories of the a log entry to new categories.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,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roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1871 - 1823) + chr(1001 - 890) + '\x31' + '\x35' + chr(0b100100 + 0o14), 38838 - 38830), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + '\x33' + '\065', 24040 - 24032), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + '\x31' + '\x35', 60250 - 60242), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100010 + 0o20) + '\x37' + chr(0b10101 + 0o33), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(1567 - 1518) + '\x35' + '\x34', 63465 - 63457), ehT0Px3KOsy9(chr(1364 - 1316) + '\157' + chr(0b100100 + 0o15) + chr(52) + chr(0b110100), 43647 - 43639), ehT0Px3KOsy9(chr(65 - 17) + chr(0b1001100 + 0o43) + chr(709 - 660) + chr(0b100110 + 0o15) + '\066', 9761 - 9753), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\x35' + '\x34', 8), ehT0Px3KOsy9(chr(48) + chr(0b10011 + 0o134) + '\061' + chr(0b100100 + 0o16) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10011 + 0o36) + '\x34' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(0b11001 + 0o30) + chr(731 - 683) + '\063', 33352 - 33344), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(1212 - 1161) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + '\063' + '\066' + chr(0b110001 + 0o5), 0o10), ehT0Px3KOsy9('\x30' + chr(2680 - 2569) + '\x33' + chr(51) + chr(488 - 437), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + '\065' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + '\x37' + '\x30', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(52) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(1997 - 1949) + chr(0b110111 + 0o70) + chr(0b11001 + 0o30) + '\063' + chr(0b10110 + 0o33), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(995 - 944) + '\x31' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2422 - 2371) + chr(0b11010 + 0o31) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(823 - 774) + chr(1266 - 1212), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x37' + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\067' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111010 + 0o65) + chr(683 - 631) + chr(329 - 279), 11550 - 11542), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + chr(0b110010) + chr(0b1001 + 0o54) + chr(55), 17243 - 17235), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110001 + 0o2) + '\066', 0o10), ehT0Px3KOsy9(chr(2081 - 2033) + '\157' + '\061' + chr(0b110111) + chr(2296 - 2247), 55738 - 55730), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11100 + 0o25) + chr(1249 - 1198) + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(3804 - 3693) + '\061' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(822 - 772) + chr(0b110000) + chr(0b110111), 61863 - 61855), ehT0Px3KOsy9(chr(0b110000) + chr(0b110010 + 0o75) + chr(0b11011 + 0o27) + chr(0b1011 + 0o53) + chr(356 - 303), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(990 - 939) + '\x30' + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1001 + 0o52) + '\061' + '\063', 0b1000), ehT0Px3KOsy9(chr(1643 - 1595) + chr(111) + chr(1011 - 960) + chr(51) + chr(0b10110 + 0o41), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(10203 - 10092) + chr(49) + chr(0b110010) + chr(0b110001), 29522 - 29514), ehT0Px3KOsy9(chr(2150 - 2102) + chr(11346 - 11235) + chr(0b11100 + 0o25) + '\062' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(1864 - 1813) + chr(0b110010), 8), ehT0Px3KOsy9(chr(372 - 324) + chr(0b10011 + 0o134) + '\x31' + chr(2429 - 2377) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3481 - 3370) + '\x31' + chr(50) + '\061', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(2005 - 1957) + '\x6f' + chr(53) + chr(212 - 164), 65536 - 65528)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'F'), '\144' + '\x65' + chr(7525 - 7426) + chr(111) + chr(0b1100100) + '\145')(chr(0b100000 + 0o125) + chr(13119 - 13003) + chr(0b1100110) + chr(333 - 288) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def abA97kOQKaLo(oVre8I6UXc3b, vfywGHKHySeN): QVK8u7RnAnpO = oVre8I6UXc3b.categories.map(vfywGHKHySeN) try: return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e\xef\xe2\xd53\x071\x081\x16'), '\x64' + '\145' + '\143' + chr(111) + '\144' + '\x65')(chr(10635 - 10518) + chr(0b11010 + 0o132) + '\x66' + '\x2d' + chr(56)))(xafqLlk3kkUe(oVre8I6UXc3b._codes, xafqLlk3kkUe(SXOLrMavuUCe(b'\x01\xfa\xd9\xd0$7j\x06#30\xfb'), chr(0b1010001 + 0o23) + '\145' + chr(0b1100011) + chr(111) + chr(100) + chr(9453 - 9352))(chr(117) + chr(0b1010 + 0o152) + chr(0b1100110) + chr(45) + chr(0b111000)))(), categories=QVK8u7RnAnpO, ordered=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x07\xef\xe9\xdd\x1e\x01:'), chr(0b1100100 + 0o0) + '\x65' + '\143' + chr(0b1011001 + 0o26) + chr(100) + chr(0b1100101))(chr(7003 - 6886) + chr(0b1000111 + 0o55) + chr(0b1100110) + chr(0b1111 + 0o36) + chr(0b11100 + 0o34)))) except q1QCh3W88sgk: if xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b"=\xcb\xde\xd1X<\t[1'\n\xd7"), chr(0b1011000 + 0o14) + chr(101) + chr(0b1000110 + 0o35) + '\x6f' + chr(100) + chr(3093 - 2992))(chr(2782 - 2665) + chr(116) + chr(0b10110 + 0o120) + chr(0b101101 + 0o0) + chr(1579 - 1523)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\xa8\xcf\xfc6.23.!0\xef'), '\144' + chr(101) + chr(0b1100011) + chr(4277 - 4166) + chr(7462 - 7362) + chr(5736 - 5635))('\x75' + '\164' + chr(2274 - 2172) + chr(558 - 513) + chr(2179 - 2123))) == -ehT0Px3KOsy9(chr(1365 - 1317) + chr(0b1101111) + chr(1001 - 952), 0o10)): QVK8u7RnAnpO = QVK8u7RnAnpO.insert(c2A0yzQpDQB3(QVK8u7RnAnpO), WqUC3KWvYVup.nan) return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1c\xfc\xe6\xdd'), '\144' + chr(101) + '\143' + '\x6f' + '\144' + chr(0b1100101))(chr(5687 - 5570) + chr(0b1110100) + chr(0b1100101 + 0o1) + chr(0b101101) + '\070'))(QVK8u7RnAnpO, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\xa8\xcf\xfc6.23.!0\xef'), chr(0b1100100) + '\145' + chr(99) + '\x6f' + '\x64' + chr(101))('\165' + chr(0b1110100) + '\146' + '\055' + '\070')))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.shift
def shift(self, periods, fill_value=None): """ Shift Categorical by desired number of periods. Parameters ---------- periods : int Number of periods to move, can be positive or negative fill_value : object, optional The scalar value to use for newly introduced missing values. .. versionadded:: 0.24.0 Returns ------- shifted : Categorical """ # since categoricals always have ndim == 1, an axis parameter # doesn't make any sense here. codes = self.codes if codes.ndim > 1: raise NotImplementedError("Categorical with ndim > 1.") if np.prod(codes.shape) and (periods != 0): codes = np.roll(codes, ensure_platform_int(periods), axis=0) if isna(fill_value): fill_value = -1 elif fill_value in self.categories: fill_value = self.categories.get_loc(fill_value) else: raise ValueError("'fill_value={}' is not present " "in this Categorical's " "categories".format(fill_value)) if periods > 0: codes[:periods] = fill_value else: codes[periods:] = fill_value return self.from_codes(codes, dtype=self.dtype)
python
def shift(self, periods, fill_value=None): """ Shift Categorical by desired number of periods. Parameters ---------- periods : int Number of periods to move, can be positive or negative fill_value : object, optional The scalar value to use for newly introduced missing values. .. versionadded:: 0.24.0 Returns ------- shifted : Categorical """ # since categoricals always have ndim == 1, an axis parameter # doesn't make any sense here. codes = self.codes if codes.ndim > 1: raise NotImplementedError("Categorical with ndim > 1.") if np.prod(codes.shape) and (periods != 0): codes = np.roll(codes, ensure_platform_int(periods), axis=0) if isna(fill_value): fill_value = -1 elif fill_value in self.categories: fill_value = self.categories.get_loc(fill_value) else: raise ValueError("'fill_value={}' is not present " "in this Categorical's " "categories".format(fill_value)) if periods > 0: codes[:periods] = fill_value else: codes[periods:] = fill_value return self.from_codes(codes, dtype=self.dtype)
[ "def", "shift", "(", "self", ",", "periods", ",", "fill_value", "=", "None", ")", ":", "# since categoricals always have ndim == 1, an axis parameter", "# doesn't make any sense here.", "codes", "=", "self", ".", "codes", "if", "codes", ".", "ndim", ">", "1", ":", "raise", "NotImplementedError", "(", "\"Categorical with ndim > 1.\"", ")", "if", "np", ".", "prod", "(", "codes", ".", "shape", ")", "and", "(", "periods", "!=", "0", ")", ":", "codes", "=", "np", ".", "roll", "(", "codes", ",", "ensure_platform_int", "(", "periods", ")", ",", "axis", "=", "0", ")", "if", "isna", "(", "fill_value", ")", ":", "fill_value", "=", "-", "1", "elif", "fill_value", "in", "self", ".", "categories", ":", "fill_value", "=", "self", ".", "categories", ".", "get_loc", "(", "fill_value", ")", "else", ":", "raise", "ValueError", "(", "\"'fill_value={}' is not present \"", "\"in this Categorical's \"", "\"categories\"", ".", "format", "(", "fill_value", ")", ")", "if", "periods", ">", "0", ":", "codes", "[", ":", "periods", "]", "=", "fill_value", "else", ":", "codes", "[", "periods", ":", "]", "=", "fill_value", "return", "self", ".", "from_codes", "(", "codes", ",", "dtype", "=", "self", ".", "dtype", ")" ]
Shift Categorical by desired number of periods. Parameters ---------- periods : int Number of periods to move, can be positive or negative fill_value : object, optional The scalar value to use for newly introduced missing values. .. versionadded:: 0.24.0 Returns ------- shifted : Categorical
[ "Shift", "Categorical", "by", "desired", "number", "of", "periods", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1230-L1267
train
Shifts the categorical by desired number of periods.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,p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UzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1882 - 1834) + '\157' + '\x33' + chr(48), 57860 - 57852), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b11001 + 0o35) + chr(54), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(2653 - 2601), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6970 - 6859) + chr(49) + '\x31' + chr(53), 5144 - 5136), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + '\x33' + '\065' + chr(0b111 + 0o57), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100111 + 0o14) + '\061' + chr(2023 - 1973), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110110) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1599 - 1549) + chr(51) + chr(1966 - 1914), 0o10), ehT0Px3KOsy9(chr(504 - 456) + chr(0b1101111) + '\063' + chr(0b110010) + chr(0b100110 + 0o15), 58288 - 58280), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10001 + 0o42) + chr(0b1010 + 0o51) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(0b101110 + 0o4) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(0b111 + 0o54) + chr(0b110101) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(4090 - 3979) + '\x31' + '\x33', 0b1000), ehT0Px3KOsy9(chr(1556 - 1508) + chr(111) + '\x31' + chr(0b110010) + chr(0b110100), 17890 - 17882), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\157' + chr(49) + chr(0b1011 + 0o45) + chr(710 - 656), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b0 + 0o62) + '\x33' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + '\063' + chr(55) + '\x35', 0b1000), ehT0Px3KOsy9(chr(800 - 752) + chr(0b11110 + 0o121) + '\061' + chr(0b1010 + 0o54) + '\x35', 35131 - 35123), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\067' + chr(863 - 812), 0b1000), ehT0Px3KOsy9(chr(715 - 667) + chr(0b1001111 + 0o40) + chr(50) + '\x31' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(650 - 601) + chr(0b110100) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + chr(53 - 5), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10111 + 0o130) + chr(0b110001) + '\x36' + chr(53), 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + '\x33' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b110111) + chr(1681 - 1633), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(55) + chr(51), 8), ehT0Px3KOsy9('\x30' + chr(9712 - 9601) + chr(1188 - 1138) + chr(0b101100 + 0o12) + chr(53), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101010 + 0o11) + '\x31' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b110100) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1650 - 1601) + chr(451 - 402) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(1303 - 1255) + '\157' + chr(54) + '\x30', 8), ehT0Px3KOsy9('\060' + chr(111) + '\x34' + '\x35', 23238 - 23230), ehT0Px3KOsy9(chr(2207 - 2159) + '\x6f' + '\063' + '\x31' + chr(1838 - 1783), 8), ehT0Px3KOsy9('\x30' + chr(0b1100 + 0o143) + chr(0b11101 + 0o25) + '\x36' + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b110111) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\x30' + chr(0b100110 + 0o14), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(0b100000 + 0o22) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100101 + 0o17) + chr(1023 - 974), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(2598 - 2546) + chr(49), 8), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + '\x35' + '\x30', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + chr(1944 - 1891) + chr(0b100011 + 0o15), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'6'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1101111) + '\x64' + '\145')(chr(0b1110101) + '\164' + '\146' + '\055' + '\070') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def LnbELFj1hfyx(oVre8I6UXc3b, JSLL1jbGbEMC, RlLNSsrUm3zD=None): AoWJEgIAbHh_ = oVre8I6UXc3b.codes if xafqLlk3kkUe(AoWJEgIAbHh_, xafqLlk3kkUe(SXOLrMavuUCe(b'\x7f\x99y=\xa6\x88Y\xc8\xa0\xb8\xda\xb8'), '\144' + chr(0b1100101) + chr(99) + chr(129 - 18) + chr(100) + '\x65')(chr(0b111101 + 0o70) + chr(559 - 443) + chr(7739 - 7637) + '\055' + chr(56))) > ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101100 + 0o5), 48328 - 48320): raise _zJ24Vce7wp0(xafqLlk3kkUe(SXOLrMavuUCe(b'[\x97`(\x89\xa5B\xf5\xb0\xbf\xfc\xcc|=2\xf7\xdd\x1b\x1f\xe6\r\x08K\xffIU'), chr(6837 - 6737) + '\x65' + chr(0b1100011) + chr(0b11010 + 0o125) + chr(0b1011100 + 0o10) + chr(101))('\x75' + '\164' + chr(102) + chr(0b101101) + '\x38')) if xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b't\xb4M&\xd9\xf3\\\xa8\x9d\xb5\xa8\x84'), '\x64' + chr(4581 - 4480) + chr(0b1 + 0o142) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1110100) + '\146' + chr(0b101101) + '\x38'))(xafqLlk3kkUe(AoWJEgIAbHh_, xafqLlk3kkUe(SXOLrMavuUCe(b'k\x9eu=\x8b'), '\144' + chr(0b10110 + 0o117) + chr(99) + chr(0b111001 + 0o66) + chr(100) + '\145')(chr(6205 - 6088) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b111000)))) and JSLL1jbGbEMC != ehT0Px3KOsy9('\x30' + chr(0b100110 + 0o111) + '\060', ord("\x08")): AoWJEgIAbHh_ = WqUC3KWvYVup.roll(AoWJEgIAbHh_, lMS4d2uXyrnw(JSLL1jbGbEMC), axis=ehT0Px3KOsy9('\060' + '\157' + chr(505 - 457), 8)) if yBUx5qcFiTz6(RlLNSsrUm3zD): RlLNSsrUm3zD = -ehT0Px3KOsy9(chr(181 - 133) + chr(6827 - 6716) + chr(1369 - 1320), 8) elif RlLNSsrUm3zD in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'u\xacN\t\xaf\x9e\x04\xa5\x86\xa4\xd1\x8e'), '\x64' + '\145' + chr(0b1100011) + chr(111) + chr(2190 - 2090) + chr(8905 - 8804))(chr(0b1001110 + 0o47) + chr(116) + chr(0b1011100 + 0o12) + chr(45) + '\070')): RlLNSsrUm3zD = oVre8I6UXc3b.categories.get_loc(RlLNSsrUm3zD) else: raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"?\x90}!\x82\x95F\xfd\xbf\xab\xf5\xd1p)a\xbf\x94\x06[\xe1\x0f\\U\xaf\n\x1e\xc6\xaa\x0f=\x10L\xa1\x94\n*\xbbR\x01ky\x82q*\x81\xb8Y\xff\xb2\xb2\xb7\x9f+7'\xeb\x98\x12\x14\xfd\tM\x06"), chr(100) + chr(0b11 + 0o142) + chr(99) + chr(111) + '\144' + '\145')(chr(4854 - 4737) + chr(0b1000101 + 0o57) + chr(0b1100110) + chr(985 - 940) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'~\x99f \x8f\xbe'), chr(100) + '\145' + chr(99) + chr(0b1101111) + chr(100) + chr(0b111100 + 0o51))('\x75' + chr(0b1000101 + 0o57) + '\146' + '\055' + '\070'))(RlLNSsrUm3zD)) if JSLL1jbGbEMC > ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(48), 8): AoWJEgIAbHh_[:JSLL1jbGbEMC] = RlLNSsrUm3zD else: AoWJEgIAbHh_[JSLL1jbGbEMC:] = RlLNSsrUm3zD return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'~\x84{ \xb1\xa9_\xf8\xb6\xad'), chr(100) + chr(9946 - 9845) + '\x63' + chr(111) + chr(4738 - 4638) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b101001 + 0o4) + chr(0b0 + 0o70)))(AoWJEgIAbHh_, dtype=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'|\x82m=\x8b'), '\144' + chr(0b110011 + 0o62) + chr(8095 - 7996) + chr(0b1101111) + chr(100) + '\145')(chr(0b1110101) + '\x74' + '\146' + '\055' + chr(388 - 332))))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.memory_usage
def memory_usage(self, deep=False): """ Memory usage of my values Parameters ---------- deep : bool Introspect the data deeply, interrogate `object` dtypes for system-level memory consumption Returns ------- bytes used Notes ----- Memory usage does not include memory consumed by elements that are not components of the array if deep=False See Also -------- numpy.ndarray.nbytes """ return self._codes.nbytes + self.dtype.categories.memory_usage( deep=deep)
python
def memory_usage(self, deep=False): """ Memory usage of my values Parameters ---------- deep : bool Introspect the data deeply, interrogate `object` dtypes for system-level memory consumption Returns ------- bytes used Notes ----- Memory usage does not include memory consumed by elements that are not components of the array if deep=False See Also -------- numpy.ndarray.nbytes """ return self._codes.nbytes + self.dtype.categories.memory_usage( deep=deep)
[ "def", "memory_usage", "(", "self", ",", "deep", "=", "False", ")", ":", "return", "self", ".", "_codes", ".", "nbytes", "+", "self", ".", "dtype", ".", "categories", ".", "memory_usage", "(", "deep", "=", "deep", ")" ]
Memory usage of my values Parameters ---------- deep : bool Introspect the data deeply, interrogate `object` dtypes for system-level memory consumption Returns ------- bytes used Notes ----- Memory usage does not include memory consumed by elements that are not components of the array if deep=False See Also -------- numpy.ndarray.nbytes
[ "Memory", "usage", "of", "my", "values" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1331-L1355
train
Return the memory usage of the object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1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g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10101 + 0o35) + '\064' + chr(0b101100 + 0o13), 0o10), ehT0Px3KOsy9(chr(463 - 415) + chr(111) + '\x33' + chr(157 - 108) + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(1484 - 1433) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(388 - 340) + chr(8888 - 8777) + '\063' + chr(52) + chr(580 - 532), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(4869 - 4758) + chr(0b110010) + '\063' + chr(1151 - 1097), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + '\x31' + chr(1290 - 1235), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101001 + 0o6) + chr(0b110001) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(783 - 735) + chr(0b1101111) + chr(1075 - 1023) + chr(0b11010 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(869 - 818) + chr(1212 - 1158) + chr(0b110001 + 0o1), 0b1000), ehT0Px3KOsy9('\x30' + chr(7474 - 7363) + chr(0b110001) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9232 - 9121) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + '\x35', 0o10), ehT0Px3KOsy9('\060' + chr(0b10111 + 0o130) + '\062' + chr(54) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100001 + 0o20) + chr(1170 - 1122) + chr(0b11 + 0o64), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + '\060' + '\062', 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1010011 + 0o34) + chr(1247 - 1196) + chr(1050 - 995) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1 + 0o156) + chr(0b110001) + chr(2165 - 2117) + chr(0b101 + 0o55), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110111) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(5268 - 5157) + '\x33' + '\064' + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + '\x34' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1101111) + '\x31' + '\062', 18790 - 18782), ehT0Px3KOsy9(chr(1172 - 1124) + '\157' + '\062' + chr(0b100001 + 0o22) + chr(2104 - 2049), 8), ehT0Px3KOsy9('\060' + chr(0b11010 + 0o125) + '\065' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11001 + 0o36) + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110010) + chr(54), 8287 - 8279), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111 + 0o0) + chr(1503 - 1453) + chr(1571 - 1518), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\157' + chr(0b110011) + chr(52) + '\066', 0b1000), ehT0Px3KOsy9(chr(2112 - 2064) + chr(3988 - 3877) + chr(0b110001) + chr(2686 - 2631) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2144 - 2094) + chr(0b101010 + 0o11) + chr(0b110111), 8), ehT0Px3KOsy9(chr(964 - 916) + chr(0b1100011 + 0o14) + '\x33' + chr(49) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\x37' + chr(407 - 352), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1110 + 0o141) + chr(1454 - 1403) + chr(0b110101) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + chr(0b110101) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001110 + 0o41) + '\063' + chr(0b110001) + chr(1088 - 1039), 8), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1101111) + chr(0b110110) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(2158 - 2110) + chr(0b1101111) + chr(0b110110) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\067' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6637 - 6526) + '\063' + chr(54) + '\x31', 2732 - 2724), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(1271 - 1220), 8), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(0b110000) + '\x33', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + '\x35' + chr(671 - 623), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x89'), chr(1005 - 905) + '\x65' + '\x63' + '\x6f' + '\x64' + '\x65')('\x75' + '\x74' + chr(6885 - 6783) + chr(1180 - 1135) + chr(56)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def tEc7cnZjmQru(oVre8I6UXc3b, _JgLpamLTDEN=ehT0Px3KOsy9('\x30' + chr(0b1101111 + 0o0) + '\060', 0o10)): return xafqLlk3kkUe(oVre8I6UXc3b._codes, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9\xab\xe6\x94\xfb<'), chr(8631 - 8531) + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1010110 + 0o17))('\165' + chr(0b1110100) + chr(0b10000 + 0o126) + chr(1534 - 1489) + chr(56))) + xafqLlk3kkUe(oVre8I6UXc3b.dtype.categories, xafqLlk3kkUe(SXOLrMavuUCe(b'\xca\xac\xf2\x8f\xec6TT\x81i`x'), '\x64' + chr(8844 - 8743) + chr(0b1100011) + '\157' + '\x64' + '\145')(chr(117) + chr(8409 - 8293) + chr(0b100110 + 0o100) + '\x2d' + '\x38'))(deep=_JgLpamLTDEN)
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.value_counts
def value_counts(self, dropna=True): """ Return a Series containing counts of each category. Every category will have an entry, even those with a count of 0. Parameters ---------- dropna : bool, default True Don't include counts of NaN. Returns ------- counts : Series See Also -------- Series.value_counts """ from numpy import bincount from pandas import Series, CategoricalIndex code, cat = self._codes, self.categories ncat, mask = len(cat), 0 <= code ix, clean = np.arange(ncat), mask.all() if dropna or clean: obs = code if clean else code[mask] count = bincount(obs, minlength=ncat or None) else: count = bincount(np.where(mask, code, ncat)) ix = np.append(ix, -1) ix = self._constructor(ix, dtype=self.dtype, fastpath=True) return Series(count, index=CategoricalIndex(ix), dtype='int64')
python
def value_counts(self, dropna=True): """ Return a Series containing counts of each category. Every category will have an entry, even those with a count of 0. Parameters ---------- dropna : bool, default True Don't include counts of NaN. Returns ------- counts : Series See Also -------- Series.value_counts """ from numpy import bincount from pandas import Series, CategoricalIndex code, cat = self._codes, self.categories ncat, mask = len(cat), 0 <= code ix, clean = np.arange(ncat), mask.all() if dropna or clean: obs = code if clean else code[mask] count = bincount(obs, minlength=ncat or None) else: count = bincount(np.where(mask, code, ncat)) ix = np.append(ix, -1) ix = self._constructor(ix, dtype=self.dtype, fastpath=True) return Series(count, index=CategoricalIndex(ix), dtype='int64')
[ "def", "value_counts", "(", "self", ",", "dropna", "=", "True", ")", ":", "from", "numpy", "import", "bincount", "from", "pandas", "import", "Series", ",", "CategoricalIndex", "code", ",", "cat", "=", "self", ".", "_codes", ",", "self", ".", "categories", "ncat", ",", "mask", "=", "len", "(", "cat", ")", ",", "0", "<=", "code", "ix", ",", "clean", "=", "np", ".", "arange", "(", "ncat", ")", ",", "mask", ".", "all", "(", ")", "if", "dropna", "or", "clean", ":", "obs", "=", "code", "if", "clean", "else", "code", "[", "mask", "]", "count", "=", "bincount", "(", "obs", ",", "minlength", "=", "ncat", "or", "None", ")", "else", ":", "count", "=", "bincount", "(", "np", ".", "where", "(", "mask", ",", "code", ",", "ncat", ")", ")", "ix", "=", "np", ".", "append", "(", "ix", ",", "-", "1", ")", "ix", "=", "self", ".", "_constructor", "(", "ix", ",", "dtype", "=", "self", ".", "dtype", ",", "fastpath", "=", "True", ")", "return", "Series", "(", "count", ",", "index", "=", "CategoricalIndex", "(", "ix", ")", ",", "dtype", "=", "'int64'", ")" ]
Return a Series containing counts of each category. Every category will have an entry, even those with a count of 0. Parameters ---------- dropna : bool, default True Don't include counts of NaN. Returns ------- counts : Series See Also -------- Series.value_counts
[ "Return", "a", "Series", "containing", "counts", "of", "each", "category", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1438-L1475
train
Return a Series containing counts of each category.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,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Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2034 - 1984) + '\064' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(1610 - 1562) + '\157' + chr(0b101101 + 0o7) + chr(2246 - 2194), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(2251 - 2198) + chr(0b11111 + 0o24), 0b1000), ehT0Px3KOsy9(chr(1695 - 1647) + chr(111) + chr(0b110001) + '\060' + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + chr(51) + chr(52) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\x34' + chr(0b110000 + 0o6), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110 + 0o54) + chr(0b110001 + 0o1) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(11791 - 11680) + chr(50) + chr(0b110110) + chr(262 - 208), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1731 - 1682) + chr(0b110101) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110000 + 0o1) + chr(303 - 249) + chr(2595 - 2542), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10111 + 0o33) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(5707 - 5596) + chr(0b0 + 0o61) + chr(505 - 451) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(12187 - 12076) + chr(50) + '\061' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + '\x32' + chr(0b110111) + chr(0b110001), 26028 - 26020), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b110101) + chr(1958 - 1907), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101011 + 0o4) + chr(1134 - 1085) + chr(0b100011 + 0o16) + '\060', 44740 - 44732), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + '\x31' + '\x33' + chr(48), 0o10), ehT0Px3KOsy9(chr(1198 - 1150) + chr(0b1101111) + chr(841 - 790) + chr(529 - 474) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b100101 + 0o112) + chr(0b110010) + '\066' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100000 + 0o24), 0o10), ehT0Px3KOsy9(chr(48) + chr(7054 - 6943) + chr(0b10 + 0o60) + '\x36' + chr(0b100010 + 0o20), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + chr(0b101101 + 0o4) + chr(0b10011 + 0o43) + chr(49), 8), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(0b11100 + 0o27) + chr(0b1 + 0o60) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + '\x33' + chr(0b110001) + chr(0b100010 + 0o24), 31522 - 31514), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\157' + chr(0b110001) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100010 + 0o21) + '\x30' + chr(655 - 605), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11001 + 0o30) + chr(0b110110) + chr(275 - 227), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b11010 + 0o33) + chr(0b11101 + 0o26), 8), ehT0Px3KOsy9(chr(48) + chr(6529 - 6418) + '\x33' + '\066', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(1701 - 1648), 0o10), ehT0Px3KOsy9(chr(1245 - 1197) + chr(253 - 142) + chr(1980 - 1931) + '\060' + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100001 + 0o21) + '\063' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x36' + chr(0b1000 + 0o51), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + chr(51) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(211 - 163) + '\157' + chr(49) + '\x33' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(2230 - 2182) + chr(979 - 868) + chr(0b110010) + chr(363 - 309) + chr(0b101011 + 0o6), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(0b110101) + chr(0b110000), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100011 + 0o20) + chr(0b11 + 0o63) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100100 + 0o113) + '\062' + chr(51) + chr(0b110111), 46424 - 46416), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110001) + chr(2093 - 2045), 63350 - 63342)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x35' + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d'), chr(0b1001100 + 0o30) + chr(2033 - 1932) + chr(4228 - 4129) + chr(11434 - 11323) + chr(100) + chr(0b1100100 + 0o1))('\165' + '\x74' + chr(102) + '\x2d' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def IQY9HknPWsi9(oVre8I6UXc3b, _zTUd6XPn3WJ=ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100001 + 0o20), 0o10)): (Ac06e2ekmtL0,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcdQ\xc61\x98'), '\x64' + chr(0b1100101) + chr(6551 - 6452) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + '\x74' + '\146' + chr(0b10101 + 0o30) + chr(1840 - 1784)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1M\xc5"\x8e\x93\xfd\xc2'), chr(4084 - 3984) + '\x65' + chr(0b1100011) + '\157' + chr(0b1100100) + chr(101))('\165' + chr(116) + chr(0b11000 + 0o116) + chr(0b101101) + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1M\xc5"\x8e\x93\xfd\xc2'), '\144' + '\x65' + chr(8544 - 8445) + chr(5405 - 5294) + chr(6098 - 5998) + chr(0b1100101 + 0o0))(chr(0b1101101 + 0o10) + chr(116) + chr(102) + '\055' + '\070')),) (I9PbrFvU4NYI, YH_C7u76pUaX) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3E\xc5%\x80\x95'), chr(0b1100100) + chr(184 - 83) + chr(99) + chr(111) + '\x64' + chr(0b1000011 + 0o42))(chr(0b1101100 + 0o11) + '\164' + chr(102) + '\x2d' + chr(0b10 + 0o66)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0A\xd9(\x84\x95'), chr(0b111111 + 0o45) + '\x65' + '\143' + '\157' + chr(0b1100100) + chr(7859 - 7758))(chr(0b101011 + 0o112) + chr(0b1101010 + 0o12) + '\146' + '\055' + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0A\xd9(\x84\x95'), '\x64' + chr(0b1100101) + chr(99) + chr(5553 - 5442) + chr(100) + chr(6921 - 6820))(chr(13347 - 13230) + chr(0b1110100) + '\x66' + '\x2d' + '\x38')), xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3E\xc5%\x80\x95'), chr(855 - 755) + chr(0b10001 + 0o124) + chr(0b10101 + 0o116) + '\x6f' + '\x64' + chr(0b1100101))(chr(6424 - 6307) + '\x74' + '\x66' + chr(45) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0E\xdf$\x86\x89\xe1\xdf\x0b\x14{8\xe1\xdd\xce0'), chr(0b11001 + 0o113) + chr(101) + chr(0b1111 + 0o124) + chr(7257 - 7146) + chr(5093 - 4993) + chr(101))(chr(117) + chr(3854 - 3738) + chr(0b1100110) + chr(0b101101) + chr(0b101110 + 0o12))), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0E\xdf$\x86\x89\xe1\xdf\x0b\x14{8\xe1\xdd\xce0'), chr(0b101110 + 0o66) + chr(0b11111 + 0o106) + chr(4545 - 4446) + '\157' + chr(100) + chr(0b1100101))(chr(0b1001101 + 0o50) + chr(0b1110100) + '\146' + chr(0b101101) + '\070'))) (ZWRNGxZ3R69y, re0VVGAVKu27) = (oVre8I6UXc3b.d5BDZJl_zDsu, oVre8I6UXc3b.mZZDAT49UzAb) (ZoAjWXCPp5ln, Iz1jSgUKZDvt) = (c2A0yzQpDQB3(re0VVGAVKu27), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1000101 + 0o52) + chr(1712 - 1664), ord("\x08")) <= ZWRNGxZ3R69y) (NhWUxmSUCcoW, pFP9VDRQF23q) = (WqUC3KWvYVup.arange(ZoAjWXCPp5ln), Iz1jSgUKZDvt.Dl48nj1rbi23()) if _zTUd6XPn3WJ or pFP9VDRQF23q: HUAx0lWcwxPP = ZWRNGxZ3R69y if pFP9VDRQF23q else ZWRNGxZ3R69y[Iz1jSgUKZDvt] ualWdDeXJEGO = Ac06e2ekmtL0(HUAx0lWcwxPP, minlength=ZoAjWXCPp5ln or None) else: ualWdDeXJEGO = Ac06e2ekmtL0(WqUC3KWvYVup.dRFAC59yQBm_(Iz1jSgUKZDvt, ZWRNGxZ3R69y, ZoAjWXCPp5ln)) NhWUxmSUCcoW = WqUC3KWvYVup.append(NhWUxmSUCcoW, -ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(10006 - 9895) + chr(49), 8)) NhWUxmSUCcoW = oVre8I6UXc3b._constructor(NhWUxmSUCcoW, dtype=oVre8I6UXc3b.dtype, fastpath=ehT0Px3KOsy9(chr(569 - 521) + chr(0b1101111) + chr(0b110001), 8)) return I9PbrFvU4NYI(ualWdDeXJEGO, index=YH_C7u76pUaX(NhWUxmSUCcoW), dtype=xafqLlk3kkUe(SXOLrMavuUCe(b'\xcaJ\xdfw\xd5'), chr(5188 - 5088) + chr(5840 - 5739) + chr(99) + '\x6f' + chr(0b1100100) + '\x65')(chr(2632 - 2515) + chr(0b100110 + 0o116) + chr(102) + '\x2d' + '\x38'))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.get_values
def get_values(self): """ Return the values. For internal compatibility with pandas formatting. Returns ------- numpy.array A numpy array of the same dtype as categorical.categories.dtype or Index if datetime / periods. """ # if we are a datetime and period index, return Index to keep metadata if is_datetimelike(self.categories): return self.categories.take(self._codes, fill_value=np.nan) elif is_integer_dtype(self.categories) and -1 in self._codes: return self.categories.astype("object").take(self._codes, fill_value=np.nan) return np.array(self)
python
def get_values(self): """ Return the values. For internal compatibility with pandas formatting. Returns ------- numpy.array A numpy array of the same dtype as categorical.categories.dtype or Index if datetime / periods. """ # if we are a datetime and period index, return Index to keep metadata if is_datetimelike(self.categories): return self.categories.take(self._codes, fill_value=np.nan) elif is_integer_dtype(self.categories) and -1 in self._codes: return self.categories.astype("object").take(self._codes, fill_value=np.nan) return np.array(self)
[ "def", "get_values", "(", "self", ")", ":", "# if we are a datetime and period index, return Index to keep metadata", "if", "is_datetimelike", "(", "self", ".", "categories", ")", ":", "return", "self", ".", "categories", ".", "take", "(", "self", ".", "_codes", ",", "fill_value", "=", "np", ".", "nan", ")", "elif", "is_integer_dtype", "(", "self", ".", "categories", ")", "and", "-", "1", "in", "self", ".", "_codes", ":", "return", "self", ".", "categories", ".", "astype", "(", "\"object\"", ")", ".", "take", "(", "self", ".", "_codes", ",", "fill_value", "=", "np", ".", "nan", ")", "return", "np", ".", "array", "(", "self", ")" ]
Return the values. For internal compatibility with pandas formatting. Returns ------- numpy.array A numpy array of the same dtype as categorical.categories.dtype or Index if datetime / periods.
[ "Return", "the", "values", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1477-L1495
train
Return the values of the object as numpy array.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60dj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KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1010110 + 0o31) + chr(0b110001) + chr(0b110101) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + chr(0b111110 + 0o61) + chr(0b110001) + '\066' + chr(764 - 715), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(50) + chr(0b1101 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(2073 - 2025) + chr(0b1101111) + chr(0b110011) + chr(50) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10 + 0o61) + '\065' + chr(0b110 + 0o55), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\064' + chr(0b11000 + 0o37), 19753 - 19745), ehT0Px3KOsy9(chr(2253 - 2205) + chr(0b1101111) + '\063' + chr(0b11101 + 0o31) + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\066' + chr(0b11110 + 0o27), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(55) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(383 - 332) + chr(2220 - 2172) + chr(0b100 + 0o60), 4321 - 4313), ehT0Px3KOsy9('\060' + chr(111) + chr(0b10101 + 0o35) + chr(0b110010) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100 + 0o143) + chr(0b110011) + chr(0b110100) + chr(0b110010 + 0o5), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100010 + 0o15) + '\x32' + chr(0b100110 + 0o16), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\064' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(53) + chr(1837 - 1787), 10526 - 10518), ehT0Px3KOsy9('\060' + chr(0b1011100 + 0o23) + chr(49) + chr(0b1110 + 0o43) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + '\067' + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1001011 + 0o44) + chr(0b110001) + chr(493 - 445) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + chr(759 - 708) + chr(1802 - 1750) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + chr(0b101 + 0o54) + chr(1712 - 1660) + chr(0b10100 + 0o40), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(0b110001), 61073 - 61065), ehT0Px3KOsy9(chr(563 - 515) + '\157' + chr(0b11110 + 0o25) + chr(48) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + '\x33' + chr(2152 - 2103), 0o10), ehT0Px3KOsy9(chr(926 - 878) + chr(0b1011101 + 0o22) + chr(0b11101 + 0o27) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(49) + '\063' + chr(0b10 + 0o65), 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + '\x31' + '\067' + chr(2452 - 2399), 19760 - 19752), ehT0Px3KOsy9('\x30' + '\157' + chr(494 - 440) + chr(0b101101 + 0o12), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010011 + 0o34) + chr(439 - 390) + '\064' + chr(0b110111), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2171 - 2120) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(10845 - 10734) + chr(51) + chr(0b110100) + '\x32', 22365 - 22357), ehT0Px3KOsy9(chr(736 - 688) + chr(0b1011101 + 0o22) + '\x32' + '\x36' + '\067', 35786 - 35778), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\x30' + '\x33', 8), ehT0Px3KOsy9(chr(1963 - 1915) + '\x6f' + chr(410 - 360) + chr(55) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1434 - 1383) + '\064' + chr(1399 - 1344), 8), ehT0Px3KOsy9(chr(1615 - 1567) + chr(0b1101111) + '\067' + '\x33', 0o10), ehT0Px3KOsy9(chr(1294 - 1246) + chr(0b1001001 + 0o46) + '\x33' + chr(1892 - 1844) + '\067', 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111 + 0o0) + chr(1193 - 1140) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(586 - 538) + chr(0b1101111) + chr(0b10100 + 0o37) + chr(0b110101) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + '\064', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1 + 0o61) + chr(53) + '\x31', 45121 - 45113)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + chr(53) + '\x30', 32860 - 32852)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'B'), chr(0b1011000 + 0o14) + chr(101) + chr(0b1100011) + chr(111) + chr(100) + chr(101))(chr(13684 - 13567) + '\164' + '\146' + '\055' + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def vF9j7cOSuwTo(oVre8I6UXc3b): if PUcfBsFlCjpH(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x01+\x89\x93\xaa3\xc3\x0c\xaa\xbe\xd6\x85'), chr(100) + '\145' + '\x63' + chr(1710 - 1599) + chr(0b1100100) + '\145')('\x75' + chr(0b1111 + 0o145) + '\146' + chr(0b101101) + chr(0b100111 + 0o21)))): return xafqLlk3kkUe(oVre8I6UXc3b.categories, xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\x10\xb8\xb2'), chr(0b1100100) + chr(101) + chr(99) + chr(111) + chr(100) + '\145')(chr(0b1110101) + chr(116) + chr(0b11011 + 0o113) + chr(0b101101) + chr(2775 - 2719)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x08D\x91\x93\xb1-\x9bj\x85\x80\xe4\x92'), chr(100) + chr(0b1100101) + chr(5486 - 5387) + chr(111) + chr(0b100110 + 0o76) + '\x65')(chr(117) + '\x74' + chr(0b110 + 0o140) + '\055' + chr(0b111000))), fill_value=xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x02\x10\xbd'), chr(100) + chr(0b1100101) + '\143' + chr(0b10000 + 0o137) + chr(0b1011 + 0o131) + '\145')(chr(117) + chr(0b1110100) + '\x66' + '\x2d' + chr(0b10101 + 0o43)))) elif vbqhcY5kX820(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x01+\x89\x93\xaa3\xc3\x0c\xaa\xbe\xd6\x85'), chr(0b1100100) + chr(0b1100101) + '\143' + '\x6f' + '\144' + chr(0b1100101))(chr(117) + chr(7311 - 7195) + chr(0b1100110 + 0o0) + chr(1209 - 1164) + chr(0b111000)))) and -ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + '\x31', 8) in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x08D\x91\x93\xb1-\x9bj\x85\x80\xe4\x92'), chr(0b100110 + 0o76) + '\x65' + '\x63' + '\x6f' + '\x64' + '\x65')(chr(0b1110101) + '\164' + chr(0b1011010 + 0o14) + chr(45) + chr(320 - 264))): return xafqLlk3kkUe(oVre8I6UXc3b.categories.astype(xafqLlk3kkUe(SXOLrMavuUCe(b'\x03\x13\xb9\xb2\x88\x13'), chr(0b101010 + 0o72) + '\145' + '\143' + '\157' + chr(0b1100100) + '\145')('\x75' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\x10\xb8\xb2'), chr(0b1100100) + '\145' + chr(99) + chr(0b1101111) + '\144' + chr(7710 - 7609))(chr(11618 - 11501) + '\164' + chr(1428 - 1326) + chr(1352 - 1307) + chr(0b111000)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x08D\x91\x93\xb1-\x9bj\x85\x80\xe4\x92'), chr(100) + chr(0b111 + 0o136) + chr(0b1100011) + chr(0b1101111) + chr(4034 - 3934) + chr(6743 - 6642))(chr(117) + chr(116) + chr(102) + '\x2d' + chr(786 - 730))), fill_value=xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x02\x10\xbd'), chr(100) + chr(0b1010101 + 0o20) + chr(99) + chr(9422 - 9311) + '\x64' + chr(101))(chr(0b1110101) + chr(3352 - 3236) + '\146' + chr(0b100101 + 0o10) + chr(56)))) return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\r\x03\xa1\xb6\x92'), chr(5670 - 5570) + '\145' + chr(0b1011010 + 0o11) + '\157' + '\x64' + '\x65')(chr(117) + chr(0b1110010 + 0o2) + chr(0b1100110) + chr(45) + '\x38'))(oVre8I6UXc3b)
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.sort_values
def sort_values(self, inplace=False, ascending=True, na_position='last'): """ Sort the Categorical by category value returning a new Categorical by default. While an ordering is applied to the category values, sorting in this context refers more to organizing and grouping together based on matching category values. Thus, this function can be called on an unordered Categorical instance unlike the functions 'Categorical.min' and 'Categorical.max'. Parameters ---------- inplace : bool, default False Do operation in place. ascending : bool, default True Order ascending. Passing False orders descending. The ordering parameter provides the method by which the category values are organized. na_position : {'first', 'last'} (optional, default='last') 'first' puts NaNs at the beginning 'last' puts NaNs at the end Returns ------- Categorical or None See Also -------- Categorical.sort Series.sort_values Examples -------- >>> c = pd.Categorical([1, 2, 2, 1, 5]) >>> c [1, 2, 2, 1, 5] Categories (3, int64): [1, 2, 5] >>> c.sort_values() [1, 1, 2, 2, 5] Categories (3, int64): [1, 2, 5] >>> c.sort_values(ascending=False) [5, 2, 2, 1, 1] Categories (3, int64): [1, 2, 5] Inplace sorting can be done as well: >>> c.sort_values(inplace=True) >>> c [1, 1, 2, 2, 5] Categories (3, int64): [1, 2, 5] >>> >>> c = pd.Categorical([1, 2, 2, 1, 5]) 'sort_values' behaviour with NaNs. Note that 'na_position' is independent of the 'ascending' parameter: >>> c = pd.Categorical([np.nan, 2, 2, np.nan, 5]) >>> c [NaN, 2.0, 2.0, NaN, 5.0] Categories (2, int64): [2, 5] >>> c.sort_values() [2.0, 2.0, 5.0, NaN, NaN] Categories (2, int64): [2, 5] >>> c.sort_values(ascending=False) [5.0, 2.0, 2.0, NaN, NaN] Categories (2, int64): [2, 5] >>> c.sort_values(na_position='first') [NaN, NaN, 2.0, 2.0, 5.0] Categories (2, int64): [2, 5] >>> c.sort_values(ascending=False, na_position='first') [NaN, NaN, 5.0, 2.0, 2.0] Categories (2, int64): [2, 5] """ inplace = validate_bool_kwarg(inplace, 'inplace') if na_position not in ['last', 'first']: msg = 'invalid na_position: {na_position!r}' raise ValueError(msg.format(na_position=na_position)) sorted_idx = nargsort(self, ascending=ascending, na_position=na_position) if inplace: self._codes = self._codes[sorted_idx] else: return self._constructor(values=self._codes[sorted_idx], dtype=self.dtype, fastpath=True)
python
def sort_values(self, inplace=False, ascending=True, na_position='last'): """ Sort the Categorical by category value returning a new Categorical by default. While an ordering is applied to the category values, sorting in this context refers more to organizing and grouping together based on matching category values. Thus, this function can be called on an unordered Categorical instance unlike the functions 'Categorical.min' and 'Categorical.max'. Parameters ---------- inplace : bool, default False Do operation in place. ascending : bool, default True Order ascending. Passing False orders descending. The ordering parameter provides the method by which the category values are organized. na_position : {'first', 'last'} (optional, default='last') 'first' puts NaNs at the beginning 'last' puts NaNs at the end Returns ------- Categorical or None See Also -------- Categorical.sort Series.sort_values Examples -------- >>> c = pd.Categorical([1, 2, 2, 1, 5]) >>> c [1, 2, 2, 1, 5] Categories (3, int64): [1, 2, 5] >>> c.sort_values() [1, 1, 2, 2, 5] Categories (3, int64): [1, 2, 5] >>> c.sort_values(ascending=False) [5, 2, 2, 1, 1] Categories (3, int64): [1, 2, 5] Inplace sorting can be done as well: >>> c.sort_values(inplace=True) >>> c [1, 1, 2, 2, 5] Categories (3, int64): [1, 2, 5] >>> >>> c = pd.Categorical([1, 2, 2, 1, 5]) 'sort_values' behaviour with NaNs. Note that 'na_position' is independent of the 'ascending' parameter: >>> c = pd.Categorical([np.nan, 2, 2, np.nan, 5]) >>> c [NaN, 2.0, 2.0, NaN, 5.0] Categories (2, int64): [2, 5] >>> c.sort_values() [2.0, 2.0, 5.0, NaN, NaN] Categories (2, int64): [2, 5] >>> c.sort_values(ascending=False) [5.0, 2.0, 2.0, NaN, NaN] Categories (2, int64): [2, 5] >>> c.sort_values(na_position='first') [NaN, NaN, 2.0, 2.0, 5.0] Categories (2, int64): [2, 5] >>> c.sort_values(ascending=False, na_position='first') [NaN, NaN, 5.0, 2.0, 2.0] Categories (2, int64): [2, 5] """ inplace = validate_bool_kwarg(inplace, 'inplace') if na_position not in ['last', 'first']: msg = 'invalid na_position: {na_position!r}' raise ValueError(msg.format(na_position=na_position)) sorted_idx = nargsort(self, ascending=ascending, na_position=na_position) if inplace: self._codes = self._codes[sorted_idx] else: return self._constructor(values=self._codes[sorted_idx], dtype=self.dtype, fastpath=True)
[ "def", "sort_values", "(", "self", ",", "inplace", "=", "False", ",", "ascending", "=", "True", ",", "na_position", "=", "'last'", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "'inplace'", ")", "if", "na_position", "not", "in", "[", "'last'", ",", "'first'", "]", ":", "msg", "=", "'invalid na_position: {na_position!r}'", "raise", "ValueError", "(", "msg", ".", "format", "(", "na_position", "=", "na_position", ")", ")", "sorted_idx", "=", "nargsort", "(", "self", ",", "ascending", "=", "ascending", ",", "na_position", "=", "na_position", ")", "if", "inplace", ":", "self", ".", "_codes", "=", "self", ".", "_codes", "[", "sorted_idx", "]", "else", ":", "return", "self", ".", "_constructor", "(", "values", "=", "self", ".", "_codes", "[", "sorted_idx", "]", ",", "dtype", "=", "self", ".", "dtype", ",", "fastpath", "=", "True", ")" ]
Sort the Categorical by category value returning a new Categorical by default. While an ordering is applied to the category values, sorting in this context refers more to organizing and grouping together based on matching category values. Thus, this function can be called on an unordered Categorical instance unlike the functions 'Categorical.min' and 'Categorical.max'. Parameters ---------- inplace : bool, default False Do operation in place. ascending : bool, default True Order ascending. Passing False orders descending. The ordering parameter provides the method by which the category values are organized. na_position : {'first', 'last'} (optional, default='last') 'first' puts NaNs at the beginning 'last' puts NaNs at the end Returns ------- Categorical or None See Also -------- Categorical.sort Series.sort_values Examples -------- >>> c = pd.Categorical([1, 2, 2, 1, 5]) >>> c [1, 2, 2, 1, 5] Categories (3, int64): [1, 2, 5] >>> c.sort_values() [1, 1, 2, 2, 5] Categories (3, int64): [1, 2, 5] >>> c.sort_values(ascending=False) [5, 2, 2, 1, 1] Categories (3, int64): [1, 2, 5] Inplace sorting can be done as well: >>> c.sort_values(inplace=True) >>> c [1, 1, 2, 2, 5] Categories (3, int64): [1, 2, 5] >>> >>> c = pd.Categorical([1, 2, 2, 1, 5]) 'sort_values' behaviour with NaNs. Note that 'na_position' is independent of the 'ascending' parameter: >>> c = pd.Categorical([np.nan, 2, 2, np.nan, 5]) >>> c [NaN, 2.0, 2.0, NaN, 5.0] Categories (2, int64): [2, 5] >>> c.sort_values() [2.0, 2.0, 5.0, NaN, NaN] Categories (2, int64): [2, 5] >>> c.sort_values(ascending=False) [5.0, 2.0, 2.0, NaN, NaN] Categories (2, int64): [2, 5] >>> c.sort_values(na_position='first') [NaN, NaN, 2.0, 2.0, 5.0] Categories (2, int64): [2, 5] >>> c.sort_values(ascending=False, na_position='first') [NaN, NaN, 5.0, 2.0, 2.0] Categories (2, int64): [2, 5]
[ "Sort", "the", "Categorical", "by", "category", "value", "returning", "a", "new", "Categorical", "by", "default", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1554-L1642
train
Sort the values of the Categorical by category value returning a new Categorical instance.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQG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xlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(2161 - 2113) + chr(111) + '\x31' + chr(0b110111) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(238 - 127) + chr(0b110010) + chr(1837 - 1786) + chr(55), 6250 - 6242), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000100 + 0o53) + '\063' + chr(55) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(160 - 105) + chr(0b110000), 16608 - 16600), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(9395 - 9284) + chr(2081 - 2030) + '\x32' + '\x32', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110110) + chr(0b110110), 28294 - 28286), ehT0Px3KOsy9('\060' + chr(4437 - 4326) + chr(50) + chr(0b100111 + 0o16) + '\064', 0b1000), ehT0Px3KOsy9(chr(2181 - 2133) + chr(0b1000010 + 0o55) + chr(0b110010 + 0o2) + chr(994 - 946), 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + '\061' + chr(0b10 + 0o61) + '\062', 0b1000), ehT0Px3KOsy9(chr(701 - 653) + '\x6f' + chr(0b100 + 0o57) + chr(0b110111) + chr(0b101111 + 0o5), 8), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\062' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b11000 + 0o127) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(50 - 0) + chr(0b101101 + 0o5) + '\064', 39322 - 39314), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(49) + chr(0b1100 + 0o53), ord("\x08")), ehT0Px3KOsy9(chr(650 - 602) + '\157' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2265 - 2215) + chr(0b110101 + 0o1) + chr(0b101110 + 0o6), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011111 + 0o20) + '\x33' + chr(351 - 300) + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11010 + 0o30) + chr(0b110010) + '\065', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110110) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10111 + 0o33) + '\060' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + chr(0b10110 + 0o33) + '\063' + '\x30', 26266 - 26258), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33', 10237 - 10229), ehT0Px3KOsy9(chr(1273 - 1225) + '\x6f' + chr(703 - 652) + chr(0b110011) + chr(1370 - 1317), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b11000 + 0o33) + chr(0b110101) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(559 - 508) + '\064' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(5677 - 5566) + chr(51) + '\x30' + '\x35', 56511 - 56503), ehT0Px3KOsy9(chr(48) + chr(0b11 + 0o154) + chr(0b110011) + chr(0b110001) + '\065', 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(50) + '\066' + chr(0b110011), 12083 - 12075), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11001 + 0o30) + chr(2193 - 2141) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(452 - 404) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(0b110101) + '\067', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(1498 - 1448), 871 - 863), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11101 + 0o25) + chr(0b10001 + 0o42) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100111 + 0o10) + chr(49) + chr(467 - 415) + chr(0b101100 + 0o10), 45829 - 45821), ehT0Px3KOsy9(chr(0b110000) + chr(11205 - 11094) + chr(0b110011) + chr(55) + chr(0b1011 + 0o45), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110010 + 0o75) + '\061' + '\x33' + chr(0b11111 + 0o21), 8), ehT0Px3KOsy9(chr(1200 - 1152) + chr(6229 - 6118) + chr(0b110110) + chr(0b110101), 16309 - 16301), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + '\x30' + chr(0b101111 + 0o2), 9148 - 9140), ehT0Px3KOsy9(chr(48) + chr(0b1101001 + 0o6) + chr(0b110011) + '\x37' + chr(55), 27845 - 27837)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(10536 - 10425) + '\x35' + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'Q'), '\144' + '\145' + '\x63' + chr(0b110111 + 0o70) + chr(0b11101 + 0o107) + chr(0b1100101))(chr(0b100001 + 0o124) + '\x74' + chr(0b100 + 0o142) + chr(0b101101) + chr(1915 - 1859)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def nKRyNs3qSeG2(oVre8I6UXc3b, KhzrMpzISODo=ehT0Px3KOsy9('\x30' + chr(111) + '\060', 0o10), OtwBK3ePE1cK=ehT0Px3KOsy9(chr(48) + chr(0b1000010 + 0o55) + '\061', ord("\x08")), JLtVil0zH4Au=xafqLlk3kkUe(SXOLrMavuUCe(b'\x13\xfe\x8f\xcc'), chr(0b1100100) + chr(0b1100101) + '\x63' + '\157' + chr(0b1100100) + chr(0b1001000 + 0o35))(chr(3567 - 3450) + '\x74' + '\146' + chr(45) + chr(0b111000))): KhzrMpzISODo = LYHx5VlCvmk_(KhzrMpzISODo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\xf1\x8c\xd4\xb3U\xc9'), chr(4701 - 4601) + '\x65' + chr(0b1100011) + chr(7447 - 7336) + chr(0b111000 + 0o54) + chr(101))('\x75' + chr(116) + chr(1193 - 1091) + chr(0b101101) + chr(0b100111 + 0o21))) if JLtVil0zH4Au not in [xafqLlk3kkUe(SXOLrMavuUCe(b'\x13\xfe\x8f\xcc'), chr(100) + '\x65' + chr(0b1100011) + chr(5363 - 5252) + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(116) + '\146' + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x19\xf6\x8e\xcb\xa6'), '\x64' + chr(101) + chr(99) + '\157' + chr(100) + chr(6208 - 6107))(chr(4054 - 3937) + chr(116) + '\146' + chr(45) + chr(56))]: jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\xf1\x8a\xd9\xbe_\xc8\x004\x9d\x0bv\xfb\xfcm\xc0\xb2\xfa_\xb9xx\xb3\x8f\xba\xb5\xa2\xc0\x0e4\x86m\xf6E\x8az'), chr(5816 - 5716) + '\145' + chr(99) + chr(9557 - 9446) + chr(5648 - 5548) + '\145')('\165' + chr(0b1110100) + '\146' + '\055' + chr(0b111000)) raise q1QCh3W88sgk(xafqLlk3kkUe(jtbovtaIYjRB, xafqLlk3kkUe(SXOLrMavuUCe(b'\x19\xf0\x8e\xd5\xb3B'), chr(0b1100100) + chr(101) + '\143' + chr(0b1101111) + chr(0b0 + 0o144) + chr(0b11001 + 0o114))('\165' + chr(0b101001 + 0o113) + chr(10133 - 10031) + chr(0b101101) + chr(56)))(na_position=JLtVil0zH4Au)) sZLtNt0MRmdr = QMtV_7482tFG(oVre8I6UXc3b, ascending=OtwBK3ePE1cK, na_position=JLtVil0zH4Au) if KhzrMpzISODo: oVre8I6UXc3b.d5BDZJl_zDsu = oVre8I6UXc3b.d5BDZJl_zDsu[sZLtNt0MRmdr] else: return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b' \xfc\x93\xd6\xa1B\xdeU9\x88;t'), chr(0b110001 + 0o63) + chr(0b1011000 + 0o15) + chr(0b1010101 + 0o16) + chr(0b1101111) + chr(100) + chr(101))('\x75' + chr(10805 - 10689) + chr(0b1100110) + '\055' + chr(0b111000)))(values=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"\x1b\xaa\xbe\xfc\x88|\xc0\x7f \xb8's"), '\x64' + '\x65' + chr(3831 - 3732) + '\157' + chr(0b111001 + 0o53) + '\x65')(chr(0b1110101) + '\164' + '\146' + chr(118 - 73) + '\x38'))[sZLtNt0MRmdr], dtype=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b\xeb\x85\xc8\xb7'), chr(100) + chr(0b1100101) + '\143' + '\x6f' + '\144' + '\x65')(chr(0b11011 + 0o132) + '\x74' + '\146' + '\055' + chr(2584 - 2528))), fastpath=ehT0Px3KOsy9(chr(48) + chr(0b1001001 + 0o46) + '\x31', 8))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical._values_for_rank
def _values_for_rank(self): """ For correctly ranking ordered categorical data. See GH#15420 Ordered categorical data should be ranked on the basis of codes with -1 translated to NaN. Returns ------- numpy.array """ from pandas import Series if self.ordered: values = self.codes mask = values == -1 if mask.any(): values = values.astype('float64') values[mask] = np.nan elif self.categories.is_numeric(): values = np.array(self) else: # reorder the categories (so rank can use the float codes) # instead of passing an object array to rank values = np.array( self.rename_categories(Series(self.categories).rank().values) ) return values
python
def _values_for_rank(self): """ For correctly ranking ordered categorical data. See GH#15420 Ordered categorical data should be ranked on the basis of codes with -1 translated to NaN. Returns ------- numpy.array """ from pandas import Series if self.ordered: values = self.codes mask = values == -1 if mask.any(): values = values.astype('float64') values[mask] = np.nan elif self.categories.is_numeric(): values = np.array(self) else: # reorder the categories (so rank can use the float codes) # instead of passing an object array to rank values = np.array( self.rename_categories(Series(self.categories).rank().values) ) return values
[ "def", "_values_for_rank", "(", "self", ")", ":", "from", "pandas", "import", "Series", "if", "self", ".", "ordered", ":", "values", "=", "self", ".", "codes", "mask", "=", "values", "==", "-", "1", "if", "mask", ".", "any", "(", ")", ":", "values", "=", "values", ".", "astype", "(", "'float64'", ")", "values", "[", "mask", "]", "=", "np", ".", "nan", "elif", "self", ".", "categories", ".", "is_numeric", "(", ")", ":", "values", "=", "np", ".", "array", "(", "self", ")", "else", ":", "# reorder the categories (so rank can use the float codes)", "# instead of passing an object array to rank", "values", "=", "np", ".", "array", "(", "self", ".", "rename_categories", "(", "Series", "(", "self", ".", "categories", ")", ".", "rank", "(", ")", ".", "values", ")", ")", "return", "values" ]
For correctly ranking ordered categorical data. See GH#15420 Ordered categorical data should be ranked on the basis of codes with -1 translated to NaN. Returns ------- numpy.array
[ "For", "correctly", "ranking", "ordered", "categorical", "data", ".", "See", "GH#15420" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1644-L1671
train
Returns a numpy array of the values for the rank of the items in the record.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeA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vg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1101111) + chr(49) + chr(52) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(0b10011 + 0o134) + chr(50) + chr(1746 - 1694) + chr(1947 - 1895), 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + chr(0b111 + 0o53) + '\x37' + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1653 - 1604) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x34' + chr(0b100101 + 0o21), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100101 + 0o112) + '\063' + '\063' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1167 - 1116) + chr(0b110 + 0o54) + chr(1401 - 1350), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\067' + '\x34', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + '\x32' + chr(0b11111 + 0o22), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(898 - 849) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + '\x32' + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(8866 - 8755) + '\062' + chr(0b110100 + 0o2) + '\x34', 0o10), ehT0Px3KOsy9('\060' + chr(0b1100110 + 0o11) + '\063' + chr(0b110001) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + chr(6033 - 5922) + chr(0b110101) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10111 + 0o34) + '\x31' + '\062', 0o10), ehT0Px3KOsy9(chr(790 - 742) + '\x6f' + '\x32' + chr(2324 - 2273) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + '\x30' + chr(1108 - 1054), ord("\x08")), ehT0Px3KOsy9(chr(72 - 24) + chr(0b1101111) + chr(50) + chr(0b1 + 0o65) + '\x37', 36855 - 36847), ehT0Px3KOsy9(chr(0b110000) + chr(5128 - 5017) + '\x32' + '\067' + '\062', 0b1000), ehT0Px3KOsy9(chr(1077 - 1029) + '\x6f' + chr(51) + '\063' + '\x34', 0b1000), ehT0Px3KOsy9(chr(486 - 438) + chr(7442 - 7331) + chr(280 - 230) + '\x34' + chr(49), 0o10), ehT0Px3KOsy9(chr(2207 - 2159) + chr(0b1101111) + chr(50) + '\065' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010011 + 0o34) + chr(50) + chr(0b101100 + 0o11) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8008 - 7897) + chr(0b110001) + chr(55), 45645 - 45637), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101 + 0o56) + chr(0b10 + 0o62) + chr(2843 - 2788), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(111) + chr(50) + '\x32' + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11110 + 0o23) + '\x37' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1802 - 1751) + chr(52) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1100100 + 0o13) + chr(0b10000 + 0o42) + chr(0b1101 + 0o46) + '\x30', 30489 - 30481), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\x33' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(494 - 446) + chr(111) + chr(2231 - 2180) + chr(0b1010 + 0o51) + chr(48), 20309 - 20301), ehT0Px3KOsy9('\060' + chr(0b111101 + 0o62) + chr(50) + chr(0b101001 + 0o12) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(550 - 502) + chr(0b1001010 + 0o45) + chr(1258 - 1208) + chr(55) + '\x34', 34662 - 34654), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(52) + '\x37', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + chr(52) + '\067', 8), ehT0Px3KOsy9(chr(48) + chr(0b110101 + 0o72) + chr(0b1100 + 0o45) + '\064' + chr(50), 8), ehT0Px3KOsy9('\060' + chr(7156 - 7045) + chr(49) + chr(61 - 6) + '\066', 0o10), ehT0Px3KOsy9('\x30' + chr(0b11001 + 0o126) + chr(51) + chr(50) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1 + 0o156) + '\062' + '\x32', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011100 + 0o23) + chr(214 - 164) + chr(0b11111 + 0o22) + '\064', 23561 - 23553)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b111010 + 0o65) + chr(0b110101) + chr(0b110000 + 0o0), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'L'), '\144' + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\x75' + '\x74' + chr(102) + chr(0b10001 + 0o34) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def O9jswikqFmIO(oVre8I6UXc3b): (I9PbrFvU4NYI,) = (xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'\x12\xc5\xd7lG\xae'), '\144' + '\145' + '\143' + chr(0b11110 + 0o121) + chr(0b1100100) + '\x65')(chr(0b1101111 + 0o6) + chr(0b1110100) + chr(0b1100110) + chr(1636 - 1591) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'1\xc1\xcbaC\xae'), chr(0b1100100) + '\x65' + '\x63' + chr(764 - 653) + chr(100) + chr(0b110 + 0o137))('\x75' + '\164' + chr(0b1000 + 0o136) + '\055' + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b'1\xc1\xcbaC\xae'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\x6f' + '\x64' + '\145')(chr(9837 - 9720) + chr(116) + chr(102) + chr(0b101101) + '\070')),) if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\r\xd6\xddmT\xb8\xb7'), chr(100) + chr(0b1010 + 0o133) + chr(0b1100011) + chr(5325 - 5214) + chr(0b1100100) + '\145')(chr(0b110 + 0o157) + chr(0b1110100) + '\146' + '\x2d' + '\070')): SPnCNu54H1db = oVre8I6UXc3b.codes Iz1jSgUKZDvt = SPnCNu54H1db == -ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + chr(49), 0o10) if xafqLlk3kkUe(Iz1jSgUKZDvt, xafqLlk3kkUe(SXOLrMavuUCe(b'7\xf2\xeaa\x12\x85\x84\x0b\xf4\xca_\xf9'), '\144' + chr(0b1100101) + chr(99) + '\x6f' + chr(1080 - 980) + chr(101))('\165' + '\164' + chr(0b11 + 0o143) + chr(0b101101) + chr(585 - 529)))(): SPnCNu54H1db = SPnCNu54H1db.astype(xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\xc8\xd6iR\xeb\xe7'), chr(100) + '\x65' + '\x63' + '\157' + chr(0b1100100) + '\145')(chr(0b1100110 + 0o17) + chr(0b10111 + 0o135) + chr(102) + '\x2d' + '\070')) SPnCNu54H1db[Iz1jSgUKZDvt] = WqUC3KWvYVup.nan elif xafqLlk3kkUe(oVre8I6UXc3b.categories, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0b\xd7\xe6fS\xb0\xb6N\xf8\xeb'), chr(0b1100001 + 0o3) + chr(0b1100010 + 0o3) + '\143' + '\157' + '\x64' + chr(1513 - 1412))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(1592 - 1536)))(): SPnCNu54H1db = WqUC3KWvYVup.array(oVre8I6UXc3b) else: SPnCNu54H1db = WqUC3KWvYVup.array(oVre8I6UXc3b.rename_categories(I9PbrFvU4NYI(oVre8I6UXc3b.categories).rank().SPnCNu54H1db)) return SPnCNu54H1db
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.fillna
def fillna(self, value=None, method=None, limit=None): """ Fill NA/NaN values using the specified method. Parameters ---------- value : scalar, dict, Series If a scalar value is passed it is used to fill all missing values. Alternatively, a Series or dict can be used to fill in different values for each index. The value should not be a list. The value(s) passed should either be in the categories or should be NaN. method : {'backfill', 'bfill', 'pad', 'ffill', None}, default None Method to use for filling holes in reindexed Series pad / ffill: propagate last valid observation forward to next valid backfill / bfill: use NEXT valid observation to fill gap limit : int, default None (Not implemented yet for Categorical!) If method is specified, this is the maximum number of consecutive NaN values to forward/backward fill. In other words, if there is a gap with more than this number of consecutive NaNs, it will only be partially filled. If method is not specified, this is the maximum number of entries along the entire axis where NaNs will be filled. Returns ------- filled : Categorical with NA/NaN filled """ value, method = validate_fillna_kwargs( value, method, validate_scalar_dict_value=False ) if value is None: value = np.nan if limit is not None: raise NotImplementedError("specifying a limit for fillna has not " "been implemented yet") codes = self._codes # pad / bfill if method is not None: values = self.to_dense().reshape(-1, len(self)) values = interpolate_2d(values, method, 0, None, value).astype(self.categories.dtype)[0] codes = _get_codes_for_values(values, self.categories) else: # If value is a dict or a Series (a dict value has already # been converted to a Series) if isinstance(value, ABCSeries): if not value[~value.isin(self.categories)].isna().all(): raise ValueError("fill value must be in categories") values_codes = _get_codes_for_values(value, self.categories) indexer = np.where(values_codes != -1) codes[indexer] = values_codes[values_codes != -1] # If value is not a dict or Series it should be a scalar elif is_hashable(value): if not isna(value) and value not in self.categories: raise ValueError("fill value must be in categories") mask = codes == -1 if mask.any(): codes = codes.copy() if isna(value): codes[mask] = -1 else: codes[mask] = self.categories.get_loc(value) else: raise TypeError('"value" parameter must be a scalar, dict ' 'or Series, but you passed a ' '"{0}"'.format(type(value).__name__)) return self._constructor(codes, dtype=self.dtype, fastpath=True)
python
def fillna(self, value=None, method=None, limit=None): """ Fill NA/NaN values using the specified method. Parameters ---------- value : scalar, dict, Series If a scalar value is passed it is used to fill all missing values. Alternatively, a Series or dict can be used to fill in different values for each index. The value should not be a list. The value(s) passed should either be in the categories or should be NaN. method : {'backfill', 'bfill', 'pad', 'ffill', None}, default None Method to use for filling holes in reindexed Series pad / ffill: propagate last valid observation forward to next valid backfill / bfill: use NEXT valid observation to fill gap limit : int, default None (Not implemented yet for Categorical!) If method is specified, this is the maximum number of consecutive NaN values to forward/backward fill. In other words, if there is a gap with more than this number of consecutive NaNs, it will only be partially filled. If method is not specified, this is the maximum number of entries along the entire axis where NaNs will be filled. Returns ------- filled : Categorical with NA/NaN filled """ value, method = validate_fillna_kwargs( value, method, validate_scalar_dict_value=False ) if value is None: value = np.nan if limit is not None: raise NotImplementedError("specifying a limit for fillna has not " "been implemented yet") codes = self._codes # pad / bfill if method is not None: values = self.to_dense().reshape(-1, len(self)) values = interpolate_2d(values, method, 0, None, value).astype(self.categories.dtype)[0] codes = _get_codes_for_values(values, self.categories) else: # If value is a dict or a Series (a dict value has already # been converted to a Series) if isinstance(value, ABCSeries): if not value[~value.isin(self.categories)].isna().all(): raise ValueError("fill value must be in categories") values_codes = _get_codes_for_values(value, self.categories) indexer = np.where(values_codes != -1) codes[indexer] = values_codes[values_codes != -1] # If value is not a dict or Series it should be a scalar elif is_hashable(value): if not isna(value) and value not in self.categories: raise ValueError("fill value must be in categories") mask = codes == -1 if mask.any(): codes = codes.copy() if isna(value): codes[mask] = -1 else: codes[mask] = self.categories.get_loc(value) else: raise TypeError('"value" parameter must be a scalar, dict ' 'or Series, but you passed a ' '"{0}"'.format(type(value).__name__)) return self._constructor(codes, dtype=self.dtype, fastpath=True)
[ "def", "fillna", "(", "self", ",", "value", "=", "None", ",", "method", "=", "None", ",", "limit", "=", "None", ")", ":", "value", ",", "method", "=", "validate_fillna_kwargs", "(", "value", ",", "method", ",", "validate_scalar_dict_value", "=", "False", ")", "if", "value", "is", "None", ":", "value", "=", "np", ".", "nan", "if", "limit", "is", "not", "None", ":", "raise", "NotImplementedError", "(", "\"specifying a limit for fillna has not \"", "\"been implemented yet\"", ")", "codes", "=", "self", ".", "_codes", "# pad / bfill", "if", "method", "is", "not", "None", ":", "values", "=", "self", ".", "to_dense", "(", ")", ".", "reshape", "(", "-", "1", ",", "len", "(", "self", ")", ")", "values", "=", "interpolate_2d", "(", "values", ",", "method", ",", "0", ",", "None", ",", "value", ")", ".", "astype", "(", "self", ".", "categories", ".", "dtype", ")", "[", "0", "]", "codes", "=", "_get_codes_for_values", "(", "values", ",", "self", ".", "categories", ")", "else", ":", "# If value is a dict or a Series (a dict value has already", "# been converted to a Series)", "if", "isinstance", "(", "value", ",", "ABCSeries", ")", ":", "if", "not", "value", "[", "~", "value", ".", "isin", "(", "self", ".", "categories", ")", "]", ".", "isna", "(", ")", ".", "all", "(", ")", ":", "raise", "ValueError", "(", "\"fill value must be in categories\"", ")", "values_codes", "=", "_get_codes_for_values", "(", "value", ",", "self", ".", "categories", ")", "indexer", "=", "np", ".", "where", "(", "values_codes", "!=", "-", "1", ")", "codes", "[", "indexer", "]", "=", "values_codes", "[", "values_codes", "!=", "-", "1", "]", "# If value is not a dict or Series it should be a scalar", "elif", "is_hashable", "(", "value", ")", ":", "if", "not", "isna", "(", "value", ")", "and", "value", "not", "in", "self", ".", "categories", ":", "raise", "ValueError", "(", "\"fill value must be in categories\"", ")", "mask", "=", "codes", "==", "-", "1", "if", "mask", ".", "any", "(", ")", ":", "codes", "=", "codes", ".", "copy", "(", ")", "if", "isna", "(", "value", ")", ":", "codes", "[", "mask", "]", "=", "-", "1", "else", ":", "codes", "[", "mask", "]", "=", "self", ".", "categories", ".", "get_loc", "(", "value", ")", "else", ":", "raise", "TypeError", "(", "'\"value\" parameter must be a scalar, dict '", "'or Series, but you passed a '", "'\"{0}\"'", ".", "format", "(", "type", "(", "value", ")", ".", "__name__", ")", ")", "return", "self", ".", "_constructor", "(", "codes", ",", "dtype", "=", "self", ".", "dtype", ",", "fastpath", "=", "True", ")" ]
Fill NA/NaN values using the specified method. Parameters ---------- value : scalar, dict, Series If a scalar value is passed it is used to fill all missing values. Alternatively, a Series or dict can be used to fill in different values for each index. The value should not be a list. The value(s) passed should either be in the categories or should be NaN. method : {'backfill', 'bfill', 'pad', 'ffill', None}, default None Method to use for filling holes in reindexed Series pad / ffill: propagate last valid observation forward to next valid backfill / bfill: use NEXT valid observation to fill gap limit : int, default None (Not implemented yet for Categorical!) If method is specified, this is the maximum number of consecutive NaN values to forward/backward fill. In other words, if there is a gap with more than this number of consecutive NaNs, it will only be partially filled. If method is not specified, this is the maximum number of entries along the entire axis where NaNs will be filled. Returns ------- filled : Categorical with NA/NaN filled
[ "Fill", "NA", "/", "NaN", "values", "using", "the", "specified", "method", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1711-L1790
train
Fill missing values in the specified category with the specified value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZ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8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(821 - 772) + chr(55) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\x30' + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(184 - 129) + chr(2011 - 1960), 10393 - 10385), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(0b110011) + chr(188 - 136), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11111 + 0o23) + chr(0b110001 + 0o2), 0o10), ehT0Px3KOsy9(chr(1616 - 1568) + '\x6f' + '\066' + '\064', 54317 - 54309), ehT0Px3KOsy9('\060' + chr(11499 - 11388) + chr(0b10111 + 0o32) + chr(0b110101) + '\x31', 0b1000), ehT0Px3KOsy9(chr(1558 - 1510) + '\157' + chr(53) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(576 - 525) + chr(1453 - 1398) + chr(0b110101), 22708 - 22700), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b111 + 0o57) + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110111) + chr(507 - 456), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(0b110111) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b1110 + 0o43) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b10010 + 0o43) + chr(1771 - 1723), 53191 - 53183), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + '\065' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(4392 - 4281) + chr(51) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(9736 - 9625) + chr(0b1100 + 0o47) + '\066' + chr(0b110001 + 0o1), 5107 - 5099), ehT0Px3KOsy9('\x30' + chr(111) + chr(1961 - 1907), 57002 - 56994), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\060' + '\061', 58757 - 58749), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\x30' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101100 + 0o7) + '\062' + chr(0b1111 + 0o45), 0b1000), ehT0Px3KOsy9(chr(141 - 93) + chr(0b1101111) + chr(0b10010 + 0o37) + chr(125 - 73) + chr(576 - 524), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(55) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(0b10 + 0o60) + '\065', 8696 - 8688), ehT0Px3KOsy9(chr(1974 - 1926) + '\x6f' + chr(51) + chr(0b100100 + 0o14), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11111 + 0o120) + chr(2021 - 1968) + '\066', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1010011 + 0o34) + chr(0b110001) + chr(52), 8246 - 8238), ehT0Px3KOsy9('\060' + chr(0b1001000 + 0o47) + chr(49) + chr(52) + chr(0b11010 + 0o30), 3577 - 3569), ehT0Px3KOsy9(chr(0b110000) + chr(5496 - 5385) + chr(0b11000 + 0o32) + chr(0b110110) + chr(0b1110 + 0o50), 27872 - 27864), ehT0Px3KOsy9('\x30' + '\157' + chr(2452 - 2402) + '\x36' + chr(54), 8), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(51) + chr(2122 - 2074) + '\067', 23454 - 23446), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b100101 + 0o15) + chr(0b101001 + 0o13) + chr(0b101001 + 0o16), 0o10), ehT0Px3KOsy9(chr(1168 - 1120) + chr(0b100010 + 0o115) + chr(53) + '\061', 8), ehT0Px3KOsy9(chr(613 - 565) + chr(111) + chr(0b101011 + 0o10) + chr(2437 - 2387) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5412 - 5301) + chr(0b11101 + 0o25) + '\x36' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(0b110011) + chr(53) + chr(0b11101 + 0o23), 1776 - 1768), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + '\064' + '\064', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b101001 + 0o10) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(0b110011) + chr(54), 11842 - 11834), ehT0Px3KOsy9(chr(1781 - 1733) + chr(377 - 266) + chr(1533 - 1483) + '\x32' + '\x32', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + chr(0b101001 + 0o14) + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'R'), chr(100) + chr(101) + chr(6426 - 6327) + '\157' + '\x64' + chr(101))(chr(0b1011111 + 0o26) + '\x74' + chr(0b100000 + 0o106) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def WhVSCjZUYrOg(oVre8I6UXc3b, QmmgWUB13VCJ=None, CVRCXTcnOnH6=None, j8BaqiKmcR6w=None): (QmmgWUB13VCJ, CVRCXTcnOnH6) = j80NLK81yWDZ(QmmgWUB13VCJ, CVRCXTcnOnH6, validate_scalar_dict_value=ehT0Px3KOsy9('\x30' + '\x6f' + chr(48), ord("\x08"))) if QmmgWUB13VCJ is None: QmmgWUB13VCJ = WqUC3KWvYVup.nan if j8BaqiKmcR6w is not None: raise _zJ24Vce7wp0(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\xf4^?zR\x10@\x93\x15\x1b\x1a\xeb\x04Fs\x9bra\xa2\xbb\x16\xdb\xf3qB`\x0c\xd7\x96\xaf\xc6Z\xf0\xdc\x87\xd0n\xbc\xf7\x19\xea\x1b5~D\x05L\x90\x17U\x0f\xae\x0c\x0fg\x97r'), chr(0b1110 + 0o126) + '\x65' + '\x63' + chr(0b1101111) + '\144' + chr(1545 - 1444))(chr(117) + chr(0b1010111 + 0o35) + chr(102) + '\055' + chr(2090 - 2034))) AoWJEgIAbHh_ = oVre8I6UXc3b.d5BDZJl_zDsu if CVRCXTcnOnH6 is not None: SPnCNu54H1db = oVre8I6UXc3b.to_dense().reshape(-ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31', 0b1000), c2A0yzQpDQB3(oVre8I6UXc3b)) SPnCNu54H1db = bDpz_vdV2az0(SPnCNu54H1db, CVRCXTcnOnH6, ehT0Px3KOsy9(chr(0b110000) + chr(6654 - 6543) + chr(0b110000), 8), None, QmmgWUB13VCJ).astype(oVre8I6UXc3b.categories.dtype)[ehT0Px3KOsy9(chr(2185 - 2137) + '\157' + '\x30', 8)] AoWJEgIAbHh_ = SrdNuo8P440p(SPnCNu54H1db, oVre8I6UXc3b.mZZDAT49UzAb) elif PlSM16l2KDPD(QmmgWUB13VCJ, essMXh4s9f1w): if not xafqLlk3kkUe(QmmgWUB13VCJ[~QmmgWUB13VCJ.isin(oVre8I6UXc3b.categories)].isna(), xafqLlk3kkUe(SXOLrMavuUCe(b'8\xe8\x0fd}^X[\x9f\x1b\tH'), '\144' + chr(0b1100101) + chr(1217 - 1118) + chr(0b1101111) + chr(0b1000010 + 0o42) + chr(0b1100101))(chr(0b111101 + 0o70) + chr(0b1101000 + 0o14) + '\146' + chr(180 - 135) + chr(56)))(): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xedW03B\x08E\x88\x17\x1b\x16\xbe\x1b[>\x90ca\xad\xbaD\x98\xf4lKk\r\xc4\xdf\xa2\xd4'), '\144' + '\x65' + chr(0b1100011) + chr(0b110010 + 0o75) + chr(0b1100100) + chr(0b1100101 + 0o0))(chr(0b1110101) + chr(0b10001 + 0o143) + chr(0b1011000 + 0o16) + chr(45) + '\070')) jcRPx5NtGtP0 = SrdNuo8P440p(QmmgWUB13VCJ, oVre8I6UXc3b.mZZDAT49UzAb) BvJfssszZMhp = WqUC3KWvYVup.dRFAC59yQBm_(jcRPx5NtGtP0 != -ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061', 8)) AoWJEgIAbHh_[BvJfssszZMhp] = jcRPx5NtGtP0[jcRPx5NtGtP0 != -ehT0Px3KOsy9(chr(1966 - 1918) + chr(0b1 + 0o156) + '\061', 8)] elif ocRGWrk2KuZy(QmmgWUB13VCJ): if not yBUx5qcFiTz6(QmmgWUB13VCJ) and QmmgWUB13VCJ not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x11\xdea\x18R`]\x10\xa8\x08z\x19'), '\x64' + chr(101) + '\143' + chr(0b1101111) + chr(100) + '\x65')(chr(0b1110101) + chr(5597 - 5481) + chr(460 - 358) + '\x2d' + '\x38')): raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xedW03B\x08E\x88\x17\x1b\x16\xbe\x1b[>\x90ca\xad\xbaD\x98\xf4lKk\r\xc4\xdf\xa2\xd4'), chr(100) + '\x65' + chr(3781 - 3682) + '\x6f' + '\144' + chr(101))('\x75' + chr(5777 - 5661) + chr(102) + '\x2d' + chr(0b111000))) Iz1jSgUKZDvt = AoWJEgIAbHh_ == -ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(72 - 23), 8) if xafqLlk3kkUe(Iz1jSgUKZDvt, xafqLlk3kkUe(SXOLrMavuUCe(b")\xd2h5'l>\x1e\x980r6"), chr(0b1000111 + 0o35) + chr(101) + '\x63' + chr(0b1011001 + 0o26) + '\144' + '\145')(chr(0b1110101) + chr(9857 - 9741) + chr(102) + chr(0b100011 + 0o12) + chr(1516 - 1460)))(): AoWJEgIAbHh_ = AoWJEgIAbHh_.igThHS4jwVsa() if yBUx5qcFiTz6(QmmgWUB13VCJ): AoWJEgIAbHh_[Iz1jSgUKZDvt] = -ehT0Px3KOsy9('\x30' + '\x6f' + chr(49), 8) else: AoWJEgIAbHh_[Iz1jSgUKZDvt] = oVre8I6UXc3b.categories.get_loc(QmmgWUB13VCJ) else: raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"^\xf2Z0fQK\t\x8d\x13I\x1a\xa6\r[{\x80&,\xb1\xa7\x10\xdb\xf7}\x0emB\xc5\xd5\xa6\xcbH\xa2\x9e\xc8\xc0'\xbd\xe6\\\xebI|@Q\x1b@\x98\x01\x17[\xa9\x1d[>\x8bi4\xe4\xa4\x05\x88\xe6}J,\x03\x96\x94\xbc\x97T\xf2"), chr(5489 - 5389) + '\145' + chr(99) + chr(0b1001111 + 0o40) + '\144' + '\145')(chr(117) + chr(0b1110100) + '\146' + chr(1500 - 1455) + chr(0b1001 + 0o57)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xebI1r@'), '\x64' + chr(101) + '\143' + '\x6f' + chr(100) + '\145')('\x75' + chr(0b1110100) + chr(9442 - 9340) + chr(0b11111 + 0o16) + chr(0b111000)))(xafqLlk3kkUe(wmQmyeWBmUpv(QmmgWUB13VCJ), xafqLlk3kkUe(SXOLrMavuUCe(b";\xe6^6'[3X\xb6>zM"), chr(100) + '\145' + chr(99) + '\x6f' + chr(100) + chr(101))(chr(0b1110101) + chr(5627 - 5511) + '\x66' + chr(0b101101) + chr(0b111000))))) return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'#\xe7T2`@\x1b\\\x9e\x06T\t'), chr(100) + chr(101) + chr(0b1011 + 0o130) + chr(0b111010 + 0o65) + '\x64' + chr(0b11011 + 0o112))(chr(0b110011 + 0o102) + chr(0b1110100) + '\x66' + '\x2d' + '\070'))(AoWJEgIAbHh_, dtype=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\xf0B,v'), chr(0b11 + 0o141) + chr(0b100000 + 0o105) + chr(0b1010001 + 0o22) + chr(111) + chr(8623 - 8523) + chr(6090 - 5989))('\165' + chr(2084 - 1968) + '\x66' + chr(0b100010 + 0o13) + chr(56))), fastpath=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31', 8))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical.take_nd
def take_nd(self, indexer, allow_fill=None, fill_value=None): """ Take elements from the Categorical. Parameters ---------- indexer : sequence of int The indices in `self` to take. The meaning of negative values in `indexer` depends on the value of `allow_fill`. allow_fill : bool, default None How to handle negative values in `indexer`. * False: negative values in `indices` indicate positional indices from the right. This is similar to :func:`numpy.take`. * True: negative values in `indices` indicate missing values (the default). These values are set to `fill_value`. Any other other negative values raise a ``ValueError``. .. versionchanged:: 0.23.0 Deprecated the default value of `allow_fill`. The deprecated default is ``True``. In the future, this will change to ``False``. fill_value : object The value to use for `indices` that are missing (-1), when ``allow_fill=True``. This should be the category, i.e. a value in ``self.categories``, not a code. Returns ------- Categorical This Categorical will have the same categories and ordered as `self`. See Also -------- Series.take : Similar method for Series. numpy.ndarray.take : Similar method for NumPy arrays. Examples -------- >>> cat = pd.Categorical(['a', 'a', 'b']) >>> cat [a, a, b] Categories (2, object): [a, b] Specify ``allow_fill==False`` to have negative indices mean indexing from the right. >>> cat.take([0, -1, -2], allow_fill=False) [a, b, a] Categories (2, object): [a, b] With ``allow_fill=True``, indices equal to ``-1`` mean "missing" values that should be filled with the `fill_value`, which is ``np.nan`` by default. >>> cat.take([0, -1, -1], allow_fill=True) [a, NaN, NaN] Categories (2, object): [a, b] The fill value can be specified. >>> cat.take([0, -1, -1], allow_fill=True, fill_value='a') [a, a, a] Categories (3, object): [a, b] Specifying a fill value that's not in ``self.categories`` will raise a ``TypeError``. """ indexer = np.asarray(indexer, dtype=np.intp) if allow_fill is None: if (indexer < 0).any(): warn(_take_msg, FutureWarning, stacklevel=2) allow_fill = True dtype = self.dtype if isna(fill_value): fill_value = -1 elif allow_fill: # convert user-provided `fill_value` to codes if fill_value in self.categories: fill_value = self.categories.get_loc(fill_value) else: msg = ( "'fill_value' ('{}') is not in this Categorical's " "categories." ) raise TypeError(msg.format(fill_value)) codes = take(self._codes, indexer, allow_fill=allow_fill, fill_value=fill_value) result = type(self).from_codes(codes, dtype=dtype) return result
python
def take_nd(self, indexer, allow_fill=None, fill_value=None): """ Take elements from the Categorical. Parameters ---------- indexer : sequence of int The indices in `self` to take. The meaning of negative values in `indexer` depends on the value of `allow_fill`. allow_fill : bool, default None How to handle negative values in `indexer`. * False: negative values in `indices` indicate positional indices from the right. This is similar to :func:`numpy.take`. * True: negative values in `indices` indicate missing values (the default). These values are set to `fill_value`. Any other other negative values raise a ``ValueError``. .. versionchanged:: 0.23.0 Deprecated the default value of `allow_fill`. The deprecated default is ``True``. In the future, this will change to ``False``. fill_value : object The value to use for `indices` that are missing (-1), when ``allow_fill=True``. This should be the category, i.e. a value in ``self.categories``, not a code. Returns ------- Categorical This Categorical will have the same categories and ordered as `self`. See Also -------- Series.take : Similar method for Series. numpy.ndarray.take : Similar method for NumPy arrays. Examples -------- >>> cat = pd.Categorical(['a', 'a', 'b']) >>> cat [a, a, b] Categories (2, object): [a, b] Specify ``allow_fill==False`` to have negative indices mean indexing from the right. >>> cat.take([0, -1, -2], allow_fill=False) [a, b, a] Categories (2, object): [a, b] With ``allow_fill=True``, indices equal to ``-1`` mean "missing" values that should be filled with the `fill_value`, which is ``np.nan`` by default. >>> cat.take([0, -1, -1], allow_fill=True) [a, NaN, NaN] Categories (2, object): [a, b] The fill value can be specified. >>> cat.take([0, -1, -1], allow_fill=True, fill_value='a') [a, a, a] Categories (3, object): [a, b] Specifying a fill value that's not in ``self.categories`` will raise a ``TypeError``. """ indexer = np.asarray(indexer, dtype=np.intp) if allow_fill is None: if (indexer < 0).any(): warn(_take_msg, FutureWarning, stacklevel=2) allow_fill = True dtype = self.dtype if isna(fill_value): fill_value = -1 elif allow_fill: # convert user-provided `fill_value` to codes if fill_value in self.categories: fill_value = self.categories.get_loc(fill_value) else: msg = ( "'fill_value' ('{}') is not in this Categorical's " "categories." ) raise TypeError(msg.format(fill_value)) codes = take(self._codes, indexer, allow_fill=allow_fill, fill_value=fill_value) result = type(self).from_codes(codes, dtype=dtype) return result
[ "def", "take_nd", "(", "self", ",", "indexer", ",", "allow_fill", "=", "None", ",", "fill_value", "=", "None", ")", ":", "indexer", "=", "np", ".", "asarray", "(", "indexer", ",", "dtype", "=", "np", ".", "intp", ")", "if", "allow_fill", "is", "None", ":", "if", "(", "indexer", "<", "0", ")", ".", "any", "(", ")", ":", "warn", "(", "_take_msg", ",", "FutureWarning", ",", "stacklevel", "=", "2", ")", "allow_fill", "=", "True", "dtype", "=", "self", ".", "dtype", "if", "isna", "(", "fill_value", ")", ":", "fill_value", "=", "-", "1", "elif", "allow_fill", ":", "# convert user-provided `fill_value` to codes", "if", "fill_value", "in", "self", ".", "categories", ":", "fill_value", "=", "self", ".", "categories", ".", "get_loc", "(", "fill_value", ")", "else", ":", "msg", "=", "(", "\"'fill_value' ('{}') is not in this Categorical's \"", "\"categories.\"", ")", "raise", "TypeError", "(", "msg", ".", "format", "(", "fill_value", ")", ")", "codes", "=", "take", "(", "self", ".", "_codes", ",", "indexer", ",", "allow_fill", "=", "allow_fill", ",", "fill_value", "=", "fill_value", ")", "result", "=", "type", "(", "self", ")", ".", "from_codes", "(", "codes", ",", "dtype", "=", "dtype", ")", "return", "result" ]
Take elements from the Categorical. Parameters ---------- indexer : sequence of int The indices in `self` to take. The meaning of negative values in `indexer` depends on the value of `allow_fill`. allow_fill : bool, default None How to handle negative values in `indexer`. * False: negative values in `indices` indicate positional indices from the right. This is similar to :func:`numpy.take`. * True: negative values in `indices` indicate missing values (the default). These values are set to `fill_value`. Any other other negative values raise a ``ValueError``. .. versionchanged:: 0.23.0 Deprecated the default value of `allow_fill`. The deprecated default is ``True``. In the future, this will change to ``False``. fill_value : object The value to use for `indices` that are missing (-1), when ``allow_fill=True``. This should be the category, i.e. a value in ``self.categories``, not a code. Returns ------- Categorical This Categorical will have the same categories and ordered as `self`. See Also -------- Series.take : Similar method for Series. numpy.ndarray.take : Similar method for NumPy arrays. Examples -------- >>> cat = pd.Categorical(['a', 'a', 'b']) >>> cat [a, a, b] Categories (2, object): [a, b] Specify ``allow_fill==False`` to have negative indices mean indexing from the right. >>> cat.take([0, -1, -2], allow_fill=False) [a, b, a] Categories (2, object): [a, b] With ``allow_fill=True``, indices equal to ``-1`` mean "missing" values that should be filled with the `fill_value`, which is ``np.nan`` by default. >>> cat.take([0, -1, -1], allow_fill=True) [a, NaN, NaN] Categories (2, object): [a, b] The fill value can be specified. >>> cat.take([0, -1, -1], allow_fill=True, fill_value='a') [a, a, a] Categories (3, object): [a, b] Specifying a fill value that's not in ``self.categories`` will raise a ``TypeError``.
[ "Take", "elements", "from", "the", "Categorical", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1792-L1889
train
Take elements from the Categorical.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_f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aS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + chr(2223 - 2172) + chr(343 - 292) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11001 + 0o126) + chr(50) + '\067' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + '\x30' + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + chr(0b110010) + chr(52) + '\066', 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + '\x35' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + chr(2239 - 2189) + chr(0b110110), 38186 - 38178), ehT0Px3KOsy9('\060' + '\157' + chr(0b11100 + 0o25) + chr(53) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(9194 - 9083) + chr(741 - 692) + '\x34', 18584 - 18576), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(0b110101) + '\060', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(2339 - 2289) + chr(0b110111) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b110001 + 0o76) + '\x36' + chr(54), 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b110 + 0o151) + chr(0b10110 + 0o33) + chr(0b11110 + 0o30) + chr(2321 - 2268), 0b1000), ehT0Px3KOsy9('\x30' + chr(207 - 96) + chr(0b1011 + 0o46) + '\065' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b111000 + 0o67) + '\x33' + chr(0b10110 + 0o41) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(9037 - 8926) + '\x31' + '\063' + chr(0b101111 + 0o4), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(780 - 727) + chr(55), 33750 - 33742), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(111) + chr(0b111 + 0o54) + chr(661 - 612) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(54) + chr(1571 - 1518), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(50) + chr(0b11000 + 0o37), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(0b100110 + 0o14) + '\x33', 54863 - 54855), ehT0Px3KOsy9('\060' + '\157' + chr(0b10010 + 0o41) + chr(0b110110) + '\x30', 11772 - 11764), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\x37' + chr(0b11001 + 0o31), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\065' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(4662 - 4551) + chr(49) + chr(0b110011) + chr(0b11111 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1100100 + 0o13) + chr(0b110010) + chr(0b110001) + chr(2291 - 2239), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(0b110010), 43327 - 43319), ehT0Px3KOsy9('\x30' + '\157' + '\x33', 6298 - 6290), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(0b101010 + 0o7) + chr(0b1 + 0o61), ord("\x08")), ehT0Px3KOsy9(chr(625 - 577) + chr(5143 - 5032) + '\061' + chr(0b101011 + 0o14) + '\062', 8), ehT0Px3KOsy9(chr(0b110000) + chr(7000 - 6889) + '\x33' + chr(0b10001 + 0o41) + chr(733 - 679), 44235 - 44227), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + '\x32' + chr(0b110101) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100111 + 0o10) + chr(0b110010) + chr(0b110000) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + '\x32', 8), ehT0Px3KOsy9('\x30' + '\157' + chr(2168 - 2117) + '\x35' + chr(1081 - 1031), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + '\062' + chr(0b11101 + 0o31) + chr(468 - 416), 15170 - 15162), ehT0Px3KOsy9(chr(48) + '\157' + '\064' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(0b10010 + 0o40) + chr(0b110001) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110111) + '\060', 0o10), ehT0Px3KOsy9(chr(835 - 787) + chr(0b1101111) + chr(0b110 + 0o55) + '\060' + '\065', 26882 - 26874), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + '\066', 17112 - 17104)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + '\x35' + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5'), chr(5453 - 5353) + chr(101) + chr(7809 - 7710) + chr(3635 - 3524) + chr(0b1100100) + chr(1278 - 1177))(chr(2374 - 2257) + '\x74' + chr(0b100110 + 0o100) + chr(0b101010 + 0o3) + chr(1166 - 1110)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def JIy8PCeuGBVH(oVre8I6UXc3b, BvJfssszZMhp, p_wnZQVqalzm=None, RlLNSsrUm3zD=None): BvJfssszZMhp = WqUC3KWvYVup.asarray(BvJfssszZMhp, dtype=WqUC3KWvYVup.intp) if p_wnZQVqalzm is None: if xafqLlk3kkUe(BvJfssszZMhp < ehT0Px3KOsy9('\x30' + chr(0b11101 + 0o122) + chr(2097 - 2049), 0o10), xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e\xe9\x91\xcf\x1eN;;M\xf8\x7f8'), chr(0b1100100) + chr(0b1100100 + 0o1) + '\x63' + '\x6f' + chr(100) + chr(1021 - 920))(chr(117) + chr(5922 - 5806) + chr(10339 - 10237) + '\055' + chr(56)))(): nDEnNBabFNKm(bK6v2EnyeblT, VHAt7CcYKC2T, stacklevel=ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062', 0o10)) p_wnZQVqalzm = ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31', 0b1000) jSV9IKnemH7K = oVre8I6UXc3b.dtype if yBUx5qcFiTz6(RlLNSsrUm3zD): RlLNSsrUm3zD = -ehT0Px3KOsy9(chr(48) + '\157' + chr(2375 - 2326), 8) elif p_wnZQVqalzm: if RlLNSsrUm3zD in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6\xe5\x98\xe2kBX5}\xc0w\x17'), '\x64' + '\145' + chr(2418 - 2319) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(117) + '\164' + chr(349 - 247) + '\x2d' + chr(0b110111 + 0o1))): RlLNSsrUm3zD = oVre8I6UXc3b.categories.get_loc(RlLNSsrUm3zD) else: jtbovtaIYjRB = xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc\xd9\xab\xcaFI\x1amD\xcfSRO\xd6|T\xb3\x12~s\x99\t\xce6\xe3n#\xa3\x14\xf6\xda\xe8s\x99\x94c\xeeL\xa0i\xb4\xcd\xab\xc5KzK\x7f\x08\xd9W\x01\n\x994]\xa7P$}'), chr(9649 - 9549) + '\x65' + chr(99) + chr(0b1101111) + '\x64' + '\x65')('\x75' + '\164' + chr(0b101010 + 0o74) + '\x2d' + chr(0b0 + 0o70)) raise sznFqDbNBHlx(xafqLlk3kkUe(jtbovtaIYjRB, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\xd0\xb0\xcbKb'), chr(0b1100100) + chr(101) + '\143' + chr(0b100111 + 0o110) + '\144' + '\145')(chr(117) + '\164' + chr(0b110010 + 0o64) + chr(45) + chr(0b110111 + 0o1)))(RlLNSsrUm3zD)) AoWJEgIAbHh_ = JbwkOiAWV1Kb(oVre8I6UXc3b.d5BDZJl_zDsu, BvJfssszZMhp, allow_fill=p_wnZQVqalzm, fill_value=RlLNSsrUm3zD) ShZmEKfTkAOZ = wmQmyeWBmUpv(oVre8I6UXc3b).from_codes(AoWJEgIAbHh_, dtype=jSV9IKnemH7K) return ShZmEKfTkAOZ
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical._slice
def _slice(self, slicer): """ Return a slice of myself. For internal compatibility with numpy arrays. """ # only allow 1 dimensional slicing, but can # in a 2-d case be passd (slice(None),....) if isinstance(slicer, tuple) and len(slicer) == 2: if not com.is_null_slice(slicer[0]): raise AssertionError("invalid slicing for a 1-ndim " "categorical") slicer = slicer[1] codes = self._codes[slicer] return self._constructor(values=codes, dtype=self.dtype, fastpath=True)
python
def _slice(self, slicer): """ Return a slice of myself. For internal compatibility with numpy arrays. """ # only allow 1 dimensional slicing, but can # in a 2-d case be passd (slice(None),....) if isinstance(slicer, tuple) and len(slicer) == 2: if not com.is_null_slice(slicer[0]): raise AssertionError("invalid slicing for a 1-ndim " "categorical") slicer = slicer[1] codes = self._codes[slicer] return self._constructor(values=codes, dtype=self.dtype, fastpath=True)
[ "def", "_slice", "(", "self", ",", "slicer", ")", ":", "# only allow 1 dimensional slicing, but can", "# in a 2-d case be passd (slice(None),....)", "if", "isinstance", "(", "slicer", ",", "tuple", ")", "and", "len", "(", "slicer", ")", "==", "2", ":", "if", "not", "com", ".", "is_null_slice", "(", "slicer", "[", "0", "]", ")", ":", "raise", "AssertionError", "(", "\"invalid slicing for a 1-ndim \"", "\"categorical\"", ")", "slicer", "=", "slicer", "[", "1", "]", "codes", "=", "self", ".", "_codes", "[", "slicer", "]", "return", "self", ".", "_constructor", "(", "values", "=", "codes", ",", "dtype", "=", "self", ".", "dtype", ",", "fastpath", "=", "True", ")" ]
Return a slice of myself. For internal compatibility with numpy arrays.
[ "Return", "a", "slice", "of", "myself", "." ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1893-L1909
train
Return a slice of the object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6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l3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(10600 - 10489) + '\067' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(53) + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + '\064' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1832 - 1784) + '\157' + '\062' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + chr(0b110111) + '\x37', 8), ehT0Px3KOsy9(chr(584 - 536) + chr(111) + chr(0b110100) + chr(51), 43369 - 43361), ehT0Px3KOsy9(chr(48) + chr(5002 - 4891) + chr(0b110011) + chr(0b11101 + 0o30) + chr(0b10 + 0o60), 7587 - 7579), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\x6f' + chr(50) + '\x30' + chr(0b110011), 29125 - 29117), ehT0Px3KOsy9(chr(0b110000) + chr(0b100 + 0o153) + chr(0b110011) + chr(52) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(854 - 804) + chr(0b110100) + chr(0b10011 + 0o43), 0b1000), ehT0Px3KOsy9(chr(48) + chr(5343 - 5232) + chr(0b10011 + 0o43) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\064' + chr(50), 63065 - 63057), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b101001 + 0o11) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(0b1010010 + 0o35) + '\x36' + chr(52), 50679 - 50671), ehT0Px3KOsy9(chr(48) + '\157' + '\x34' + chr(1148 - 1100), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110000 + 0o3) + '\x31' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b101111 + 0o100) + chr(50) + chr(0b101010 + 0o10) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(9927 - 9816) + '\067' + chr(0b110101), 45170 - 45162), ehT0Px3KOsy9(chr(48) + chr(10701 - 10590) + chr(0b110011) + chr(50) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b110010) + chr(0b110100), 7605 - 7597), ehT0Px3KOsy9(chr(175 - 127) + chr(0b1101111) + chr(50) + chr(55) + chr(0b101001 + 0o10), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1092 - 1043) + chr(53) + chr(1697 - 1642), ord("\x08")), ehT0Px3KOsy9('\060' + chr(358 - 247) + chr(49) + chr(0b110001), 33655 - 33647), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101001 + 0o12) + chr(48) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(55) + chr(432 - 378), 0b1000), ehT0Px3KOsy9(chr(1318 - 1270) + '\x6f' + chr(0b110011) + '\067' + '\063', 48133 - 48125), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(1465 - 1416) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\x33' + chr(0b1 + 0o62), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\x33' + '\062', 41494 - 41486), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(2467 - 2417) + chr(54) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100 + 0o56) + chr(0b110001) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001011 + 0o44) + chr(0b101001 + 0o10) + chr(50) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(2333 - 2281) + chr(925 - 874), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110001) + chr(834 - 779), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(538 - 483) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(4890 - 4779) + chr(2281 - 2232) + chr(0b110011) + chr(0b110010), 8), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(5851 - 5740) + chr(50) + chr(48) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(0b100100 + 0o15) + chr(1556 - 1502), 0o10), ehT0Px3KOsy9(chr(48) + chr(225 - 114) + chr(51) + '\066' + chr(979 - 925), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + '\x35' + chr(312 - 264), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x11'), '\144' + chr(2264 - 2163) + '\143' + chr(0b110010 + 0o75) + chr(100) + chr(0b1100101))('\165' + chr(116) + chr(0b100111 + 0o77) + '\055' + chr(0b111000)) + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def FDoqZUQiGlUo(oVre8I6UXc3b, OyGhpW4Gd1Jo): if PlSM16l2KDPD(OyGhpW4Gd1Jo, KNyTy8rYcwji) and c2A0yzQpDQB3(OyGhpW4Gd1Jo) == ehT0Px3KOsy9(chr(1683 - 1635) + '\157' + chr(50), 0o10): if not xafqLlk3kkUe(CDQ27PYjPxZQ, xafqLlk3kkUe(SXOLrMavuUCe(b'V\x9d=}JO\x86\xdc\x93\xcaYA\xb7'), '\x64' + chr(0b10111 + 0o116) + chr(0b1100011) + '\157' + chr(3255 - 3155) + chr(101))('\165' + '\x74' + '\x66' + chr(52 - 7) + '\070'))(OyGhpW4Gd1Jo[ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(844 - 796), 0b1000)]): raise vcEHXBQXuDuh(xafqLlk3kkUe(SXOLrMavuUCe(b'V\x80\x14rSJ\x8e\xa3\x93\xcaYA\xbbZG\xe9\xf7R\xa4t\xd8O8+\xacZ\x92\xe6\xbb9\xd0\xfe5\x04\xe0\xcc3\xe5\xef\x9a'), chr(3611 - 3511) + '\145' + chr(3536 - 3437) + chr(0b1000000 + 0o57) + chr(100) + '\145')(chr(117) + '\164' + chr(1923 - 1821) + chr(0b1101 + 0o40) + chr(56))) OyGhpW4Gd1Jo = OyGhpW4Gd1Jo[ehT0Px3KOsy9(chr(244 - 196) + chr(0b110011 + 0o74) + '\061', 54044 - 54036)] AoWJEgIAbHh_ = oVre8I6UXc3b.d5BDZJl_zDsu[OyGhpW4Gd1Jo] return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'`\x8d\r}LW\x98\xf6\x83\xd2_P'), '\x64' + '\x65' + '\x63' + chr(9882 - 9771) + '\x64' + chr(101))('\x75' + chr(0b1110100) + chr(0b101011 + 0o73) + '\055' + '\x38'))(values=AoWJEgIAbHh_, dtype=xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'[\x9a\x1bcZ'), chr(0b1100100) + chr(0b100001 + 0o104) + chr(1767 - 1668) + chr(0b1100111 + 0o10) + chr(718 - 618) + '\145')(chr(3716 - 3599) + chr(6339 - 6223) + '\146' + chr(0b101101) + '\070')), fastpath=ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\x6f' + chr(49), 8))
pandas-dev/pandas
pandas/core/arrays/categorical.py
Categorical._tidy_repr
def _tidy_repr(self, max_vals=10, footer=True): """ a short repr displaying only max_vals and an optional (but default footer) """ num = max_vals // 2 head = self[:num]._get_repr(length=False, footer=False) tail = self[-(max_vals - num):]._get_repr(length=False, footer=False) result = '{head}, ..., {tail}'.format(head=head[:-1], tail=tail[1:]) if footer: result = '{result}\n{footer}'.format( result=result, footer=self._repr_footer()) return str(result)
python
def _tidy_repr(self, max_vals=10, footer=True): """ a short repr displaying only max_vals and an optional (but default footer) """ num = max_vals // 2 head = self[:num]._get_repr(length=False, footer=False) tail = self[-(max_vals - num):]._get_repr(length=False, footer=False) result = '{head}, ..., {tail}'.format(head=head[:-1], tail=tail[1:]) if footer: result = '{result}\n{footer}'.format( result=result, footer=self._repr_footer()) return str(result)
[ "def", "_tidy_repr", "(", "self", ",", "max_vals", "=", "10", ",", "footer", "=", "True", ")", ":", "num", "=", "max_vals", "//", "2", "head", "=", "self", "[", ":", "num", "]", ".", "_get_repr", "(", "length", "=", "False", ",", "footer", "=", "False", ")", "tail", "=", "self", "[", "-", "(", "max_vals", "-", "num", ")", ":", "]", ".", "_get_repr", "(", "length", "=", "False", ",", "footer", "=", "False", ")", "result", "=", "'{head}, ..., {tail}'", ".", "format", "(", "head", "=", "head", "[", ":", "-", "1", "]", ",", "tail", "=", "tail", "[", "1", ":", "]", ")", "if", "footer", ":", "result", "=", "'{result}\\n{footer}'", ".", "format", "(", "result", "=", "result", ",", "footer", "=", "self", ".", "_repr_footer", "(", ")", ")", "return", "str", "(", "result", ")" ]
a short repr displaying only max_vals and an optional (but default footer)
[ "a", "short", "repr", "displaying", "only", "max_vals", "and", "an", "optional", "(", "but", "default", "footer", ")" ]
9feb3ad92cc0397a04b665803a49299ee7aa1037
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/categorical.py#L1933-L1946
train
a short repr displaying only max_vals and an optional footer
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_b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KaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__ SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(0b1100 + 0o47) + chr(2132 - 2084) + chr(0b101001 + 0o13), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110100), 25511 - 25503), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b11111 + 0o120) + chr(1804 - 1750) + chr(652 - 599), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(1874 - 1823) + chr(651 - 597) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(0b110111) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100011 + 0o114) + chr(0b110001) + '\065' + chr(2152 - 2101), ord("\x08")), ehT0Px3KOsy9(chr(390 - 342) + '\x6f' + chr(0b110010) + chr(0b1001 + 0o53) + chr(0b110101), 27152 - 27144), ehT0Px3KOsy9('\060' + chr(0b11011 + 0o124) + '\x31' + chr(48) + chr(0b100010 + 0o17), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + '\x36' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + '\x35', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b0 + 0o63) + chr(0b11111 + 0o21) + chr(2144 - 2089), ord("\x08")), ehT0Px3KOsy9(chr(1070 - 1022) + chr(7199 - 7088) + '\x33' + chr(50) + chr(52), 5610 - 5602), ehT0Px3KOsy9(chr(1779 - 1731) + chr(111) + chr(0b110010) + chr(0b110001) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2114 - 2063) + '\067' + '\063', 0o10), ehT0Px3KOsy9(chr(991 - 943) + chr(0b1101111) + chr(0b110010) + chr(1612 - 1557) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101110 + 0o7) + '\064', 0o10), ehT0Px3KOsy9(chr(1510 - 1462) + chr(0b1011000 + 0o27) + chr(0b110001) + chr(0b100111 + 0o12) + chr(0b101111 + 0o2), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1034 - 979) + chr(0b10011 + 0o37), ord("\x08")), ehT0Px3KOsy9(chr(1661 - 1613) + '\x6f' + '\063' + chr(0b110110 + 0o1) + '\x30', 53480 - 53472), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(0b110001) + chr(0b110011) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b11100 + 0o33) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + chr(0b101100 + 0o13) + '\065', 47869 - 47861), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + chr(218 - 168) + chr(0b110010) + chr(248 - 197), 0b1000), ehT0Px3KOsy9(chr(1768 - 1720) + chr(0b1100101 + 0o12) + '\062' + '\x32' + '\066', 0o10), ehT0Px3KOsy9(chr(2070 - 2022) + chr(111) + chr(0b11001 + 0o31) + '\x37' + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\x30' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000110 + 0o51) + chr(74 - 23) + '\x32', 63369 - 63361), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + chr(50) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1001 + 0o50) + '\067' + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1432 - 1382) + chr(0b110101) + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(2728 - 2673) + chr(1963 - 1914), 14401 - 14393), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + chr(0b110010) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b10010 + 0o135) + chr(0b110010) + '\x35' + chr(692 - 637), ord("\x08")), ehT0Px3KOsy9('\060' + chr(10652 - 10541) + chr(50) + chr(53) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + '\x31' + '\x31' + '\x32', 0b1000), ehT0Px3KOsy9(chr(1748 - 1700) + chr(1475 - 1364) + chr(0b110001) + chr(55) + '\x31', 17739 - 17731), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1101111) + chr(55) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(8574 - 8463) + chr(295 - 246) + chr(0b110100) + '\065', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(10418 - 10307) + chr(0b110101) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)]) def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh): try: return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xea'), '\x64' + chr(0b1100101) + '\x63' + chr(111) + chr(0b100110 + 0o76) + chr(101))(chr(117) + chr(116) + '\146' + chr(0b101010 + 0o3) + '\x38') + _CF03Rifpmdh) except yROw0HWBk0Qc: return jFWsnpHpAUWz(RqocVGOryNPv) def _yvHtRPyBZF6(oVre8I6UXc3b, GVwvy2N7Lby4=ehT0Px3KOsy9(chr(949 - 901) + chr(111) + '\x31' + chr(1353 - 1303), 0o10), RowFGF5N488i=ehT0Px3KOsy9('\060' + chr(6176 - 6065) + '\x31', 0o10)): jFuGPhnxN9fq = GVwvy2N7Lby4 // ehT0Px3KOsy9(chr(48) + chr(111) + chr(1199 - 1149), 0o10) jTNf3myQ667Q = oVre8I6UXc3b[:jFuGPhnxN9fq]._get_repr(length=ehT0Px3KOsy9('\060' + '\x6f' + '\x30', ord("\x08")), footer=ehT0Px3KOsy9(chr(2265 - 2217) + chr(111) + chr(0b101000 + 0o10), 8)) MRDazcvQ586D = oVre8I6UXc3b[-(GVwvy2N7Lby4 - jFuGPhnxN9fq):]._get_repr(length=ehT0Px3KOsy9('\x30' + '\157' + chr(716 - 668), 8), footer=ehT0Px3KOsy9('\060' + chr(2146 - 2035) + chr(0b110000), 8)) ShZmEKfTkAOZ = xafqLlk3kkUe(SXOLrMavuUCe(b'\xbflcT\x93\x00G\x85o\xdd;\xeb\xf4\xf7\x8f\xdbE%G'), chr(0b110100 + 0o60) + chr(0b1100101) + '\x63' + chr(0b1101111) + '\x64' + chr(4208 - 4107))(chr(0b11011 + 0o132) + chr(0b1110100) + '\146' + chr(1345 - 1300) + chr(0b100111 + 0o21)).format(head=jTNf3myQ667Q[:-ehT0Px3KOsy9(chr(2249 - 2201) + '\157' + '\x31', 8)], tail=MRDazcvQ586D[ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + chr(0b100011 + 0o16), 8):]) if RowFGF5N488i: ShZmEKfTkAOZ = xafqLlk3kkUe(SXOLrMavuUCe(b'\xbfvcF\x82\x11\x1f\xd8K\x88s\xa8\xbb\xf8\x9e\xc8Q'), '\x64' + '\x65' + '\x63' + chr(111) + chr(0b1100100) + chr(0b101110 + 0o67))(chr(117) + chr(0b111101 + 0o67) + chr(10211 - 10109) + chr(0b101101) + chr(0b101000 + 0o20)).format(result=ShZmEKfTkAOZ, footer=oVre8I6UXc3b._repr_footer()) return M8_cKLkHVB2V(ShZmEKfTkAOZ)