Skip to content
New issue

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

Fixed minor issues #4

Closed
wants to merge 2 commits into from
Closed

Fixed minor issues #4

wants to merge 2 commits into from

Conversation

croberts
Copy link

@croberts croberts commented Nov 7, 2017

No description provided.

@@ -71,7 +71,7 @@ def choose_action(self, observation):
# some actions have the same value
state_action = state_action.reindex(np.random.permutation(state_action.index))

action = state_action.argmax()
action = state_action.values.argmax()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change stops my code from properly selecting an action, what is this change for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was having trouble running your example code -- I haven't spent enough time pinpointing this issue to tell you exactly what's wrong, but I did find a quick fix here.

From what I skimmed it has to do with argmax being deprecated in a newer version of pandas' dtype. The specific error I was getting is TypeError: reduction operation 'argmax' not allowed for this dtype.

I can investigate this further if you think it's worth pursuing, we can simply close the PR as a non-issue, or perhaps the best solution is to include a requirements.txt to lock in the versions of things.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ClRobert it turns out you can use action = state_action.idxmax()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks 👍

@croberts croberts closed this Feb 1, 2018
@croberts croberts deleted the type_error branch February 1, 2018 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants