Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/numpy/numpy
/ asbytes
Function
asbytes
numpy/compat/py3k.py:39–42 ·
view source on GitHub ↗
(s)
Source
from the content-addressed store, hash-verified
37
return
str(s)
38
39
def
asbytes(s):
40
if
isinstance(s, bytes):
41
return
s
42
return
str(s).encode(
'latin1'
)
43
44
def
asstr(s):
45
if
isinstance(s, bytes):
Callers
14
center
Function · 0.90
ljust
Function · 0.90
rjust
Function · 0.90
test_junk_in_string_fields_of_recarray
Method · 0.90
fromregex
Function · 0.90
__init__
Method · 0.90
write
Method · 0.90
writelines
Method · 0.90
test_array
Method · 0.90
test_header_footer
Method · 0.90
test_gft_from_gzip
Method · 0.90
count
Method · 0.90
Calls
1
encode
Method · 0.80
Tested by
9
test_junk_in_string_fields_of_recarray
Method · 0.72
__init__
Method · 0.72
write
Method · 0.72
writelines
Method · 0.72
test_array
Method · 0.72
test_header_footer
Method · 0.72
test_gft_from_gzip
Method · 0.72
count
Method · 0.72
test_check_on_fields
Method · 0.72