- improved

git-svn-id: http://moon:8086/svn/projects/Stock@323 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-12-22 13:20:18 +00:00
parent a673d678b5
commit 6245198667
+3 -2
View File
@@ -23,7 +23,8 @@ def colsum(data, keys):
store = pd.HDFStore('test.h5') store = pd.HDFStore('test.h5')
if 1: if 1:
df = pd.DataFrame(np.array([[1, 2, 3, 101], [4, 5, 6, 102], [7, 8, 9, 103], [10, 11, 12, 104]]),columns=['high', 'low', 'open', 'close']) index = pd.date_range('1/1/2001', periods=4, freq='D')
df = pd.DataFrame(np.array([[1, 2, 3, 101], [4, 5, 6, 102], [7, 8, 9, 103], [10, 11, 12, 104]]),columns=['high', 'low', 'open', 'close'], index=index)
store['df'] = df store['df'] = df
else: else:
df = store['df'] df = store['df']
@@ -33,7 +34,7 @@ df['colsum'] = colsum(df, ['high', 'low', 'open', 'close'])
df['ema(colsum)'] = ema(df, 'colsum') df['ema(colsum)'] = ema(df, 'colsum')
# Print table # Print table
print(df) print(df.loc['2001-01-01':'2001-01-02'])
# Plot graph # Plot graph
df.plot() df.plot()