本文整理匯總了Python中pandas.io.common.CParserError方法的典型用法代碼示例。如果您正苦於以下問題:Python common.CParserError方法的具體用法?Python common.CParserError怎麽用?Python common.CParserError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pandas.io.common
的用法示例。
在下文中一共展示了common.CParserError方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_error_rename
# 需要導入模塊: from pandas.io import common [as 別名]
# 或者: from pandas.io.common import CParserError [as 別名]
def test_error_rename():
# see gh-12665
from pandas.errors import ParserError
from pandas.io.common import CParserError
try:
raise CParserError()
except ParserError:
pass
try:
raise ParserError()
except CParserError:
pass
with catch_warnings(record=True):
try:
raise ParserError()
except pd.parser.CParserError:
pass
示例2: _load_df
# 需要導入模塊: from pandas.io import common [as 別名]
# 或者: from pandas.io.common import CParserError [as 別名]
def _load_df(self):
if self._df is None:
try:
self._df = pd.read_csv(self.filename)
except pd.errors.EmptyDataError:
logger.warning(
'Trace %s is empty and needs to be resampled!' %
self.filename)
os.remove(self.filename)
self.corrupted_flag = True
except CParserError:
logger.warning(
'Trace %s has wrong size!' % self.filename)
self.corrupted_flag = True
os.remove(self.filename)
if len(self.flat_names) == 0 and not self.corrupted_flag:
self.flat_names, self.var_shapes = extract_variables_from_df(
self._df)
self.varnames = list(self.var_shapes.keys())
示例3: test_error_rename
# 需要導入模塊: from pandas.io import common [as 別名]
# 或者: from pandas.io.common import CParserError [as 別名]
def test_error_rename():
# see gh-12665
from pandas.errors import ParserError
from pandas.io.common import CParserError
try:
raise CParserError()
except ParserError:
pass
try:
raise ParserError()
except CParserError:
pass