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

Bug BBQ: Call to `reset_index` in merging lesson not needed?

オープン
#224 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
data

調査の方向性

04-merging-data のマージに関するレッスンから始め、survey_sub と survey_sub_last10 の連結例として示されているものを調べてください。reset_index(drop=True) を使用した場合と使用しない場合の結果を、結果として得られるインデックス値も含めて比較し、issue の議論を確認してください。完了とは、レッスンの指示と説明が必要な動作を正確に記述していることを意味します。

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

説明

help wanted type:clarification

The merging lesson has the following code excerpt:

# read in first 10 lines of surveys table
survey_sub = surveys_df.head(10)
# grab the last 10 rows 
survey_sub_last10 = surveys_df.tail(10)
#reset the index values to the second dataframe appends properly
survey_sub_last10=survey_sub_last10.reset_index(drop=True)
# drop=True option avoids adding new index column with old index values

It's not really explained why reset_index needs to be called for the second frame to append "properly". I tried following along without resetting the index, and it seemed to do the right thing. Of course there's a big gap between the index values in the first and second half of the concatenated df, but that seems fine to me (and even preferable to having duplicate index values, which happens if you call reset_index).

I'm inclined to remove that line, but it's possible I'm missing something.

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

環境構築

はじめの一歩

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

datacarpentry/python-ecology-lesson のほかの issue

datacarpentry/python-ecology-lesson の issue をすべて見る

似ている issue

Data Engineering の issue をもっと見る

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

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