I want to get the row wise mean of two columns of data using byrow function. These two columns are T_start(s) and T_stop(s).
How should i change code given below ?
using HTTP,CSV,DataFrames,InMemoryDatasets
begin
for x in 33683
url="https://gcn.nasa.gov/circulars/$x"
txt=String((HTTP.get(url)))
if occursin("report on behalf of the Swift/UVOT team",txt)
hb,he=findfirst(r"^Filter"im,txt)
lr,_=findnext("\n\nThe",txt,he)
cltxt=replace(txt[hb:lr], " +/- "=>s"\t", r" +(\w)"=>s"\t\1" ,r" +(>)"=>s"\t",r"\+/?- ?"=>s"\t")
df=CSV.read(IOBuffer(cltxt), DataFrame, delim='\t')
if "Column6" in names(df); rename!(df, :Column6 => :Mag_err); end
byrow(df ,sum ,2:3)
@show df
end
end
end
It strikes me as exceedingly unlikely that an element wise addition of two vectors will be the bottleneck in your problem - have you benchmarked/profiled this?
Have not worked with InMemoryDatasets, but skimming the docs it seems to use its own data type Dataset instead of DataFrames.DataFrame. Thus, you will probably need to convert your data frame in order to use byrow, i.e., the error is that no method is defined for a DataFrame.