首页 > 其他分享 >The Network Program Log Three(代码调试过程3)

The Network Program Log Three(代码调试过程3)

时间:2024-10-11 11:48:59浏览次数:1  
标签:Network pkt get df Three field Program print showname


import pyshark
import os

没有提示

files = os.listdir('./shark_files/')
for file in files:
print(file)

ps = pyshark.FileCapture('./shark_files/' + file , tshark_path='D:/ProgramFiles/Wireshark/Wireshark.exe')
for pkt in ps:
print(pkt)
try:
print('------------------------------------------------------------')

print(pkt.tcp.get_field_by_showname('Source Port'))

print(pkt.bgp.get_field_by_showname('AS2'))

print(pkt.bgp.get_field_by_showname('Type'))

if pkt.IPV6.get_field_by_showname(' Address'): #找ipv6下的三层数据

print(pkt.IPV6.get_field_by_showname('NLRI prefix'))

print(pkt.bgp.get_field_by_showname())

print(pkt.)

except Exception as e:
print(e)

import pandas as pd
df = pd.read_csv('test/train.csv' )

1.查看数据

print(df)
print(df.shape)

print(df.info()) # 获取丢失的信息

print(df.describe())

print(df.head(2))

print(df['年龄'])

print((df.loc[0:4,"姓名":"性别"])) # 区间
print((df.loc[[0,4],["姓名","性别"]])) #指定

2.填充数据

年龄填充最小值,修改Nan

age_min = df['年龄'].min()
df['年龄'] = df ['年龄'].fillna(age_min)
print(df)

df.loc[2, '性别'] = 100
print(df)

df = df.sort_values(by='年龄',ascending=True)

df.to_csv('new.csv',index=)

标签:Network,pkt,get,df,Three,field,Program,print,showname
From: https://www.cnblogs.com/heydom/p/18458097

相关文章

  • The Network Program Log Two (Scapy)
    ​【Scapy】【使用scapy处理数据包】scapy的使用fromscapy.allimport*fromscapy.layers.inetimport*pac=dir(scapy.layers)print(pac) #执行代码后,会输出Scapy中的各层['builtins','cached','doc','file','loader','name&......
  • 【Kubernets】容器网络基础二:通讲CNI(Container Network Interface)容器网络接口实现方
    文章目录背景知识Underlay网络Overlay网络一、基本概念二、工作原理三、实现方案四、应用场景两者对比示意图CNI实现有哪些?FlannelFlannel的工作原理Flannel的主要组件数据传输机制总结Calico一、架构基础二、核心组件与功能三、路由与数据包转发四、安全策略五、数......
  • 机器学习之神经网络Neural Network
    第一部分:基本含义神经网络(NeuralNetwork)是一种模仿人脑神经元连接方式的机器学习模型,用于处理复杂的非线性问题。通过大量的参数和层级结构,神经网络可以学习数据中的特征,应用于分类、回归等任务。机器学习和人类实现人生巅峰的例子对比:如果把人比作神经网络,一次次摔倒就是......
  • 《Programming from the Ground Up》阅读笔记:p217-p238
    《ProgrammingfromtheGroundUp》学习第11天,p217-p238总结,总计22页。一、技术总结1.Ccompilingp216,Ccompilingissplitintotwostages-thepreprocessorandthemaincompiler。注:感觉这个写法不好,因为preprocessor和compiler都是对象,这里应该指动作。应该是:Cco......
  • CS224 Program Analysis@Shanghaitech 24 Fall Notes
    1.IntroductionRice'sTheoremStaticAnalysisanalyzesaprogramPtoreasonaboutitsbehaviorsanddetermineswhetheritsatisfiessomepropertiesbeforerunningP.Rice'sTheorem:Anynon-trivialpropertyofthebehaviorofprogramsinare......
  • 《Programming from the Ground Up》阅读笔记:p181-p216
    《ProgrammingfromtheGroundUp》学习第10天,p181-p216总结,总计34页。一、技术总结第10章主要讲计算机是如何计算的,如十进制、二进制、八进制、十六进制以及浮点数和负数的表示。属于比较基础的内容,如果有一定基础,本章可跳过。1.exponent&mantissa示例:p197,12345.2isst......
  • Linux 网络管理-NetworkManager
    Linux网络管理-NetworkManagerNetworkManager教程https://wiki.archlinuxcn.org/wiki/NetworkManagernmcli命令https://ipcmen.com/nmclihttps://www.linuxcool.com/nmcliIP网络配置:https://docs.redhat.com/zh_hans/documentation/red_hat_enterprise_linux/7/html/ne......
  • INFS3208 – Cloud Computing Programming
    SchoolofInformationTechnologyandElectricalEngineeringINFS3208–CloudComputingProgrammingAssignmentTaskIII(10Marks)Taskdescription:Inthisassignment,youareaskedtowriteapieceofSparkcodetocountoccurrencesofverbsintheUN......
  • CS 259 Accelerating Convolutional Neural Network
    Fall2024CS259Lab1AcceleratingConvolutionalNeuralNetwork(CNN)onFPGAsusingMerlinCompilerDueOctober911:59pmDescriptionYourtaskistoacceleratethecomputationoftwolayersinaconvolutionalneuralnetwork(CNN)usingahigh-levelsynt......
  • CAN(Controller Area Network)总线的仲裁机制
    CAN(ControllerAreaNetwork)总线的仲裁机制是其核心特性之一,它确保了在多节点环境中数据能够高效、公正地传输。以下是对CAN仲裁机制的详细解释和介绍:一、仲裁机制概述在CAN总线网络中,各个节点地位平等,没有固定的主节点或从节点之分。这种设计使得每个节点在需要时都可以试图......