列選択のエラーを修正する
新人の捜査官が credit_records の位置情報の列にアクセスしようとしましたが、いくつか誤りがありました。コードを修正して、怪しい購入を検索できるようにしましょう。
以降のすべての演習では、pandas は pd としてインポートされています。
DataFrame credit_records はすでに読み込まれています。
この演習はコースの一部です
Pythonで始めるデータサイエンス入門
演習の手順
- エラーが出ないようにコードを修正してください。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# One or more lines of code contain errors.
# Fix the errors so that the code runs.
# Select the location column in credit_records
location = credit_records[location]
# Select the item column in credit_records
items = credit_records."item"
# Display results
print(location)