skka3134

skka3134

email
telegram

2. Process Data

  1. Install pandas, pandas is an open-source software library built on Python for data manipulation and analysis.
pip3 install pandas
  1. Process data, DataFrame is a tabular data structure.
import pandas as pd
data = pd.DataFrame(data)
  1. Process column labels.
data.columns = ['Time','Open','High','Low','Close','Volume']
  1. Time conversion.
data['Time'] = pd.to_datetime(data['Time'], unit='ms')

image
5. Get time and closing price.

data = data[['Time', 'Close']]

image
6. Install pandas ta, pandas TA is an open-source module based on the Pandas module, with over a hundred technical indicators and common indicators.

pip3 install pandas_ta
  1. Calculate indicators, the RSI indicator is based on the principle of supply and demand balance, by measuring the percentage of the total magnitude of price increases in a certain period to the average magnitude of price changes, to evaluate the strength of the long and short forces, and then provide specific operations.
import pandas_ta as ta
df['rsi']=ta.rsi(df['close'],length=10)

image
8. Save to .csv and disable index.

data.to_csv('data.csv',index=False)
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.