This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
wx Sizer | |
@author: Dazhuang | |
""" | |
import wx | |
class Frame1(wx.Frame): | |
def __init__(self, parent): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
mouse event handling | |
@author: Dazhuang | |
""" | |
import wx | |
class Frame1(wx.Frame): | |
def __init__(self, parent): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
wxPython plot | |
@author: Dazhuang | |
""" | |
import datetime as dt | |
import my_finance as finance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
get DJI data | |
@author: Dazhuang | |
""" | |
import json | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Filename: helloworldbtn.py | |
import wx | |
class Frame1(wx.Frame): | |
def __init__(self, parent, title): | |
wx.Frame.__init__(self, parent, title = title) | |
panel = wx.Panel(self) | |
sizer = wx.BoxSizer(wx.VERTICAL) | |
self.text1= wx.TextCtrl(panel, value = "Hello, World!", size = (200,180), style = wx.TE_MULTILINE) | |
sizer.Add(self.text1, 0, wx.ALIGN_TOP | wx.EXPAND) | |
button = wx.Button(panel, label = "Click Me") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
the k-Means Algorithm | |
@author: Dazhuang | |
""" | |
# you can understand this program instead of running it for the website's load | |
# result(may change): [2 2 1 1 2 2 2 2 0 0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
plot the average close of KO | |
@author: Dazhuang | |
""" | |
import requests | |
import re | |
import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
plot volumes | |
@author: Dazhuang | |
""" | |
import requests | |
import re | |
import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Count days | |
@author: Dazhuang | |
""" | |
import requests | |
import re | |
import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
# import Lagrange interpolation functions | |
from scipy.interpolate import lagrange | |
df = pd.read_excel("nan.xlsx") | |
for i in df.columns: | |
for j in range(len(df)): | |
# interpolate it if it is nan | |
if (df[i].isnull())[j]: | |
# Set the number of before and after to be 3, the default is 5 |