本文整理汇总了Python中pandas.compat.str_to_bytes方法的典型用法代码示例。如果您正苦于以下问题:Python compat.str_to_bytes方法的具体用法?Python compat.str_to_bytes怎么用?Python compat.str_to_bytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandas.compat
的用法示例。
在下文中一共展示了compat.str_to_bytes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_decode_big_escape
# 需要导入模块: from pandas import compat [as 别名]
# 或者: from pandas.compat import str_to_bytes [as 别名]
def test_decode_big_escape(self):
# Make sure no Exception is raised.
for _ in range(10):
base = '\u00e5'.encode("utf-8") if compat.PY3 else "\xc3\xa5"
quote = compat.str_to_bytes("\"")
escape_input = quote + (base * 1024 * 1024 * 2) + quote
ujson.decode(escape_input)
示例2: test_decodeBigEscape
# 需要导入模块: from pandas import compat [as 别名]
# 或者: from pandas.compat import str_to_bytes [as 别名]
def test_decodeBigEscape(self):
for x in range(10):
if compat.PY3:
base = '\u00e5'.encode('utf-8')
else:
base = "\xc3\xa5"
quote = compat.str_to_bytes("\"")
input = quote + (base * 1024 * 1024 * 2) + quote
output = ujson.decode(input) # noqa
示例3: test_decodeBigEscape
# 需要导入模块: from pandas import compat [as 别名]
# 或者: from pandas.compat import str_to_bytes [as 别名]
def test_decodeBigEscape(self):
for x in range(10):
if compat.PY3:
base = '\u00e5'.encode('utf-8')
else:
base = "\xc3\xa5"
quote = compat.str_to_bytes("\"")
input = quote + (base * 1024 * 1024 * 2) + quote
output = ujson.decode(input)