cs109 / content Goto Github PK
View Code? Open in Web Editor NEWOfficial content for Harvard CS109
Home Page: http://cs109.org
License: MIT License
Official content for Harvard CS109
Home Page: http://cs109.org
License: MIT License
Hello,
when i try to download the pre requisite data sets for HW 2 from the mentioned folders , it says This site can’t be reached. PLease look into the link provided : https://www.dropbox.com/s/vng5x10b837ahnc/hw2_data.zip
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'
This is the error when I run the codes.
ValueError: invalid literal for int() with base 10: '2557629'
switch = {(0, 1): 2, (0, 2): 1, (1, 0): 2, (1, 2): 1, (2, 0): 1, (2, 1): 0}
if i'm not mistaken value should be 0 not 1
(1, 2): 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.