diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index c57b1c3e211f6..27cce20e9d319 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1732,10 +1732,11 @@ def validate_col(self, itemsize=None): itemsize = self.itemsize if c.itemsize < itemsize: raise ValueError( - "Trying to store a string with len [%s] in [%s] " - "column but\nthis column has a limit of [%s]!\n" + "Trying to store a string with len [%s] in the " + "column [%s], but\nthis column has a limit of [%s]!\n" "Consider using min_itemsize to preset the sizes on " - "these columns" % (itemsize, self.cname, c.itemsize)) + "these columns" % (itemsize, self.values[0], + c.itemsize)) return c.itemsize return None