Posts

pandas - Array length does not match index length -

i'm looking combine few time series varying dates single dataframe. each time series' column names date , px i've created date index dates , tried combine time series doing: dates = pd.date_range('01/01/2017', periods=12, freq='m') df = pd.dataframe({ 'date': dates, 'a': df2['px'], 'b': df3['px'] . . etc }) expected output: date b c d e 2017-01-31 -0.4579 nan . . . 2017-02-28 0.5787 nan . . . 2017-03-31 -2.2319 -1.0244 etc etc etc 2017-04-30 -2.0713 -2.1069 2017-05-31 nan 2.0158 2017-06-30 nan 1.0541 2017-07-31 nan 1.8901 2017-08-31 nan nan 2017-09-30 nan nan . . etc iiuc: dfs = [df1,df2,df3] pd.concat([df.set_index('date') df ...

ionic2 - Accessing array in component from ionic view -

this.tribesprovider.getmytribedetailsbytriberid().subscribe(tribeids=>{ tribeids.foreach(tribeid=>{ this.tribesprovider.getmytribedetailsbytribeid(tribeid).subscribe(tribe=>{ this.mytribelist.push(tribe); console.log(this.mytribelist); }) }) }) i have access array mytribelist view this <ion-item *ngfor="let tribe of mytribelist"> <ion-list> <h2>{{tribe.tribedesc}}</h2> <h2>{{tribe.tribename}}</h2> <h2>{{tribe.created}}</h2> <h2>{{tribe.updated}}</h2> </ion-list> </ion-item> but above code not possible. suggestions? update issue occurs because doing this.angularfire.database.list for getmytribedetailsbytribeid(tribeid) method instead of this.angularfire.database.object which in turn generated additional array of objects -array -array -object -array -obj...

arrays - For loop only displays last data retrieved from firebase -

Image
i have loop retrieve user's progress typescript: his.userprogress = af.object('/userprogress/' + this.currentuser + '/', { preservesnapshot: true }); this.userprogress.subscribe(snapshots => { snapshots.foreach(snapshot => { this.userscores.push(snapshot.val()); }); console.log(this.userscores); //set 1 i<=8 because total no. of quizzes 9. means this.userscores.length -1 for(var i=0; <= 8; i++){ if (this.userscores.length == i) { this.scores = [{ none: "nothing recorded" }]; console.log("nothing"); } else if (this.userscores.length >= i) { this.scores = [{ chapter:this.userscores[i].chapter_quiz, quizno:this.userscores[i].quiz, score:this.userscores[i].score, }]; ...

dependency injection - How to prevent Controller Constructor argument from growing -

i have project in .net core , have dependency injection going on there. wrapper business layer classes 1 class inject 1 instance controller. need add other things project grows aws s3, ses , other things, started notice have more 4 parameters in controller constructor. is design flaw in part? there way clean up?

ios - How to vertically center the text in WKWebView? -

Image
i using wkwebview in ios (swift) app , using loadhtmlstring(string, baseurl: ). problem want html vertically centered in frame. text variable in length. how can that? this screenshot of html xcode: this image of output. top html on upper side, want centrally aligned in view (the view 300 points top): try using html inline css, can replace stuff in between divs want centered: <div style="display:flex;align-items:center;height:100%;justify-content:center;"> <p>you content here</p> </div> this code works me using swift 3.0 on iphone 6 simulator import uikit import webkit class viewcontroller: uiviewcontroller { var webview:wkwebview? override func viewdidload() { super.viewdidload() } override func viewdidappear(_ animated: bool) { webview = wkwebview(frame: self.view.frame) self.view.addsubview(webview!); addhtml() } func addhtml() { let html = "...

Why does zoom level affect/hinder procedures in Excel VBA? -

so while working on data collection macro noticed gave run-time error when zoomed far out (cells had # symbol), when zoomed in enough see numbers involved in code works fine. reasoning behind this? have thought numbers displayed in excel window printed other source, rather being source of data themselves. for each cell in .range("b2:gl2") if cell.text = trussarray(0) col1 = cell.column goto nextloop end if next nextloop: each cell in .range(.cells(3, col1), .cells(3, col1 + 7)) if cell.text = trussarray(1) col2 = cell.column goto done end if next

python - Trac packages not properly installed -

i checking in redhat server see if there trac installation, trac-admin not in /usr/bin(is found). in /usr/lib/python2.7/site-packages/ there no trac packages @ all, found following paths trac directory in them: /root/.cpan/build/alien-svn-v1.8.11.0-1/src/subversion/subversion/bindings/swig/python/tests/trac /root/.cpan/build/alien-svn-v1.8.11.0-0/src/subversion/subversion/bindings/swig/python/tests/trac /opt2/trac these directories show following: __init__.py test.py versioncontrol and /opt/trac environment of trac: conf db files htdocs log plugins readme templates trac_banner.png version does mean trac installed? can delete directories , try new installation? the directories found under /root/.cpan not indicate trac installed. presence of trac environment @ /opt/trac important find. please make backup of directory @ least, , preferably backup of entire server, before proceeding. to check if trac installed, start python 2.x interpreter session , ...