我们有我们存储所有的软件SQL表,在开始时间在我们的电脑舰队的靴子:熊猫数据框中特别计数
class Autoruns(Base):
"""Table that stores all of the autoruns."""
__tablename__ = 'autoruns'
id = Column(Integer, primary_key=True, autoincrement=True)
# Table keys
machine_id = Column(String, ForeignKey("machines.id"), nullable=False)
type = Column(String)
path = Column(String)
entry = Column(String)
data = Column(String)
md5_hash = Column(String)
is_signed = Column(Boolean)
# Unique constraint
__table_args__ = (
UniqueConstraint('machine_id', 'type', 'path', 'entry', 'data', 'md5_hash', 'is_signed'),)
列machine_id
是指向的IP地址的外键整数自动运行的机器。
如果将自动运行定义为['type', 'path', 'entry', 'data', 'md5_hash', 'is_signed']
,那么我们如何使用Pandas Dataframe来计算有多少台机器具有特定的自动运行?
我们希望产生的回报是熊猫数据框与一个名为count
新列包含机器自动运行这个发现在数量列出的所有自动运行(减去machine_id
和id
)。
非常感谢您的帮助。
亲切的问候, 亚历山大