Posts

python - Pandas: Trouble Updating Rows Conditionally -

i have following dataframe: >>>df rtt requests asn 1000 4000 100 2000 50 nan 3000 18000 300 my goal divide rtt requests in place if requests not nan , otherwise leave rtt untouched. i've tried various things , either second row gets set nan so: >>>df rtt requests asn 1000 40 100 2000 nan nan 3000 60 300 or dataframe isn't updated @ all desired final output >>>df rtt requests asn 1000 40 100 2000 50 nan 3000 60 300 use fillna in [1889]: df['rtt'] = df['rtt'].div(df['requests']).fillna(df['rtt']) in [1890]: df out[1890]: rtt requests asn 1000 40.0 100.0 2000 50.0 nan 3000 60.0 300.0 or, / instead of div in [1895]: (df['rtt'] / df['requests']).fillna(df['rtt']) out[1895]: asn 1000 40.0 2000 50.0 3000 60.0 dtype: float64 or, combine_first in [1897]: df['rtt'].div(df[...

php - responsive image to my project not fit the div -

have problem in project wich item image not fit thumbnail "; "; ``"; echo "$ " . $item['itemprice'] . ""; echo ""; echo ""; echo "" . $item['itemname'] . ""; echo "" . $item['itemdescription'] . " "; echo "" . $item['itemdate'] . ""; echo "" . $item['username'] . ""; echo '' . $item["catname"] . ''; echo ""; echo ""; echo ""; echo ""; } ?> > css /* start time last */ .item-box:hover { background-color: lightgray; } .item-box img { display: block; min-width: 225px; min-height: 225px; max-width: 225px; max-height: 225px; } .img-item img { min-width: 180px; min-height: 180px; max-width: 180px; ...

excel - Using a file location in a VLOOKUP issue -

i got code answer on here , better way doing because can select pulling file from. seems can't file name correct in vlookup? error 1004 right after vlookup. maybe there else wrong. copied code replaced needed need pair of eyes. in advance. dim x string dim lnewbracketlocation long x = application.getopenfilename( _ filefilter:="excel files (*.xls*),*.xls*", _ title:="choose previous quarter's file", multiselect:=false) msgbox "you selected " & x 'find last instance in string of path separator "\" lnewbracketlocation = instrrev(x, application.pathseparator) 'edit string suit vlookup formula - insert "[" x = left$(x, lnewbracketlocation) & "[" & right$(x, len(x) - lnewbracketlocation) range("v2").select activecell.formular1c1 = "=vlookup($e2,'" & x & "]file_2017072732'!$b$5:$ap$9486,18,false)" ' error 1004 selection.autofill destinatio...

python 2.7 - Flatten 3 level MultiIndex Pandas dataframe -

i have following pandas df: window 5 15 30 45 feature col0 col1 col2 col0 col1 col2 col0 col1 col2 col0 col1 col2 metric mean std mean std mean std mean std mean std mean std mean std mean std mean std mean std mean std mean std 0 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan ...

wordpress - Gravity Forms - Conditional Result -

i have gf 3 products @ set price. however, if user purchases more one, there's $50 discount on each additional item. ex: product 1 = $500 user buys 2 items, $500 + $450 (total = $950). there way native (or plugin) conditional logic? the way know how natively create product field adds "base" fee. in case, fee $50. product price $450 time. use conditional logic "show" base fee when 1 item ordered , "hide" base fee when more 1 item ordered.

javascript - How to force my Chrome browser to accept .requestFullscreen()? -

i writing application myself in need go fullscreen automatically via javascript (today simulate press of f11, works, not always). i use .requestfullscreen() (via screenfull.js ) failed execute 'requestfullscreen' on 'element': api can initiated user gesture. this understandable (for security / spam / usability reasons) , mentioned on numerous pages. now, since application running on chrome browser, have ability allow request in browser. is possible setting chrome? you can use kiosk mode: on windows: "c:\program files (x86)\google\chrome\application\chrome.exe" --chrome --fullscreen --kiosk http://10.20.30.40/page/ on linux chrome --chrome --fullscreen --kiosk http://10.20.30.40/page/

.net - Autocad C# delete layout viewports -

can me create c# code delete viewport in layouts. i've tried code delete viewport, compiles no problem, doesn't delete viewport, not sure doing wrong here. thanks public class class1 { [commandmethod("haha")] public static void createmodelviewports() { document doc = application.documentmanager.mdiactivedocument; database db = doc.database; using (transaction trans = db.transactionmanager.starttransaction()) { var viewporttable = (viewporttable)trans.getobject(db.viewporttableid, openmode.forwrite); foreach (objectid id in viewporttable) { var viewport = (viewporttablerecord)trans.getobject(id, openmode.forread); // delete active viewport viewport.upgradeopen(); viewport.erase(); } trans.commit(); } } } you erasing viewporttablerecord not viewport. ...