Как я могу решить эту проблему с индексом панд ?
Traceback (most recent call last): File "C:/Users/USER/PycharmProjects/KKOP/neuralN.py", line 10, in <module> X = data[:284,0:43] File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\frame.py", line 2899, in __getitem__ indexer = self.columns.get_loc(key) File "C:\Users\USER\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2889, in get_loc return self._engine.get_loc(casted_key) File "pandas\_libs\index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc File "pandas\_libs\index.pyx", line 75, in pandas._libs.index.IndexEngine.get_loc TypeError: '(slice(None, 284, None), slice(0, 43, None))' is an invalid key
Что я уже пробовал:
<pre><pre lang="Python"> import pandas as pd data = pd.read_csv('bin_data.csv',sep=';') print(data) X = data[:284,0:43] print(X) Y = data[:284,43] model = Sequential() model.add(Dense(20, input_dim=9, init='uniform', activation='relu')) model.add(Dense(12, init='uniform', activation='relu')) model.add(Dense(9, init='uniform', activation='sigmoid')) model.add(Dense(1, init='uniform', activation='sigmoid')) model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']) model.fit(X, Y, nb_epoch=150, batch_size=10, verbose=2) scores = model.evaluate(X,Y) print("%s: %.2f%%" % (model.metrics_names[1], scores[1]*100))