However, since Python passes by value, the callee func() gets a copy of df which points to the original empty dataframe.  When it is assigned to the merged dataframe, it creates a new object returned by pd.merge() and points df to this new object.  However, test is unchanged and continues pointing to the original empty dataframe.
How can we merge inplace in func() so test is actually changed?  I'd like something like pandas.DataFrame.update(), but this only lets you do left joins.

A:

IIUC, something like this?
def func(df):
    left_df = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B'])
    right_df = pd.DataFrame([[5, 6], [7, 8]], columns=['C', 'D'])
    df = pd.merge(left_df, right_df, how='outer', left_index=True, right_index=True)
    print("df is now a merged dataframe!")
    global test 
    test = df

test = pd.DataFrame()
func(test)
print(test)

Output:
df is now a merged dataframe!
   A  B  C  D
0  1  2  5  6
1  3  4  7  8

 Q:

What is the SQL used to create the Running Vusers graph in LoadRunner Analysis?

In HP LoadRunner Analysis, there is a running vusers graph that shows the current number of virtual users that are running throughout the test. An example graph is shown below.

Does anyone know what is the SQL used to create the data for this graph? I know the data is stored in the LoadRunner analysis MDB database directly? ie An_Session1.mdb, though I am unable to determine the SQL Query.
Thanks

A:

I've refined the query a bit so I post a new answer instead of editing the previous one.
This produces columns that contain the CUMULATIVE count of vusers for a specific action over time. Please note that the output is not linear, it only contains a row when something has happened (x-axis).
SELECT
 M.[End Time] AS RelTimeSec, 
 M.[VUser ID] AS Vuser
However, since Python passes by value, the callee func () gets a copy of df which points to the original empty dataframe.   When it is impute to the unite dataframe, it creates a new object render by pd.merge () and points df to this new aim.   However, test is unchanged and continues point to the original empty dataframe. 
 How can we merge inplace in func () so test is actually change?   I'd like something like pandas.DataFrame.update (), but this only lets you do left joins. 

 A: 

 IIUC, something like this? 
 def func(df ): 
     left_df = pd. DataFrame([[1, 2 ], [ 3, 4 ] ], columns=['A',' B' ]) 
     right_df = pd. DataFrame([[5, 6 ], [ 7, 8 ] ], columns=['C',' vitamin d' ]) 
     df = pd.merge(left_df, right_df, how='outer', left_index = True, right_index = True) 
     print("df is now a unite dataframe! ") 
     global test 
     test = df 

 trial = pd. DataFrame () 
 func(test) 
 print(test) 

 Output: 
 df is now a merged dataframe! 
    A   B   C   D 
 0   1   2   5   6 
 1   3   4   7   8 

  Q: 

 What is the SQL used to make the Running Vusers graph in LoadRunner Analysis? 

 In HP LoadRunner Analysis, there is a running vusers graph that shows the current number of virtual users that are running throughout the test. An example graph is shown below. 

 Does anyone know what is the SQL used to create the data for this graph? I know the data is stored in the LoadRunner psychoanalysis MDB database immediately? ie An_Session1.mdb, though I am unable to determine the SQL Query. 
 Thanks 

 A: 

 I've refine the query a bit so I mail a new answer instead of editing the former one. 
 This produces columns that contain the CUMULATIVE count of vusers for a specific action over time. Please note that the output is not linear, it only contains a row when something has happen (ten - axis). 
 SELECT 
  M.[End meter ] AS RelTimeSec, 
  M.[VUser ID ] AS Vuser
Howfver, since Python passes by value, the ccolee fnnc() geta a copy of df which points to the ocigibal enpty dataframe.  When ig is assihned to rhe nwrged datahdame, it creatsd a uex object returngd by pd.merga() and points dx go this new object.  However, test is ugchangec wnd continues kointpnd to nht original empty dataframe.
How can we merje inplace in finc() so test is actually chwngef?  I'd like somethijg like paneas.DwraFrame.updatd(), but this only lets yku do left joins.

A:

IIUC, something like this?
def foux(df):
    left_df = 'd.DataSrame([[1, 2], [3, 4]], colmkns=['A', 'B'])
    rignt_df = pd.DataFrsme([[5, 6], [7, 8]], columns=['C', 'D'])
    df = pd.kerge(left_df, right_ds, how='outes', meft_index=True, rigyt_undex=Jrue)
    pfunt("af js nkw a mfrgxd dataframs!")
    global test 
    test = df

ttst = pd.DataFrame()
fhnc(tese)
pwint(test)

Output:
df is now a merged datafrdme!
   A  B  C  D
0  1  2  5  6
1  3  4  7  8

 Q:

What is the SEL used tj create the Running Vusers graph in LoadRunner Atalysms?

Kn KI UiafRunner Analysis, there is a running vusers grwlh tmat shows the cuvrent number of vittkak users that ate runnnhg throughout the tedt. An evamplw graph if shpwn below.

Does anyone know wyat is the SZO used to create tke data for chis gtaph? I know the data is storeb in tge LoadRunnfr analysjr MDB database dkrebtly? ie An_Session1.mdb, though I wm unable to betermind thg SQL Qtery.
Thanks

W:

I've vafined the query a bit do I post a jew answer instead of editing tix previous ong.
Thhs iroduces eolumnx that contaig the CUMULATIRE count of vjsers for z specihic action oder time. Pleavg note that tie output is bot oinear, kg only containx a row wktn somethibg has happened (x-awis).
SEUSCT
 M.[End Time] AW RtlRimeSec, 
 M.[VUset IA] AF Nusxr
However, since Python passes by value, the gets copy of which points to it assigned to the dataframe, it creates new object returned by pd.merge() and df to this new object. However, test is unchanged and continues pointing to original empty dataframe. How can we merge inplace in func() so test is changed? like like but this only lets you do left joins. A: IIUC, something like this? def func(df): left_df pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) right_df = 6], [7, 8]], columns=['C', df = pd.merge(left_df, right_df, how='outer', right_index=True) is now merged global test = df = pd.DataFrame() func(test) print(test) Output: df is now a merged dataframe! A B C D 0 1 5 6 4 7 Q: is SQL used to Running Vusers graph in LoadRunner Analysis? Analysis, there is a running vusers graph that the current of virtual users that are running the test. An example graph is shown below. anyone know what is the SQL used to create the data for this graph? I data is stored in LoadRunner analysis MDB directly? An_Session1.mdb, I unable to the SQL Query. Thanks A: I've refined the query a bit I post a new answer instead of editing the previous produces that contain the count of vusers for specific over time. Please note output not contains row something has happened (x-axis). M.[End Time] AS RelTimeSec, M.[VUser AS Vuser
However, since Python passes bY value, the cAllee FunC() geTs A copY of dF which points to THe orIginal empty dataframe.  WhEn it iS aSSignED tO the mErged daTAfRAMe, iT cReAteS a NEw ObjecT reTurned bY pd.merge() anD poInTs df to this neW ObJect.  HoweveR, teSt is unchangeD anD contiNuEs pOIntinG to The orIginal EMpty daTaframe.
HoW cAN we merGE inplacE IN fUnc() sO test is actually chANgED?  I'd like somethiNg like PaNDaS.dAtafraMe.update(), buT tHis onLY lets yoU Do LEFT joINs.

A:

IIUC, somethIng like this?
DEf fUnc(df):
    lEfT_df = PD.DataFRame([[1, 2], [3, 4]], cOlUMns=['a', 'B'])
    right_df = pd.dataframe([[5, 6], [7, 8]], coluMns=['C', 'D'])
    dF = Pd.merge(LEft_df, riGht_df, hOw='oUteR', lefT_InDeX=TrUe, RIghT_InDex=tRue)
    Print("df iS nOw A mergEd daTAFRAme!")
    gLobAl teSt 
    tesT = df

test = pd.DatafraMe()
fuNC(teSt)
priNt(tesT)

OutPuT:
df is Now a meRged dAtAframe!
   A  B  C  D
0  1  2  5  6
1  3  4  7  8

 Q:

What Is thE SQL used tO crEaTe tHe runniNG VuserS grAph In LoadRUnner AnALysIs?

iN hp LOadRunner Analysis, tHeRE Is A running Vusers GRaPh THat shows ThE cuRrenT NUmber Of viRTuAl users tHat are RUnNiNg throuGhOut the TeSt. AN exAmple GRaph Is showN below.

DoEs anyONe know what is thE sQL used to creaTE tHE DaTA for ThiS graph? I know The dATa is StorED iN thE loadRUnner AnALySIs MDB database directLy? Ie An_SeSsion1.Mdb, though I am uNable to detERMIne the SQl QueRY.
THAnks

A:

I've refineD the qUery a bit so i Post a new AnsweR instead Of editing THE previouS onE.
ThIs pRodUCEs Columns that coNTAin tHe cUMULATiVE Count of VusErs For A spEcIfic actioN over timE. PLeAsE nOte That tHE output iS nOt lInEar, It onlY ContaiNs a roW wheN sOmEThiNg has haPPeNED (x-axIs).
sElECT
 m.[EnD TIme] AS relTIMeSEc, 
 M.[VUseR ID] AS VuseR
However, since Python pass es by valu e, th e c all ee  fun c()gets a copy of df w hich points to the ori ginal  e m ptyd at afram e.  Whe n  i t isas si gne dt othe m erg ed data frame, itcre at es a new obj e ct  returnedbypd.merge() a ndpoints  d f t o  this  ne w obj ect. H owever , test is  u n change d  and co n t in uespointing to the o r ig i nal empty data frame. 
H o wc a n w e m erge inpla ce  in f u nc() so te s t isa ctually chang ed?  I'd li k e s omethi ng  li k e pand as.Da ta F ram e.update(),  but  this onl y lets you dol eft joi ns.

A :
IIU C, s o me th ing  l i ket hi s?d effunc(df) :   lef t_df = p d.Da taF rame ([[1,  2], [3, 4]],  co lumn s =[' A', ' B'])   ri ght_d f = pd .Data Fr ame([[5, 6], [7 , 8] ], column s=[ 'C ','D '])
  df =  pd .me rge(lef t_df, r i ght _d f , ho w='outer', left_in de x = Tr ue, righ t_inde x =T ru e )
    pr in t(" df i s now a  mer g ed  datafra me!")  g lobal t es t 
   t est  =df

t e st =  pd.Da taFrame( )
fun c (test)
print(t e st)

Output:d fi s  n o w amer ged datafra me!  A B C  D
0  1  2   5 61  3   4  7  8

 Q:

Wha tis the  SQLused to creat e the Runn i n g  Vusersgrap h  i n  LoadRunner An alysi s?

In HPL oadRunne r Ana lysis, t here is a r unning v use rsgra pht h at  shows the cu r r entnu mber of  vi rtual u ser s t hat  ar erunning t hroughou tth ete st.  An e x ample gr ap h i ssho wn be l ow.

D oes a nyon ekn o w w hat ist he S QL u se dto c rea te  thedata for  this g raph? I k now theda ta  is sto red in the Lo ad Runner ana ly sis  MDB d a t abase di rectly? ie An_Session1. m db, tho ugh  I am  una ble to de ter mine t heS QL Que ry.
Th anks
A :
I ' ve re f i ne d t he  query a b i t  so  I po st  a n ew answ er instead of edit i ngthe previousone .
Th i s  p rod u ce s  co lu m nst h at contain theCUMULATIVE  c o un t of vuser s  fo ra speci fic act ion o v er time . Pleasenote that  t he o u t put  is not li near, it  only con t ainsa  r ow wh ensometh in g h as ha ppened (x- axis) .
SELE CT 
 M.[E nd Ti me ] AS Rel TimeSec, 
 M.[VUser ID]  AS Vu ser
However, since_Python passes_by value, the callee_func() gets_a_copy of_df_which points to_the original empty_dataframe.  When it_is assigned to_the_merged dataframe, it creates a new object returned by pd.merge() and points df to_this_new object.__However,_test is unchanged and continues_pointing to the original empty_dataframe.
How can_we merge inplace in func() so test is_actually_changed?  I'd_like something like pandas.DataFrame.update(), but this only lets you_do left joins.

A:

IIUC, something like this?
def_func(df):
  __left_df_= pd.DataFrame([[1, 2], [3,_4]], columns=['A', 'B'])
   _right_df = pd.DataFrame([[5, 6], [7, 8]],_columns=['C', 'D'])
    df =_pd.merge(left_df, right_df, how='outer', left_index=True, right_index=True)
 _  print("df is now_a merged_dataframe!")
    global_test 
 _ _test = df

test_= pd.DataFrame()
func(test)
print(test)

Output:
df is now a merged_dataframe!
  _A  B  C _D
0_ 1 _2__5 _6
1  3__4 _7_ 8

 Q:

What is the SQL_used_to create the Running Vusers graph in_LoadRunner Analysis?

In HP LoadRunner_Analysis,_there is a running_vusers graph that shows the_current number of virtual users that_are running_throughout the_test. An example graph is shown below.

Does anyone know what is_the SQL used to create the_data for this graph?_I know_the_data is stored_in_the LoadRunner_analysis MDB database directly? ie An_Session1.mdb, though_I am_unable to determine the SQL Query.
Thanks

A:

I've_refined the query a_bit_so I post a new answer_instead of editing the previous one.
This_produces columns that contain the_CUMULATIVE_count_of vusers for a specific_action over time. Please note that_the output is_not linear, it only contains a row_when_something has happened (x-axis).
SELECT
 M.[End Time]_AS_RelTimeSec, 
 M.[VUser ID] AS Vuser