Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: x and y must have same first dimension, but have shapes (1,) and (306,) #4

Open
lategoodbye opened this issue Aug 25, 2022 · 3 comments

Comments

@lategoodbye
Copy link

Hi,
i try to use iostat-cli (version 0.3.0) but i only get this stacktrace:

iostat-cli --data 5.19_SDCIT_patch_nooptimize_download_success.iostat.log --disk mmcblk1 --fig-output success.png plot
Traceback (most recent call last):
File "/home/stefanw/.local/bin/iostat-cli", line 8, in
sys.exit(main())
File "/home/stefanw/.local/lib/python3.10/site-packages/iostat/main.py", line 217, in main
plotter.plot()
File "/home/stefanw/.local/lib/python3.10/site-packages/iostat/plotter.py", line 202, in plot
self.plot_device(datetime_data)
File "/home/stefanw/.local/lib/python3.10/site-packages/iostat/plotter.py", line 188, in plot_device
self.subplots[name].plot(x, values, label=column)
File "/home/stefanw/.local/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 1635, in plot
lines = [*self._get_lines(*args, data=data, **kwargs)]
File "/home/stefanw/.local/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 312, in call
yield from self._plot_args(this, kwargs)
File "/home/stefanw/.local/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 498, in _plot_args
raise ValueError(f"x and y must have same first dimension, but "
ValueError: x and y must have same first dimension, but have shapes (1,) and (306,)

What's wrong here?
Thanks in advance

5.19_SDCIT_patch_nooptimize_download_success.iostat.log

@Bschitter
Copy link

I am also getting the same or a very similar error:

iostat-cli --data iostat.log --disk sdc --fig-output sdc.png plot --without-cpu
Traceback (most recent call last):
  File "/home/bschitter/.local/bin/iostat-cli", line 8, in <module>
    sys.exit(main())
  File "/home/bschitter/.local/lib/python3.10/site-packages/iostat/main.py", line 217, in main
    plotter.plot()
  File "/home/bschitter/.local/lib/python3.10/site-packages/iostat/plotter.py", line 202, in plot
    self.plot_device(datetime_data)
  File "/home/bschitter/.local/lib/python3.10/site-packages/iostat/plotter.py", line 188, in plot_device
    self.subplots[name].plot(x, values, label=column)
  File "/home/bschitter/.local/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 1668, in plot
    lines = [*self._get_lines(*args, data=data, **kwargs)]
  File "/home/bschitter/.local/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 311, in __call__
    yield from self._plot_args(
  File "/home/bschitter/.local/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 504, in _plot_args
    raise ValueError(f"x and y must have same first dimension, but "
ValueError: x and y must have same first dimension, but have shapes (1,) and (15012,)

Python Version: Python 3.10.6
OS: Linux Mint 21.1

@Bschitter
Copy link

I figured out, that my iostat log file had an unsupported date format.
After changing it from %d.%m.%Y %H:%M:%S to %m/%d/%Y %I:%M:%S %p all worked fine.

@lategoodbye maybe that is also the problem in your case

@lyh543
Copy link

lyh543 commented Feb 20, 2023

After running export LC_ALL=en_US.UTF-8, my iostat result works well.

Can you please raise a more friendly error message when the date format is error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants