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

Fix 'T' is deprecated #1955

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Fix 'T' is deprecated #1955

merged 1 commit into from
Jun 4, 2024

Conversation

lp177
Copy link
Contributor

@lp177 lp177 commented Jun 1, 2024

site-packages/yfinance/scrapers/history.py:239: FutureWarning: 'T' is deprecated and will be removed in a future version, please use 'min' instead.

site-packages/yfinance/scrapers/history.py:239: FutureWarning: 'T' is deprecated and will be removed in a future version, please use 'min' instead.
@ValueRaider
Copy link
Collaborator

ValueRaider commented Jun 3, 2024

Does pandas 1.3.0 support change? That's our minimum version.

Or change target to dev and let others answer #1084

@lp177
Copy link
Contributor Author

lp177 commented Jun 4, 2024

@ValueRaider This seems supported, I've test with this example on pandas 1.3.0 and python 3.9.19 :

import pandas as pd
import numpy as np

date_range = pd.date_range(start='2023-01-01 00:00:00', end='2023-01-01 23:59:59', freq='S')
temperature_data = np.random.normal(loc=20, scale=5, size=len(date_range))
nan_indices = np.random.choice(len(date_range), size=100, replace=False)
temperature_data[nan_indices] = np.nan
df = pd.DataFrame({'Date': date_range, 'Temperature': temperature_data})
df.set_index('Date', inplace=True)
df['Temperature'].fillna(method='ffill', inplace=True)
minute_avg_temperature = df.resample('Min').mean()
print(minute_avg_temperature)

@ValueRaider ValueRaider merged commit b27b88c into ranaroussi:main Jun 4, 2024
@lp177 lp177 deleted the patch-1 branch June 4, 2024 12:53
@ValueRaider ValueRaider mentioned this pull request Jun 28, 2024
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.

None yet

2 participants