Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
"""
wx Sizer
@author: Dazhuang
"""
import wx
class Frame1(wx.Frame):
def __init__(self, parent):
# -*- coding: utf-8 -*-
"""
mouse event handling
@author: Dazhuang
"""
import wx
class Frame1(wx.Frame):
def __init__(self, parent):
# -*- coding: utf-8 -*-
"""
wxPython plot
@author: Dazhuang
"""
import datetime as dt
import my_finance as finance
# -*- coding: utf-8 -*-
"""
get DJI data
@author: Dazhuang
"""
import json
import re
# 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")
# -*- 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]
# -*- coding: utf-8 -*-
"""
plot the average close of KO
@author: Dazhuang
"""
import requests
import re
import json
# -*- coding: utf-8 -*-
"""
plot volumes
@author: Dazhuang
"""
import requests
import re
import json
# -*- coding: utf-8 -*-
"""
Count days
@author: Dazhuang
"""
import requests
import re
import json
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