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

Yearly pivots causes error with pandas 2.x #732

Closed
derenderen opened this issue Oct 15, 2023 · 4 comments
Closed

Yearly pivots causes error with pandas 2.x #732

derenderen opened this issue Oct 15, 2023 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@derenderen
Copy link

derenderen commented Oct 15, 2023

Which version are you running? The lastest version is on Github. Pip is for major releases.
0.4.4b0
pandas version: pandas 2.0.3
Do you have TA Lib also installed in your environment?
NO.

Have you tried the development version? Did it resolve the issue?
Using development version.
Describe the bug
Whenever i try to create yearly pivot points i receive error:

ValueError: Units 'M', 'Y', and 'y' are no longer supported, as they do not represent unambiguous timedelta values durations.

500 days of stock data.

pivots = ta.pivots(df['Open'],df['High'],df['Low'],df['Close'],anchor='Y',method='fibonacci')

Setting 'Y' for anchor returns error. It says 'M' is also depreciated. However it works fine if i set 'M' for anchor value.

@derenderen derenderen added the bug Something isn't working label Oct 15, 2023
@derenderen derenderen changed the title Yearly pivots causes depreciation for pandas. Yearly pivots causes error for pandas. Oct 15, 2023
@twopirllc twopirllc removed their assignment Oct 17, 2023
@twopirllc twopirllc added the help wanted Extra attention is needed label Oct 17, 2023
@twopirllc twopirllc changed the title Yearly pivots causes error for pandas. Yearly pivots causes error with pandas 2.x Oct 17, 2023
@twopirllc
Copy link
Owner

Hello @derenderen,

Pandas TA is still being developed with Pandas v1.4+ to support many others using older versions of Pandas and Python. Unfortunately this library is not quite up to Pandas v2.x and needs much more support to progress and to cover more versions. 😐

Why Pandas 2.x offset aliases is not working as intended is beyond me as they look similar to Pandas 1.x offset aliases. 🤷🏼‍♂️

Perhaps the original pivots author @hamedf62 may have knowledge on how to address this issue.

Kind Regards
KJ

@Rossco8
Copy link

Rossco8 commented Mar 8, 2024

The issue comes about because both the resample() method of a pd.Series and df.index = df.index + Timedelta(1, anchor.lower()) could both previously accept Y and M, however only resample() accepts Y now

PR Raised

@Rossco8
Copy link

Rossco8 commented Jul 22, 2024

Hi @twopirllc, I'm just browsing to see if there are any issues i can help with and noticed this is still open. Can it be closed following the merge of the PR?

@twopirllc
Copy link
Owner

@Rossco8

Can it be closed following the merge of the PR?

Yeah probably. Can always reopen later if still unresolved.

Thanks for looking out. 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants