We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pandas==1.4.4 FutureWarning解决
Reinforcement-learning-with-tensorflow\contents\2_Q_Learning_maze\RL_brain.py:45: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. self.q_table = self.q_table.append(
def check_state_exist(self, state): if state not in self.q_table.index: # append new state to q table self.q_table = self.q_table.append( pd.Series( [0]*len(self.actions), index=self.q_table.columns, name=state, ) )
def check_state_exist(self, state): if state not in self.q_table.index: # append new state to q table self.q_table = pd.concat([self.q_table, pd.Series( [0]*len(self.actions), index=self.q_table.columns, name=state, ).to_frame().T ])
The text was updated successfully, but these errors were encountered:
thanks a lot
Sorry, something went wrong.
I use this code instead
def check_state_exist(self, state): if state not in self.q_table.index: # append new state to q table new_state = pd.DataFrame( [[0*i for i in range(len(self.actions))]], columns=self.q_table.columns, index=[state], ) self.q_table = pd.concat([self.q_table, new_state], ignore_index=False)
No branches or pull requests
pandas==1.4.4 FutureWarning解决
警告内容
原代码
新代码
The text was updated successfully, but these errors were encountered: