<jupyter_start><jupyter_text>The data used for this example comes from [TickData](https://www.tickdata.com).  You can find their [sample data here](https://www.tickdata.com/tooltip/sample-data/).<jupyter_code>import pandas as pd

df = pd.read_csv("/Users/jheaton/Downloads/SampleEquityData_US/Trades/14081.csv",
                header = None)

df.dtypes
df.columns = ['date','time','price','size',
                "exchange_code",
                "sales_condition",
                "correction_indicator",
                "sequence_number",
                "trade_stop_indicator",
                "trade_source",
                "trf",
                "exclude_record_flag",
                "filtered_price"]
df.drop("exchange_code", axis=1, inplace=True)
df.drop("sales_condition", axis=1, inplace=True)
df.drop("correction_indicator", axis=1, inplace=True)
df.drop("sequence_number", axis=1, inplace=True)
df.drop("trade_stop_indicator", axis=1, inplace=True)
df.drop("trade_source", axis=1, inplace=True)
df.drop("trf", axis=1, inplace=True)
df.drop("exclude_record_flag", axis=1, inplace=True)
df.drop("filtered_price", axis=1, inplace=True)
df.head()
df.insert(0,"timestamp", pd.to_datetime(df['date'] + ' ' + df['time']))
df.drop("date", axis=1, inplace=True)
df.drop("time", axis=1, inplace=True)
df.set_index("timestamp",inplace=True)
df2 = df['price'].resample('1H').ohlc()
#df2 = df2.asfreq('D')
#df2.to_csv("test.csv")
df2
df2
import plotly.graph_objects as go

fig = go.Figure(data=[go.Candlestick(x=df2.index,
                open=df2['open'],
                high=df2['high'],
                low=df2['low'],
                close=df2['close'])])

fig.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17038777908343125, 'fraction_numerical': 0.017038777908343124, 'mean_word_length': 3.4934036939313984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '94774', 'license': 'Apache-2.0', 'n_tokens_mistral': 619, 'n_tokens_neox': 586, 'n_words': 91, 'path': 'youtube/financial_time_series.ipynb', 'repo_name': 'awaiswill/present', 'size': '1702'}