質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
scikit-learn

scikit-learnは、Pythonで使用できるオープンソースプロジェクトの機械学習用ライブラリです。多くの機械学習アルゴリズムが実装されていますが、どのアルゴリズムも同じような書き方で利用できます。

NumPy

NumPyはPythonのプログラミング言語の科学的と数学的なコンピューティングに関する拡張モジュールです。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

pandas

Pandasは、PythonでRにおけるデータフレームに似た型を持たせることができるライブラリです。 行列計算の負担が大幅に軽減されるため、Rで行っていた集計作業をPythonでも比較的簡単に行えます。 データ構造を変更したりデータ分析したりするときにも便利です。

Q&A

9回答

6383閲覧

KeyError: "None of [Int64...'int64')] are in the [columns]"

smart-material

総合スコア12

scikit-learn

scikit-learnは、Pythonで使用できるオープンソースプロジェクトの機械学習用ライブラリです。多くの機械学習アルゴリズムが実装されていますが、どのアルゴリズムも同じような書き方で利用できます。

NumPy

NumPyはPythonのプログラミング言語の科学的と数学的なコンピューティングに関する拡張モジュールです。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

pandas

Pandasは、PythonでRにおけるデータフレームに似た型を持たせることができるライブラリです。 行列計算の負担が大幅に軽減されるため、Rで行っていた集計作業をPythonでも比較的簡単に行えます。 データ構造を変更したりデータ分析したりするときにも便利です。

0グッド

0クリップ

投稿2021/12/10 04:54

前提・実現したいこと

KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Int64Index([6, 0, 1, 2, 3, 4, 5], dtype='int64')] are in the [columns]"
というエラーが発生し、解決したく思います。

発生している問題・エラーメッセージ

Using TensorFlow backend. I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally /home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:471: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:472: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:473: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:474: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:475: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties: name: GeForce GTX 1070 major: 6 minor: 1 memoryClockRate (GHz) 1.7085 pciBusID 0000:01:00.0 Total memory: 7.92GiB Free memory: 7.44GiB I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0) 640/640 [==============================] - 2s 640/640 [==============================] - 1s 640/640 [==============================] - 1s 640/640 [==============================] - 2s 640/640 [==============================] - 2s 640/640 [==============================] - 1s 640/640 [==============================] - 2s 640/640 [==============================] - 1s 640/640 [==============================] - 1s 640/640 [==============================] - 1s Traceback (most recent call last): File "9.py", line 306, in <module> run_test('9_Layer_CNN', epoch1, epoch2) File "9.py", line 266, in run_test result1 = result1.loc[:,[6, 0, 1, 2, 3, 4, 5]] File "/home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/pandas/core/indexing.py", line 873, in __getitem__ return self._getitem_tuple(key) File "/home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/pandas/core/indexing.py", line 1055, in _getitem_tuple return self._getitem_tuple_same_dim(tup) File "/home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/pandas/core/indexing.py", line 750, in _getitem_tuple_same_dim retval = getattr(retval, self.name)._getitem_axis(key, axis=i) File "/home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/pandas/core/indexing.py", line 1099, in _getitem_axis return self._getitem_iterable(key, axis=axis) File "/home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/pandas/core/indexing.py", line 1037, in _getitem_iterable keyarr, indexer = self._get_listlike_indexer(key, axis, raise_missing=False) File "/home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/pandas/core/indexing.py", line 1254, in _get_listlike_indexer self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing) File "/home/a/libraries/anaconda3/envs/main/lib/python3.6/site-packages/pandas/core/indexing.py", line 1298, in _validate_read_indexer raise KeyError(f"None of [{key}] are in the [{axis_name}]") KeyError: "None of [Int64Index([6, 0, 1, 2, 3, 4, 5], dtype='int64')] are in the [columns]"

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

zeeshan

2023/12/28 08:39

⚪︎⚪︎の方法で解決できると思いますがいかがでしょうか? もし解決手段や方法に制限などがあれば教えてください。
guest

回答9

0

I feel a lot more people need to read this, very good info!
[url=https://borrowking.com.tw/]小額貸款[/url]

投稿2023/10/09 05:58

rosstaylor

総合スコア2

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

From purchasing the software to automating your financial accounting, QB Support is here to assist you every step of the way. We leverage the latest remote support quickbooks tool hub and have a team of certified technicians who can deploy your accounting solution in just a few hours. With our dedicated support phone number for QuickBooks, any issues or concerns can be resolved promptly, minimizing disruptions to your business operations. quickbooks tool hub

投稿2023/06/12 08:37

NAVEEL

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

When it comes to Indian weddings, music plays a vital role in setting the right mood and creating memories that last a lifetime. At Montrose Entertainment, we understand the importance of finding the perfect indian bollywood band for a wedding, and we are here to make your dreams come true. Our live band for indian weddings specializes in delivering captivating performances that blend traditional and contemporary Bollywood hits, ensuring an electric atmosphere and a packed dance floor. From soulful melodies to foot-tapping beats, our band will leave your guests mesmerized and asking for more.

投稿2023/06/12 07:22

QKES

総合スコア4

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

Great articles and great layout. Your blog post deserves all of the positive feedback it’s been getting. technology attorney

投稿2023/06/11 09:29

traveon

総合スコア20

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

Typical trips listed below are the ultimate way to many thanks to your energy, which usually is why Now i'm browsing your website each day, trying to find fresh, intriguing details. Several, thanksRacing Rivals Generator

投稿2023/06/11 07:04

NAVEEL

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good workergonomic products for office

投稿2023/06/10 10:25

NAVEEL

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

Stick to the fantastic job, That i look over couple articles or blog posts on this subject web-site together with It is my opinion that online webpage is certainly legitimate appealing and features have communities for superb material.สล็อต 1688

投稿2023/06/10 06:50

NAVEEL

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. personalised rug

投稿2023/06/08 10:44

NAVEEL

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

エラーメッセージから察するに、

File "9.py", line 266, in run_test result1 = result1.loc[:,[6, 0, 1, 2, 3, 4, 5]]

loc ではなく iloc を使うのではないでしょうか。

python

1 result1 = result1.iloc[:,[6, 0, 1, 2, 3, 4, 5]]

投稿2021/12/10 05:02

melian

総合スコア19798

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問