19 lines
404 B
Python
19 lines
404 B
Python
import pandas as pd
|
|
|
|
|
|
class DateFrameHolder:
|
|
|
|
def __init__(self, df=None):
|
|
self.df = df or pd.DataFrame()
|
|
# self.df = pd.DataFrame.from_records([dict(a=1, b=2, c=3)] * 4) #TODO: remove
|
|
|
|
def append(self, data):
|
|
data = pd.DataFrame.from_records([data])
|
|
self.df = pd.concat([self.df, data], ignore_index=True)
|
|
|
|
def clear(self):
|
|
self.df = pd.DataFrame()
|
|
|
|
|
|
|