-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
BUG: pd.offsets.MonthEnd() delevers wrong month #49133
BUG: pd.offsets.MonthEnd() delevers wrong month #49133
Conversation
[DOC] - Added more examples and explanation regarding MonthEnd method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is off to a good start - could you update the PR title to be the same as the issue?
pandas/_libs/tslibs/offsets.pyx
Outdated
When parameter n=0, always offset to the end of month. | ||
|
||
When parameter n=1, depend on the given date: | ||
a) Given date is on an anchor point (last day of the month) -> offset to the end of the following month. | ||
b) Given date is not on an anchor point -> offset to the end of the same month. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can these go in the description of the n
parameter?
Timestamp('2022-01-31 00:00:00') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a short sentence before the examples you've added to clarify what the reader is meant to take away from them? see https://pandas.pydata.org/docs/development/contributing_docstring.html#section-7-examples
you'll also need
in the PR description (as per the template) |
and finally, you should check that |
@MarcoGorelli Thanks for your comments. Very useful. I've made some updates now and another updates will follow this evening! |
@MarcoGorelli I still receive error regarding trailing white spaces: However I removed all the white spaces in the end of lines. Not sure what else I could do. Do you have any idea, what may cause this problem? |
the hook has taken care of it for you - now you can just do as an aside, please don't post images of code |
n : int, default 1 | ||
n = 0 -> offset to the end of month. | ||
n = 1 -> depend on the given date: | ||
a) Given date is on an anchor point (last day of the month) -> offset to the end of the following month. | ||
b) Given date is not on an anchor point -> offset to the end of the same month. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this look right? can you try building this page of the docs to check please? https://pandas.pydata.org/docs/dev/development/contributing_documentation.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but I will need more time for this. I still have trouble with setting up virtual environment (spend one hour with it today and will continue tomorrow)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the version of Python you are using? I created a virtual environment on top of Python 3.10, and trying to install packagse from requirements-dev.txt, however it always stuck at installation of boto3:
`
Using cached boto3-1.24.38-py3-none-any.whl (132 kB)
Using cached boto3-1.24.37-py3-none-any.whl (132 kB)
Using cached boto3-1.24.36-py3-none-any.whl (132 kB)
Using cached boto3-1.24.35-py3-none-any.whl (132 kB)
Using cached boto3-1.24.34-py3-none-any.whl (132 kB)
Using cached boto3-1.24.33-py3-none-any.whl (132 kB)
Using cached boto3-1.24.32-py3-none-any.whl (132 kB)`
Is it better to use older version of Python - e.g. 3.9? Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do ask (here or on Slack) if it's unclear / anything trips you up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to run it again, and also installed C++ Build Tools, but still receiving similar error. Please see below the full traceback:
Traceback_error.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, sorry - you could ask on Slack , or try using Ubuntu via the WSL on Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thank you. I don't want to sound like giving up. However unfortunately, this is going deeper and deeper technical, and I feel I am not able to effectively contribute. Is it OK, if I share the updated text of documentation in thread under the issue, and leave it for someone more technically capable to proceed with implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, that's fine, someone else can take this forwards, and if you feel like trying again, feel free to reach out and ask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks. Maybe I will give it another go this weekend. Will let you know how I decide to proceed then. Thanks
Co-authored-by: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com>
Co-authored-by: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com>
Ok, sure. Let me do it tomorrow. Today I am editing directly on the website, as I don't have access to my personal laptop to run git commands. I'll let you know tomorrow evening, in case the issue remains. Thanks. And ok. |
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
closing for now, but feel free to ping if you want to keep working on this and I can reopen |
[DOC] - Added more examples and explanation regarding MonthEnd method.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.