Posts

Showing posts with the label error-handling

Pandas Datareader with Morningstar

Pandas Datareader with Morningstar I'm web scraping with pandas and using morningstar's API. Every now and then I scrape a website with a ticker that morningstar struggles with and crashes python. I've included relevant lines below and it almost always work and I don't think my code is causing the errors but I can't get around pandas freezing up on me. Date is a variable here that is in the correct format for DataReader, it doesn't raise problems. import pandas as pd import pandas_datareader.data as web df = web.DataReader(ticker, "morningstar", date) If a ticker is getting stuck, after a couple minutes pandas will print (on it's own, not my print statement) the phrase "adding (insert ticker here) to retry list". Shortly after the message pops up I get a pop up window saying "Python quit unexpectedly". I've tried to wrap the datareader in a while loop with a timer to stop it and move on to the next ticker but it didn't w...

Undefined variable: statuses (View: /Users/domlanza/code/kermode/resources/views/timeline/index.blade.php)

Undefined variable: statuses (View: /Users/domlanza/code/kermode/resources/views/timeline/index.blade.php) I am getting this message and going a little crazy. Here is my code please just try to point me in the right direction it would be greatly appreciated. timeline.index.blade.php @extends('layouts.app') @section('content') <div class="row"> <div class="col-lg-6"> <form role="form" action="{{ route('status.post') }}" method="post"> <div class="form-group {{ $errors->has('status') ? ' has-error' : ''}}"> <textarea placeholder="What's up {{Auth::user()->getFirstNameOrUsername() }} ?" name="status" class="form-control" rows="2"></textarea> @if ($errors->has('status')) <span class="help-b...

node.js mkdir enonent when passed a string

node.js mkdir enonent when passed a string I'm trying to build folders with a string, but I keep erroring out, everything looks good, but I'm obviously missing something, any help would be great. var setFile = 'dijit/analysis/images/' folders = setFile.substr(0,setFile.lastIndexOf('/')); fs.mkdir(folders, function(err){ console.log('problem: ' + err); }); Error: Error: ENOENT, mkdir 'dijit/analysis/images' Error: ENOENT, mkdir 'dijit/analysis/images' Thanks, Do the dijit and dijit/analysis directories already exist? Are you perhaps looking for npmjs.org/package/mkdirp? – loganfsmyth Mar 28 '14 at 6:16 dijit dijit/analysis 2 Answers 2 fs.mkdir can able to built only a single folder. You are trying t...