Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Fix notebook `intermediate/indexing/why-an-index.ipynb`

オープン 初心者向け
#376 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
jupyter-notebook, python
領域
data

調査の方向性

intermediate/indexing/why-an-index.ipynb を開き、上から下まで実行してください。Cell In[16] に注目してください。ここでは periodic.sel(angle=q) によって要素数1の angle 次元が生成されます。配列入力でのインデックス付けの挙動を確認し、プロットされる値が q の721個の要素と一致するようにノートブックを更新してください。報告されている次元エラーなしでノートブック全体を再実行できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

This notebook (looking at 54df4e2fc01e51905210793f7aa01df0d87be86b ) doesn't run top to bottom

Cell In[16], [line 7](vscode-notebook-cell:?execution_count=16&line=7)
      3 periodic_temp = periodic.sel(angle=q)
      4 
      5 fig, ax = plt.subplots(figsize=(9, 4))
      6 ax.scatter(sensor_fold, metal_ring.values, color="0.3", s=45, zorder=5, label="the sensors")
----> [7](vscode-notebook-cell:?execution_count=16&line=7) ax.plot(q, periodic_temp, color="tab:green", lw=2.5, label="PeriodicIndex .sel")
      8 ax.plot(q, default_temp, color="tab:red", lw=2, label="default index")
      9 ax.axvline(0, color="0.6", ls=":", lw=1)
     10 ax.set_xlabel("query angle (°)")

File ~/coding/repos/xarray-tutorial/.pixi/envs/default/lib/python3.14/site-packages/matplotlib/axes/_axes.py:1792, in Axes.plot(self, scalex, scaley, data, *args, **kwargs)
   1549 """
   1550 Plot y versus x as lines and/or markers.
   1551 
   (...)   1789 (``'green'``) or hex strings (``'#008000'``).
   1790 """
   1791 kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
-> [1792](https://file+.vscode-resource.vscode-cdn.net/Users/Hodgs004/coding/repos/xarray-tutorial/intermediate/indexing/~/coding/repos/xarray-tutorial/.pixi/envs/default/lib/python3.14/site-packages/matplotlib/axes/_axes.py:1792) lines = [*self._get_lines(self, *args, data=data, **kwargs)]
   1793 for line in lines:
   1794     self.add_line(line)

File ~/coding/repos/xarray-tutorial/.pixi/envs/default/lib/python3.14/site-packages/matplotlib/axes/_base.py:331, in _process_plot_var_args.__call__(self, axes, data, return_kwargs, *args, **kwargs)
    329     this += args[0],
...
    511 if x.ndim > 2 or y.ndim > 2:
    512     raise ValueError(f"x and y can be no greater than 2D, but have "
    513                      f"shapes {x.shape} and {y.shape}")

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

I don't think the index is working as expected when angle is an array input.

periodic_temp = periodic.sel(angle=q) # `q.shape` is `(721,)`
# but `periodic_temp.sizes` is `Frozen({'angle': 1})`

cc @ianhi

主要言語
Jupyter Notebook
スター
204
フォーク
121
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

xarray-contrib/xarray-tutorial のほかの issue

xarray-contrib/xarray-tutorial の issue をすべて見る

似ている issue

Data Engineering の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。