Jul-11-2022, 02:47 PM
When I run the Seaborn/Python following code on my laptop computer, I get the following output
What am I doing wrong?
Thanks in advance.
Respectfully,
LZ
Error:ValueError Traceback (most recent call last)
Input In [24], in <cell line: 3>()
1 corr = df2.corr()
2 plt.figure(figsize=(24,24))
----> 3 sns.heatmap(corr, annot=True, fmt = ".1ft")
File ~\miniconda3\envs\pump-failure-pred\lib\site-packages\seaborn\_decorators.py:46, in _deprecate_positional_args.<locals>.inner_f(*args, **kwargs)
36 warnings.warn(
37 "Pass the following variable{} as {}keyword arg{}: {}. "
38 "From version 0.12, the only valid positional argument "
(...)
43 FutureWarning
44 )
45 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)})
---> 46 return f(**kwargs)
File ~\miniconda3\envs\pump-failure-pred\lib\site-packages\seaborn\matrix.py:553, in heatmap(data, vmin, vmax, cmap, center, robust, annot, fmt, annot_kws, linewidths, linecolor, cbar, cbar_kws, cbar_ax, square, xticklabels, yticklabels, mask, ax, **kwargs)
551 if square:
552 ax.set_aspect("equal")
--> 553 plotter.plot(ax, cbar_ax, kwargs)
554 return ax
File ~\miniconda3\envs\pump-failure-pred\lib\site-packages\seaborn\matrix.py:348, in _HeatMapper.plot(self, ax, cax, kws)
346 # Annotate the cells with the formatted values
347 if self.annot:
--> 348 self._annotate_heatmap(ax, mesh)
File ~\miniconda3\envs\pump-failure-pred\lib\site-packages\seaborn\matrix.py:256, in _HeatMapper._annotate_heatmap(self, ax, mesh)
254 lum = relative_luminance(color)
255 text_color = ".15" if lum > .408 else "w"
--> 256 annotation = ("{:" + self.fmt + "}").format(val)
257 text_kwargs = dict(color=text_color, ha="center", va="center")
258 text_kwargs.update(self.annot_kws)
ValueError: Invalid format specifier
Frankly, I cannot see the error. The line looks correct to me. I even tried to run it with single quotes around the format specifier. I got the same error. What am I doing wrong?
Thanks in advance.
Respectfully,
LZ