Skip to content

Commit 9375655

Browse files
committed
add raw string symbol to string which is for regular expression
1 parent c509318 commit 9375655

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/io/parsers.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,8 @@ def _maybe_dedup_names(self, names):
15021502
col = col[:-1] + ('{column}.{count}'.format(
15031503
column=col[-1], count=cur_count),)
15041504
else:
1505-
col = '{column}.{count}'.format(column=col, count=cur_count)
1505+
col = '{column}.{count}'.format(
1506+
column=col, count=cur_count)
15061507
cur_count = counts[col]
15071508

15081509
names[i] = col
@@ -1792,7 +1793,8 @@ def _cast_types(self, values, cast_type, column):
17921793
copy=True, skipna=True)
17931794
except ValueError:
17941795
raise ValueError(
1795-
"Unable to convert column {column} to type {cast_type}".format(
1796+
"Unable to convert column {column} to type "
1797+
"{cast_type}".format(
17961798
column=column, cast_type=cast_type))
17971799
return values
17981800

@@ -2259,9 +2261,9 @@ def __init__(self, f, **kwds):
22592261

22602262
if self.thousands is None:
22612263
self.nonnum = re.compile(
2262-
'[^-^0-9^{decimal}]+'.format(decimal=self.decimal))
2264+
r'[^-^0-9^{decimal}]+'.format(decimal=self.decimal))
22632265
else:
2264-
self.nonnum = re.compile('[^-^0-9^{thousands}^{decimal}]+'.format(
2266+
self.nonnum = re.compile(r'[^-^0-9^{thousands}^{decimal}]+'.format(
22652267
thousands=self.thousands, decimal=self.decimal))
22662268

22672269
def _set_no_thousands_columns(self):

0 commit comments

Comments
 (0)