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

fetch 時間頗久 #103

Open
allexxcg opened this issue Apr 27, 2022 · 1 comment
Open

fetch 時間頗久 #103

allexxcg opened this issue Apr 27, 2022 · 1 comment

Comments

@allexxcg
Copy link

我執行以下程式碼,將近 1 分鐘才會跑出結果
請問這是正常執行所需要的時間嗎?

import twstock
stock_id = '2330'
stock = twstock.Stock(stock_id)
price_series = stock.fetch_from(2022,4)
print(price_series)
@Kazekawa-azusa
Copy link

不是正常運作的時間,如果你一打開python就使用此程式碼,python 會因為尚未暖機而使效率下降,你可以先跑一些無用程式碼讓他暖機。
再者有可能是你request太多次,導致網域被擋、加長時間。我試了數次,皆介於4s ~ 20s 之間。將近 1 分鐘是過於長了

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

No branches or pull requests

2 participants