Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in hw1_solutions part 3:Analysis #8

Open
abhijeetchauhan opened this issue Mar 25, 2016 · 0 comments
Open

Error in hw1_solutions part 3:Analysis #8

abhijeetchauhan opened this issue Mar 25, 2016 · 0 comments

Comments

@abhijeetchauhan
Copy link

AttributeError                            Traceback (most recent call last)
<ipython-input-30-aea6d425eefd> in <module>()
----> 1 errors = all_error_data()

<ipython-input-29-2a9c686164e8> in all_error_data()
     17 #your code here
     18 def all_error_data():
---> 19     data = [error_data(race_page) for race_page in find_governor_races(page)]
     20     return pd.concat(data, ignore_index=True)

<ipython-input-28-5c576ec1e316> in error_data(url)
     48     #compute forecast length in days
     49     #(assuming that last forecast happens on the day of the election, for simplicity)
---> 50     forecast_length = (df.date.max() - df.date).values
     51     forecast_length = forecast_length / np.timedelta64(1, 'D')  # convert to number of days
     52 

/home/abhijeet/anaconda3/envs/py27/lib/python2.7/site-packages/pandas/core/generic.pyc in __getattr__(self, name)
   2667             if name in self._info_axis:
   2668                 return self[name]
-> 2669             return object.__getattribute__(self, name)
   2670 
   2671     def __setattr__(self, name, value):

AttributeError: 'DataFrame' object has no attribute 'date'
@abhijeetchauhan abhijeetchauhan changed the title Error in hw1_solutions part 3:Analysin Error in hw1_solutions part 3:Analysis Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant