We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Following #9 (comment)
Pandas is a great Python library for data analysis See https://en.wikipedia.org/wiki/Pandas_(software) for more information
Pandas DataReader, a sibling project of Pandas, provides several remote data sources https://pydata.github.io/pandas-datareader/remote_data.html
Maybe TermGraph could provide 2 examples with Pandas / Pandas DataReader.
One with static data (like https://github.com/sgeisler/termgraph/blob/master/examples/data.csv) #9 (comment) An other example with Python Pandas read_csv function
import pandas as pd df = pd.read_csv("data.csv", sep=";") example_data = df.apply(lambda row: Candle(row["open"], row["high"], row["low"], row["close"]), axis=1)
One with remote data source and a cache mechanism (to avoid too much requests)
import pandas_datareader.data as web import datetime import requests_cache expire_after = datetime.timedelta(days=3) session = requests_cache.CachedSession(cache_name='cache', backend='sqlite', expire_after=expire_after) df = web.DataReader('^DJI', 'stooq', session=session) example_data = df.apply(lambda row: Candle(row["Open"], row["High"], row["Low"], row["Close"]), axis=1)
The text was updated successfully, but these errors were encountered:
Is there an easy way to get the width of the vertical axis units?
import pandas_datareader.data as web import datetime import requests_cache import os from time import sleep from termgraph import CandleStickGraph, Candle size = os.get_terminal_size() window=size.columns-20 expire_after = datetime.timedelta(days=3) session = requests_cache.CachedSession(cache_name='cache', backend='sqlite', expire_after=expire_after) df = web.DataReader('^DJI', 'stooq', session=session) example_data = df.apply(lambda row: Candle(row["Open"], row["High"], row["Low"], row["Close"]), axis=1) for i in range(window, len(example_data)): g = CandleStickGraph(example_data[i-window:i], 55) print(g.draw()) sleep(0.1)
Could be one example with rolling window, but the hardcoded columns-20 is rather ugly :) (also the sqlite cache should be .gitignored)
columns-20
Sorry, something went wrong.
No branches or pull requests
Following #9 (comment)
Pandas is a great Python library for data analysis
See https://en.wikipedia.org/wiki/Pandas_(software) for more information
Pandas DataReader, a sibling project of Pandas, provides several remote data sources
https://pydata.github.io/pandas-datareader/remote_data.html
Maybe TermGraph could provide 2 examples with Pandas / Pandas DataReader.
One with static data (like https://github.com/sgeisler/termgraph/blob/master/examples/data.csv)
#9 (comment)
An other example with Python Pandas read_csv function
One with remote data source and a cache mechanism (to avoid too much requests)
The text was updated successfully, but these errors were encountered: