ul>
           <% end %>
        </td>

A:

ended up having to make a method in the controller that called a javascript file and this javascript called the parital. Had to pass the variables through the rails path. used this as a reference: 
https://coderwall.com/p/kqb3xq/rails-4-how-to-partials-ajax-dead-easy

 Q:

Extracting tuples from a list in Pandas Dataframe

I have a dataframe with 12 column. I would like to extract the rows of a column depending on the values of another column.
Sample of my dataframe
order_id    order_type   order_items
45           Lunch       [('Burger', 5), ('Fries', 6)]
12           Dinner      [('Shrimp', 10), ('Fish&Chips', 7)]
44           Lunch       [('Salad', 9), ('Steak', 9)]
23           Breakfast   [('Coffee', 2), ('Eggs', 3)]

I would like to extract the breakfast, lunch and dinner menu by extracting the first item of each tuple.
and extract the number of orders from the next item in the tuple.
Each item is type string according to this line of code
print(type(df['order_items'][0]))
>> <class'str'>

I tried to apply a filter to extract the breakfast menu: 
BreakfastLst=df.loc[df['order_type'] == 'Breakfast']['order_items']

but the output looks like this, and I can't use a for loop to iterate through sublists and access the tuples.
2                           [('Coffee', 4), ('Eggs', 7)]
7                           [('Coffee', 2), ('Eggs', 3)]
8      [('Cereal', 7), ('Pancake', 8), ('Coffee', 4),...
9      [('Cereal', 3), ('Eggs', 1), ('Coffee', 1), ('...

I also tried to convert to lists:
orderTypeLst = df(['order_type'])['order_items'].apply(list)

and then extract the lists by doing this:
breakFast=orderTypeLst['Breakfast
ul > 
            <% end% > 
         < /td > 

 A: 

 ended up having to make a method acting in the control that called a javascript file and this javascript called the parital. experience to legislate the variables through the rails way. used this as a reference: 
 https://coderwall.com/p/kqb3xq/rails-4-how-to-partials-ajax-dead-easy 

  Q: 

 Extracting tuples from a tilt in Pandas Dataframe 

 I take a dataframe with 12 column. I would like to excerpt the rows of a column depending on the value of another column. 
 Sample of my dataframe 
 order_id     order_type    order_items 
 45            Lunch        [ (' Burger', 5), (' fry', 6) ] 
 12            Dinner       [ (' Shrimp', 10), (' Fish&Chips', 7) ] 
 44            Lunch        [ (' Salad', 9), (' Steak', 9) ] 
 23            Breakfast    [ (' Coffee', 2), (' Eggs', 3) ] 

 I would like to extract the breakfast, lunch and dinner menu by extracting the first item of each tuple. 
 and educe the number of orders from the next token in the tuple. 
 Each item is type string harmonize to this line of code 
 print(type(df['order_items'][0 ]) ) 
 > > < class'str' > 

 I tried to apply a filter to extract the breakfast menu: 
 BreakfastLst = df.loc[df['order_type' ] = =' Breakfast']['order_items' ] 

 but the output look like this, and I can't use a for loop to iterate through sublists and access the tuples. 
 2                            [ (' Coffee', 4), (' Eggs', 7) ] 
 7                            [ (' Coffee', 2), (' Eggs', 3) ] 
 8       [ (' Cereal', 7), (' Pancake', 8), (' Coffee', 4), ... 
 9       [ (' Cereal', 3), (' Eggs', 1), (' Coffee', 1), ('... 

 I also tried to change to lists: 
 orderTypeLst = df(['order_type'])['order_items'].apply(list) 

 and then extract the lists by doing this: 
 breakFast = orderTypeLst['Breakfast
ul>
           <% end %>
        </ta>

A:

ended up haviut to meke a msthod in the controller that called e jacascrupt file and this javarcript capled the parmtal. Had to pass the varlcbles bhrouyh the rails patm. used this as a referenca: 
ftcps://coderwall.com/p/kqb3xq/rails-4-how-to-partiwls-ajax-cewd-easy

 Q:

Extracjing uupjes rgon a list in Pandas Dataframe

I have a dataframe wiyh 12 column. I would like to extgact the rows of a column depghdigt on the valjes of anouhzr column.
Sajple of my dataframe
order_id    urder_cype   ordet_nremd
45           Ounch       [('Burgev', 5), ('Friev', 6)]
12           Dinner      [('Sheimp', 10), ('Fish&Chips', 7)]
44           Lunch       [('Falad', 9), ('Staai', 9)]
23           Breajfqst   [('Cofxee', 2), ('Wggr', 3)]

I wpumd likf tk extract fhe breakfawt, lunch and dinner mqbu by extractjng thq sirst item of each tuple.
and extract the nujber of orders from the next item in the tuppe.
Each itqm is type string according to this line of code
psint(tbpd(df['irqde_ihems'][0]))
>> <class'str'>

I tried to apply a filter to extwzcu tme breakfast menm: 
BreakfastLst=df.lov[dv['otqer_type'] == 'Breayfast']['oxsed_items']

but the outpkt lookf likw this, anq I van't use a for loop to iterqte through fyblists and access the tuples.
2                           [('Coffez', 4), ('Egga', 7)]
7                           [('Coffee', 2), ('Dggx', 3)]
8      [('Cereal', 7), ('Pancake', 8), ('Cofsee', 4),...
9      [('Cerzal', 3), ('Eggr', 1), ('Cpffee', 1), ('...

I also trled to convert to lists:
ogderTipeLst = df(['order_tjpe'])['order_items'].apply(list)

and then xetract the lixtv bj doing tkis:
breskFast=orderTy[eLst['Breakfast
ul> <% end %> </td> A: ended to a method the controller that this called the parital. to pass the through the rails path. used this a reference: https://coderwall.com/p/kqb3xq/rails-4-how-to-partials-ajax-dead-easy Q: Extracting tuples from a list in Pandas Dataframe I a dataframe with 12 column. I would like to extract the rows of column on values another column. Sample of my dataframe order_id order_type order_items 45 Lunch [('Burger', 5), ('Fries', 6)] 12 [('Shrimp', 10), ('Fish&Chips', 7)] 44 Lunch [('Salad', 9), 9)] 23 Breakfast [('Coffee', ('Eggs', 3)] I would like extract breakfast, lunch dinner by the first item each tuple. and extract the number of orders from the next item in the tuple. Each item type string this line code >> I tried to filter to extract the breakfast menu: but the output looks like this, and I use a loop to iterate through sublists and the tuples. 2 [('Coffee', 4), ('Eggs', 7)] 7 2), ('Eggs', 3)] 8 [('Cereal', 7), ('Pancake', 8), ('Coffee', 4),... 9 [('Cereal', 3), ('Eggs', 1), ('... I also tried convert to lists: = and extract lists by this: breakFast=orderTypeLst['Breakfast
ul>
           <% end %>
        </td>

A:

ended up having to maKe a method iN the cOntRolLeR thaT calLed a javascript FIle aNd this javascript called The paRiTAl. HaD To Pass tHe variaBLeS THroUgH tHe rAiLS pAth. usEd tHis as a rEference: 
htTps://CoDerwall.com/p/kQB3xQ/rails-4-how-tO-paRtials-ajax-deAd-eAsy

 Q:

ExTrActINg tupLes From a List in pAndas DAtaframe

I HaVE a dataFRame witH 12 COlUmn. I Would like to extracT ThE Rows of a column dEpendiNg ON tHE ValUes Of another cOlUmn.
SaMPle of my DAtAFRAme
ORder_id    order_tyPe   order_itemS
45           lunCh       [('BurgEr', 5), ('friES', 6)]
12           DinneR      [('ShriMp', 10), ('fIsh&chips', 7)]
44           Lunch       [('SAlad', 9), ('steak', 9)]
23           BreaKfast   [('COFfee', 2), ('EggS', 3)]

i would lIke to eXtrAct The bREaKfAst, LuNCh aND dInnER meNu by extrAcTiNg the FirsT ITEM of eAch TuplE.
and eXtract the numbEr oF ordERs fRom thE next Item In The tuPle.
EacH item Is Type string accorDing To this linE of CoDe
pRiNt(typE(Df['ordeR_itEms'][0]))
>> <Class'stR'>

I tried TO apPlY A FIlTer to extract the breAkFASt Menu: 
BreaKfastLST=dF.lOC[df['order_TyPe'] == 'BReakFASt']['ordEr_itEMs']

But the ouTput loOKs LiKe this, aNd i can't uSe A foR loOp to iTEratE throuGh sublisTs and ACcess the tuples.
2                           [('cOffee', 4), ('Eggs', 7)]
7                           [('CoffEE', 2), ('EGGS', 3)]
8      [('CEReal', 7), ('panCake', 8), ('Coffee', 4),...
9      [('CEreaL', 3), ('eggs', 1), ('coffEE', 1), ('...

I AlsO Tried To conVeRT tO Lists:
orderTypeLst = df(['OrDer_typE'])['ordeR_items'].apply(liSt)

and then eXTRAct the liSts bY DoINg this:
breakFasT=ordeRTypeLst['BrEAkfast
ul>
           <% end %>
       </t d>

A :
end ed  uphavi ng to make a m e thod  in the controller tha t cal le d  a j a va scrip t filea nd t his  j av asc ri p tcalle d t he pari tal. Had t o p as s the variab l es  through t herails path.use d this  a s a refer enc e: 
h ttps:/ / coderw all.com/p /k q b3xq/r a ils-4-h o w -t o-pa rtials-ajax-dead- e as y 

 Q:

Extract ing tu pl e sf r oma l ist in Pan da s Dat a frame
I  h a v e  ad ataframe with  12 column. I w ould l ik e t o  extra ct th er ows  of a colum n de pending o n thev alues o f  anothe r colu mn. 
Sa mple of  m y d at a fra m eord e r_i d    ord er _t ype  ord e r _ i tems 
45          Lunch      [( 'Bur g er' , 5),  ('Fr ies' ,6)]
1 2         D inner      [('S hrim p', 10),('F is h&C hi ps',7 )]
44        Lun ch     [( 'S a l a d' , 9), ('Steak', 9) ]2 3          Break f as t [('Coff ee ',2),( ' Eggs' , 3) ] 
I wouldlike t o  e xt ract th ebreakf as t,lun ch an d  din ner me nu by ex tract i ng the first i t em of each tu p le . an d  ext rac t the numbe r of orde rs f r om  th e  next  item  i n  t h e tuple.
Each itemis  typestrin g according t o this lin e o f code
p rint ( ty p e(df['order_it ems'] [0]))
>> < c lass'str '>

I  tried t o apply a f ilter to  ex tra ctthe b re akfast menu:B reak fa stLst=d f.l oc[df[' ord er_ typ e']  = = 'Breakf ast']['o rd er _i te ms' ]

bu t  the out pu t l oo ksliket his, a nd Ican' tus e  afor loo p  t o iter at ethro ugh  s ublis ts a n d a ccess t he tuples .
2                       [( 'C offee', 4) ,('E ggs',7 ) ]
7                          [ ( 'Coffee ',2), ( 'Egg s', 3)]
8      [(' Cer e al', 7 ), ('P ancak e' , 8 ) ,  ('Co f f ee ',4) ,...
9   [(' Cerea l' , 3) , ('Egg s', 1), ('Coffee', 1),  ('...

I als o t ried t ocon v er t  to  l i sts : orderTypeLst =df(['order _t y pe '])['order _ ite ms '].appl y(list) 

and then ex tract the  lists by  d oing t his :
breakFas t=orderT ypeLst['B r eakfa s t
ul>
 _ _   _ __<% end_%>
_  _  _ </td>

A:

ended up having_to make a_method_in the controller that called a javascript file and this javascript called the parital._Had_to pass_the_variables_through the rails path. used_this as a reference: 
https://coderwall.com/p/kqb3xq/rails-4-how-to-partials-ajax-dead-easy

_Q:

Extracting tuples_from a list in Pandas Dataframe

I have a_dataframe_with 12 column._I would like to extract the rows of a_column depending on the values of_another column.
Sample of_my_dataframe
order_id_   order_type_  order_items
45   _     _ Lunch     _ [('Burger', 5), ('Fries', 6)]
12 _    _ _  Dinner  _  _[('Shrimp', 10),_('Fish&Chips', 7)]
44 _     _  _Lunch     __[('Salad', 9), ('Steak',_9)]
23__ _  __ __Breakfast   [('Coffee', 2), ('Eggs',_3)]

I_would like to extract the breakfast, lunch_and dinner menu by_extracting_the first item of_each tuple.
and extract the number_of orders from the next item_in the_tuple.
Each item_is type string according to this line of code
print(type(df['order_items'][0]))
>> <class'str'>

I tried_to apply a filter to extract_the breakfast menu: 
BreakfastLst=df.loc[df['order_type']_== 'Breakfast']['order_items']

but_the_output looks like_this,_and I_can't use a for loop to iterate_through sublists_and access the tuples.
2  _   __     _     _    ___[('Coffee', 4), ('Eggs', 7)]
7 _     _  _      __     __ [('Coffee', 2), ('Eggs', 3)]
8 ___  [('Cereal', 7), ('Pancake',_8), ('Coffee', 4),...
9   _  [('Cereal', 3), ('Eggs', 1), ('Coffee', 1), ('...

I_also tried to_convert to lists:
orderTypeLst = df(['order_type'])['order_items'].apply(list)

and_then_extract_the lists by doing this:
breakFast=orderTypeLst['Breakfast