Bug BBQ: Call to `reset_index` in merging lesson not needed?
まだ誰も着手していません。
評価
調査の方向性
04-merging-data のマージに関するレッスンから始め、survey_sub と survey_sub_last10 の連結例として示されているものを調べてください。reset_index(drop=True) を使用した場合と使用しない場合の結果を、結果として得られるインデックス値も含めて比較し、issue の議論を確認してください。完了とは、レッスンの指示と説明が必要な動作を正確に記述していることを意味します。
索引モデルが issue の本文から書いたものです。
説明
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 はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
datacarpentry/python-ecology-lesson のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
-
Error in solution to "Challenge - Plots"対応中かも @archaeolauren が 189 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Recommend a supported Python release, not just any 3.x対応中かも @nbdani が 192 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
datacarpentry/python-ecology-lesson の issue をすべて見る
似ている issue
-
[Bug] Dated CSV export filenames use the UTC day rather than the operator day対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/rocketmq-dashboard#6896 ·
メンテナーはふだん 3 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
data
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
gaseous-project/hasheous#637 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信