我想要这样的东西 如果用户输入NK则执行IDK 如果用户输入CHKDSK则执行CHKDSK 如果用户输入TRUMP则执行start
答案 0 :(得分:0)
容易吗?正确?
import pandas as pd, numpy as np
class SubDataFrame(pd.Series):
_metadata = ['date']
@property
def _constructor(self):
return SubDataFrame
def __init__(self, *args, **kwargs):
self.date = pd.to_datetime(kwargs.pop('date', pd.datetime.now().date()))
super().__init__(*args, **kwargs)
def __add__(self, other, *args, **kwargs):
# kwargs.setdefault('fill_value', 0);
return super().__add__(other, *args, **kwargs)