<jupyter_start><jupyter_text>**NS Topic Extraction**<jupyter_code>import re
import pandas as pd

L={
    0: '0.103*"packet" + 0.099*"message" + 0.080*"send" + 0.052*"node" + 0.038*"receive" + 0.031*"application" + 0.027*"multiple" + 0.023*"datum" + 0.023*"specific" + 0.019*"server" + 0.018*"traffic" + 0.018*"layer" + 0.015*"communication" + 0.014*"data" + 0.013*"drop" + 0.013*"rate" + 0.012*"graph" + 0.011*"start" + 0.010*"range" + 0.010*"event"', 
1: '0.166*"file" + 0.047*"set" + 0.045*"parameter" + 0.039*"module" + 0.039*"number" + 0.034*"trace" + 0.022*"generate" + 0.021*"script" + 0.020*"random" + 0.017*"position" + 0.017*"access" + 0.017*"give" + 0.016*"connection" + 0.015*"show" + 0.013*"execute" + 0.013*"output" + 0.012*"write" + 0.011*"pass" + 0.010*"modify" + 0.010*"cc"', 
2: '0.109*"node" + 0.100*"network" + 0.059*"create" + 0.050*"wireless" + 0.043*"simulator" + 0.039*"simulate" + 0.033*"omnet" + 0.019*"model" + 0.018*"connect" + 0.018*"sensor" + 0.017*"simple" + 0.015*"issue" + 0.015*"address" + 0.014*"interface" + 0.013*"mobile" + 0.013*"host" + 0.011*"system" + 0.011*"resolve" + 0.011*"point" + 0.009*"location"', 
3: '0.283*"vein" + 0.070*"omnet" + 0.067*"vehicle" + 0.049*"sumo" + 0.039*"change" + 0.036*"rsu" + 0.025*"car" + 0.022*"scenario" + 0.018*"simulation" + 0.015*"speed" + 0.011*"map" + 0.010*"traci" + 0.009*"current" + 0.009*"model" + 0.009*"flow" + 0.008*"accident" + 0.008*"exist" + 0.007*"makefile" + 0.007*"edge" + 0.007*"tutorial"', 
4: '0.145*"simulation" + 0.098*"run" + 0.071*"time" + 0.038*"calculate" + 0.032*"work" + 0.022*"delay" + 0.020*"distance" + 0.020*"end" + 0.018*"throughput" + 0.018*"result" + 0.016*"energy" + 0.015*"base" + 0.014*"measure" + 0.014*"transmission" + 0.013*"power" + 0.013*"channel" + 0.013*"stop" + 0.011*"crash" + 0.010*"record" + 0.010*"ide"', 
5: '0.206*"omnet" + 0.125*"inet" + 0.041*"make" + 0.040*"project" + 0.038*"build" + 0.036*"link" + 0.030*"error" + 0.027*"library" + 0.024*"fail" + 0.020*"command" + 0.018*"framework" + 0.014*"import" + 0.014*"version" + 0.011*"define" + 0.011*"user" + 0.010*"store" + 0.009*"check" + 0.008*"input" + 0.008*"runtime" + 0.007*"graph"', 
6: '0.209*"error" + 0.054*"omnet" + 0.047*"omnetpp" + 0.039*"variable" + 0.031*"installation" + 0.025*"window" + 0.019*"unable" + 0.018*"read" + 0.018*"problem" + 0.017*"ubuntu" + 0.016*"fix" + 0.015*"compile" + 0.015*"install" + 0.015*"instal" + 0.015*"building" + 0.014*"vector" + 0.013*"package" + 0.011*"implementation" + 0.011*"list" + 0.011*"object"', 
7: '0.064*"implement" + 0.062*"find" + 0.059*"add" + 0.050*"function" + 0.048*"route" + 0.040*"code" + 0.039*"class" + 0.026*"type" + 0.025*"program" + 0.024*"call" + 0.022*"source" + 0.022*"protocol" + 0.019*"base" + 0.017*"size" + 0.016*"routing" + 0.016*"method" + 0.016*"path" + 0.014*"miss" + 0.013*"queue" + 0.011*"algorithm"'
 }

topic=[]
keyword_set=[]

for i in range(0, len(L)):
    topic.append(i)
    keyword_set.append(re.findall(r'"([^"]*)"', L[i]))


dict={'Topic_no':topic, 'Keywords':keyword_set}

df=pd.DataFrame(dict)
df<jupyter_output><empty_output><jupyter_text>**Getting kind of questions**<jupyter_code>import pandas as pd
topic=[]
how=[]
what=[]
why=[]
others=[]

df1=pd.read_csv("F:1_NAIST_Research_SE/SE_meeting/Network-simulators/Data/02_NS_posts_dataset.csv")

for i in range(0, 8):
    ho=0
    wha=0
    wh=0
    ot=0
    for j in range(0, len(df1)):
        if df1['Dominant_Topic'][j]==i:
            if "how" in df1['Title'][j] or "how" in df1['Body'][j] or "is there a way" in df1['Title'][j] or "is there a way" in df1['Body'][j] or "error" in df1['Title'][j] or "error" in df1['Body'][j] :
                ho=ho+1
            elif "what" in df1['Title'][j] or "what" in df1['Body'][j] or "should" in df1['Title'][j] or "should" in df1['Body'][j]:
                wha=wha+1
            elif "why" in df1['Title'][j] or "why" in df1['Body'][j]:
                wh=wh+1
            else:
                ot=ot+1
    topic.append(i)
    how.append(ho)
    what.append(wha)
    why.append(wh)
    others.append(ot)

dict={'Topic':topic, 'how':how, 'what':what, 'why':why, 'others':others}
df2=pd.DataFrame(dict)
        
df2<jupyter_output><empty_output><jupyter_text>**NS Post stat**<jupyter_code>import re
import pandas as pd
import numpy as np
from collections import Counter
import statistics


df1=pd.read_csv("F:1_NAIST_Research_SE/SE_meeting/Network-simulators/Data/02_NS_posts_dataset.csv",low_memory=False )

df2=pd.read_csv("F:1_NAIST_Research_SE/SE_meeting/Network-simulators/Data/02_NS_posts_dataset.csv",low_memory=False)

#"""
Topic=[]
number_per_topic=[]
score_=[]
view_=[]
FavCount_=[]
AnsCount_=[]
AccpAnsCount_=[]
CommentCount_=[]



for i in range(0, 8):
    Topic.append(i)
    score_0=[]
    view_0=[]
    FavCount_0=[]
    AnsCount_0=[]
    AccpAnsCount_0=[]
    CommentCount_0=[]
    number=0
    for index, j in enumerate(df1['Dominant_Topic']):
        if j==i:
            number=number+1
            if df2['AcceptedAnswerId'][index]>0:
                AccpAnsCount_0.append(1)
            score_0.append(df2['Score'][index])
            view_0.append(df2['ViewCount'][index])
            FavCount_0.append(df2['FavoriteCount'][index])
            AnsCount_0.append(df2['AnswerCount'][index])
            CommentCount_0.append(df2['CommentCount'][index])
    
    number_per_topic.append(number)
    score_.append(sum(score_0)/len(score_0))
    view_.append(sum(view_0)/len(view_0))
    FavCount_.append(sum(FavCount_0)/len(FavCount_0))
    AnsCount_.append(sum(AnsCount_0)/len(AnsCount_0))
    AccpAnsCount_.append(sum(AccpAnsCount_0)/len(score_0))
    CommentCount_.append(sum(CommentCount_0)/len(CommentCount_0))
    
dict = {'Topic': Topic, 'number_per_topic':number_per_topic, 'score_avg':score_, 'view_avg':view_, 'FavCount_avg':FavCount_, 'AnsCount_avg':AnsCount_, 'AccpAnsCount_avg':AccpAnsCount_, 'CommentCount_avg':CommentCount_}  
df3 = pd.DataFrame(dict) 
#df3.to_csv('F:/1_NAIST_Research_SE/SE_meeting/Network-simulators/LDA/01_NS_posts_statistics.csv', header=True, index=False)

df3<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2247503683090522, 'fraction_numerical': 0.11965951874283844, 'mean_word_length': 4.3690685413005275, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, '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}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '623735', 'license': 'MIT', 'n_tokens_mistral': 3017, 'n_tokens_neox': 2521, 'n_words': 369, 'path': 'Script/Result Processing script.ipynb', 'repo_name': 'syful-is/Network_simulator_updated', 'size': '6109'}