<commit_before>"""
Changming's function for HW7
creates a graphic user interface
generating time series with column chosen by user
"""
import pandas as pd
import matplotlib
matplotlib.use('WX')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure import Figure
import wx


class interface(wx.Frame):
    def __init__(self):
        # ids for panel and widgets in frame
        frame_id = 0
        panel_id = 1
        panel_id2 = 2
        cmbox_id = 2
        bt_id = 3
        # building new frame
        wx.Frame.__init__(self, None, frame_id, 'TimePlot', size=(1000, 500))
        """
        the file name or path( if not in the same folder with py file)
        of the data file
        """
        csvfile = 'pool82014-10-02cleaned.csv'
        self.data = pd.read_csv(csvfile, low_memory=False)
        self.time = pd.DatetimeIndex(self.data['time'])
        # get the column names for comobox
        columns = []
        for x in self.data.columns:
            columns.append(x)
        self.panel = wx.Panel(self, panel_id, style=wx.BORDER)
        self.panel2 = wx.Panel(self, panel_id2, style=wx.BORDER)
        self.cb = wx.ComboBox(self.panel, cmbox_id, choices=columns[2:])
        self.bt = wx.Button(self.panel, bt_id, label='plot')
        # add the figure to panel2
        self.figure = Figure()
        self.canvas = FigureCanvas(self.panel2, -1, self.figure)

        # sizer for panel1
        vSizer = wx.BoxSizer(wx.VERTICAL)
        vSizer.Add(self.cb, 1, wx.ALIGN_CENTER)
        vSizer.Add(self.bt, 1, wx.ALIGN_CENTER)
        hSizer = wx.BoxSizer(wx.HORIZONTAL)
        hSizer.Add(vSizer, 1, wx.ALIGN_CENTER)
        self.panel.SetSizer(hSizer)
<commit_msg>add some space lines to make it more readable<commit_after>"""
Changming's function for HW7
creates a graphic user interface
generating time series with column chosen by user
"""
import pandas as pd
import matplotlib
matplotlib.use('WX')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure import Figure
import wx


class interface(wx.Frame):
    def __init__(self):

        # ids for panel and widgets in frame
        frame_id = 0
        panel_id = 1
        panel_id2 = 2
        cmbox_id = 2
        bt_id = 3

        # building new frame
        wx.Frame.__init__(self, None, frame_id, 'TimePlot', size=(1000, 500))
        """
        the file name or path( if not in the same folder with py file)
        of the data file
        """
        csvfile = 'pool82014-10-02cleaned.csv'
        self.data = pd.read_csv(csvfile, low_memory=False)
        self.time = pd.DatetimeIndex(self.data['time'])

        # get the column names for comobox
        columns = []
        for x in self.data.columns:
            columns.append(x)
        self.panel = wx.Panel(self, panel_id, style=wx.BORDER)
        self.panel2 = wx.Panel(self, panel_id2, style=wx.BORDER)
        self.cb = wx.ComboBox(self.panel, cmbox_id, choices=columns[2:])
        self.bt = wx.Button(self.panel, bt_id, label='plot')

        # add the figure to panel2
        self.figure = Figure()
        self.canvas = FigureCanvas(self.panel2, -1, self.figure)

        # sizer for panel1
        vSizer = wx.BoxSizer(wx.VERTICAL)
        vSizer.Add(self.cb, 1, wx.ALIGN_CENTER)
        vSizer.Add(self.bt, 1, wx.ALIGN_CENTER)
        hSizer = wx.BoxSizer(wx.HORIZONTAL)
        hSizer.Add(vSizer, 1, wx.ALIGN_CENTER)
        self.panel.SetSizer(hSizer)

{'fraction_non_alphanumeric': 0.10073989755264656, 'fraction_numerical': 0.018782014797951052, 'mean_word_length': 2.483647175421209, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3252331', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1148, 'n_words': 304}