Lung cancer incidence decreases with elevation: evidence for oxygen as a carcinogen (R)
http://nbviewer.jupyter.org/github/dhimmel/elevcan/blob/master/manual/tutorial/tutorial.ipynb
/r/JupyterNotebooks
https://redd.it/47w62p
http://nbviewer.jupyter.org/github/dhimmel/elevcan/blob/master/manual/tutorial/tutorial.ipynb
/r/JupyterNotebooks
https://redd.it/47w62p
nbviewer.jupyter.org
Notebook on nbviewer
Check out this Jupyter notebook!
AJAX & Django
Hi, I'm creating a Django app (I'm really new still) as a player control panel for a game. When another player creates a character, I'd like it to update live from MySQL and the character name appear in a list.
Here's a demonstration made with JavaScript:
https://gyazo.com/332cdcbc19c498d599c9f65071d88fcf
Apart from the amount of characters are limited to 5 (already have that covered), it is ordered from creation date (have that covered). I just need it to live update.
Thanks!
/r/django
https://redd.it/5k9cp7
Hi, I'm creating a Django app (I'm really new still) as a player control panel for a game. When another player creates a character, I'd like it to update live from MySQL and the character name appear in a list.
Here's a demonstration made with JavaScript:
https://gyazo.com/332cdcbc19c498d599c9f65071d88fcf
Apart from the amount of characters are limited to 5 (already have that covered), it is ordered from creation date (have that covered). I just need it to live update.
Thanks!
/r/django
https://redd.it/5k9cp7
Gyazo
GIF
Evaluating the Gaza-Israel crisis of 2013: spatio-temporal analysis of data by The Guardian
http://nbviewer.jupyter.org/gist/darribas/4121857
/r/JupyterNotebooks
https://redd.it/47w8gm
http://nbviewer.jupyter.org/gist/darribas/4121857
/r/JupyterNotebooks
https://redd.it/47w8gm
nbviewer.jupyter.org
Notebook on nbviewer
Check out this Jupyter notebook!
Json serialize error
I am trying to return data from database to jquery to get the data dynamically(you know without refreshing), as you can see im returning a sqlalchemy object with jsonify but i get a serialize error i have searched around but i dont quite understand what that really is or how it works
@home_blueprint.route('/_posting_process/', methods=['POST'])
@login_required
def _posting_process():
post = PostForm()
user = Users.query.filter_by(id=current_user.id).first()
if post.validate_on_submit():
posted = Comments(comment=post.onmind.data,
user_id=user.id)
db.session.add(posted)
db.session.commit()
return jsonify({'posts': post.comments})
return 'not posted'
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/flask/app.py", line 2000, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1991, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib/python3.5/site-packages/flask_login.py", line 792, in decorated_view
return func(*args, **kwargs)
File "/home/quechon/PycharmProjects/untitled3/myapp/home/routes.py", line 48, in _posting_process
return jsonify({'posts': user.comments})
File "/usr/lib/python3.5/site-packages/flask/json.py", line 266, in jsonify
(dumps(data, indent=indent, separators=separators), '\n'),
File "/usr/lib/python3.5/site-packages/flask/json.py", line 126, in dumps
rv = _json.dumps(obj, **kwargs)
File "/usr/lib/python3.5/site-packages/simplejson/__init__.py", line 397, in dumps
**kw).encode(obj)
File "/usr/lib/python3.5/site-packages/simplejson/encoder.py", line 291, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.5/site-packages/simplejson/encoder.py", line 373, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.5/site-packages/flask/json.py", line 83, in default
return _json.JSONEncoder.default(self, o)
File "/usr/lib/python3.5/site-packages/simplejson/encoder.py", line 268, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <sqlalchemy.orm.dynamic.AppenderBaseQuery object at 0x7f3ff14f5748> is not JSON serializable
if you guys please can explain to me what serialize mean and do thanks
/r/flask
https://redd.it/5kbmg9
I am trying to return data from database to jquery to get the data dynamically(you know without refreshing), as you can see im returning a sqlalchemy object with jsonify but i get a serialize error i have searched around but i dont quite understand what that really is or how it works
@home_blueprint.route('/_posting_process/', methods=['POST'])
@login_required
def _posting_process():
post = PostForm()
user = Users.query.filter_by(id=current_user.id).first()
if post.validate_on_submit():
posted = Comments(comment=post.onmind.data,
user_id=user.id)
db.session.add(posted)
db.session.commit()
return jsonify({'posts': post.comments})
return 'not posted'
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/flask/app.py", line 2000, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1991, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3.5/site-packages/flask/app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib/python3.5/site-packages/flask_login.py", line 792, in decorated_view
return func(*args, **kwargs)
File "/home/quechon/PycharmProjects/untitled3/myapp/home/routes.py", line 48, in _posting_process
return jsonify({'posts': user.comments})
File "/usr/lib/python3.5/site-packages/flask/json.py", line 266, in jsonify
(dumps(data, indent=indent, separators=separators), '\n'),
File "/usr/lib/python3.5/site-packages/flask/json.py", line 126, in dumps
rv = _json.dumps(obj, **kwargs)
File "/usr/lib/python3.5/site-packages/simplejson/__init__.py", line 397, in dumps
**kw).encode(obj)
File "/usr/lib/python3.5/site-packages/simplejson/encoder.py", line 291, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.5/site-packages/simplejson/encoder.py", line 373, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.5/site-packages/flask/json.py", line 83, in default
return _json.JSONEncoder.default(self, o)
File "/usr/lib/python3.5/site-packages/simplejson/encoder.py", line 268, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <sqlalchemy.orm.dynamic.AppenderBaseQuery object at 0x7f3ff14f5748> is not JSON serializable
if you guys please can explain to me what serialize mean and do thanks
/r/flask
https://redd.it/5kbmg9
reddit
Json serialize error • /r/flask
I am trying to return data from database to jquery to get the data dynamically(you know without refreshing), as you can see im returning a...
Model that contains an ordered list of items
Disclaimer: First database I'm ever designing
Let's say that Model A contains a bunch of Model B's, and B's must be in a certain order (in my case, the order that they were created). B will have some kind of position field that notes its index position in the list, and of course a ForeignKey field for A.
To accomplish this, my plan was to have A keep track of how many B's belong to A through an IntegerField. That way, whenever I create a new B, I can use A's count field to determine its index position.
Is this a decent solution or is there a simpler/smarter/more conventional way of accomplishing this?
As far as I can tell this is a straightforward, O(1) solution.
/r/djangolearning
https://redd.it/5ie4o0
Disclaimer: First database I'm ever designing
Let's say that Model A contains a bunch of Model B's, and B's must be in a certain order (in my case, the order that they were created). B will have some kind of position field that notes its index position in the list, and of course a ForeignKey field for A.
To accomplish this, my plan was to have A keep track of how many B's belong to A through an IntegerField. That way, whenever I create a new B, I can use A's count field to determine its index position.
Is this a decent solution or is there a simpler/smarter/more conventional way of accomplishing this?
As far as I can tell this is a straightforward, O(1) solution.
/r/djangolearning
https://redd.it/5ie4o0
reddit
Model that contains an ordered list of items • /r/djangolearning
Disclaimer: First database I'm ever designing Let's say that Model A contains a bunch of Model B's, and B's must be in a certain order (in my...
Understanding 2d arrays
Hey all,
I hope you can help. I'm trying to learn NumPy through Udacity and this is throwing me for a bit of a loop.
If I have the 2d array ridership, when `print ridership[1, 3]` preforms like I expect, first row, third item on a zero based system and return `2328`.
However with this array below, when I `print ridership[1:3, 3:5]` I get a result of `[[2328 2539] [6461 2691]]`.
I expect that I'd see `[[2328 2539] []]`
What is going on here?
ridership = np.array([
[ 0, 0, 2, 5, 0],
[1478, 3877, 3674, 2328, 2539],
[1613, 4088, 3991, 6461, 2691],
[1560, 3392, 3826, 4787, 2613],
[1608, 4802, 3932, 4477, 2705],
[1576, 3933, 3909, 4979, 2685],
[ 95, 229, 255, 496, 201],
[ 2, 0, 1, 27, 0],
[1438, 3785, 3589, 4174, 2215],
[1342, 4043, 4009, 4665, 3033]
])
/r/IPython
https://redd.it/4o6i93
Hey all,
I hope you can help. I'm trying to learn NumPy through Udacity and this is throwing me for a bit of a loop.
If I have the 2d array ridership, when `print ridership[1, 3]` preforms like I expect, first row, third item on a zero based system and return `2328`.
However with this array below, when I `print ridership[1:3, 3:5]` I get a result of `[[2328 2539] [6461 2691]]`.
I expect that I'd see `[[2328 2539] []]`
What is going on here?
ridership = np.array([
[ 0, 0, 2, 5, 0],
[1478, 3877, 3674, 2328, 2539],
[1613, 4088, 3991, 6461, 2691],
[1560, 3392, 3826, 4787, 2613],
[1608, 4802, 3932, 4477, 2705],
[1576, 3933, 3909, 4979, 2685],
[ 95, 229, 255, 496, 201],
[ 2, 0, 1, 27, 0],
[1438, 3785, 3589, 4174, 2215],
[1342, 4043, 4009, 4665, 3033]
])
/r/IPython
https://redd.it/4o6i93
reddit
Understanding 2d arrays • /r/IPython
Hey all, I hope you can help. I'm trying to learn NumPy through Udacity and this is throwing me for a bit of a loop. If I have the 2d array...
Feedback/improvements on this Nyquist/Bode plots interactive panel made with Bokeh
Some time ago I've posted another thread about a Python3 package for control systems toolbox that I'm developing. It's called `harold` ([Github link](https://github.com/ilayn/harold) )
Now, things are getting a bit more concrete behind the scenes, though on the documentation and tutorial side I'm really falling short to keep up.
Anyways, since long time, I always wanted to see/show/explain things with Nyquist and Bode plots together as they are basically the same data in different coordinates. I wasted literally weeks to do this in matlab with countless nonsensical .m files scattered to tens of pieces. Hence I've fiddled with the amazing Bokeh library.
It's still of course wonky and I've faked the frequency response to be a simple spiral to skip the package loading. I would really appreciate if you can tell me whether it strikes you as an improvement or just another bling bling that doesn't add much.
Things I cannot understand is the disappearing of the curves when hovered (might be related to how I fake the segment and ray visibility) and so on.
So let me know what you think. You can have a look at it at
http://nbviewer.jupyter.org/gist/ilayn/f8cf8b0a68c6839dbcc346884511e2ed
~~PS: For some reason nbviewer only renders it with the `flush_cache` flag.~~
/r/Python
https://redd.it/5kbknn
Some time ago I've posted another thread about a Python3 package for control systems toolbox that I'm developing. It's called `harold` ([Github link](https://github.com/ilayn/harold) )
Now, things are getting a bit more concrete behind the scenes, though on the documentation and tutorial side I'm really falling short to keep up.
Anyways, since long time, I always wanted to see/show/explain things with Nyquist and Bode plots together as they are basically the same data in different coordinates. I wasted literally weeks to do this in matlab with countless nonsensical .m files scattered to tens of pieces. Hence I've fiddled with the amazing Bokeh library.
It's still of course wonky and I've faked the frequency response to be a simple spiral to skip the package loading. I would really appreciate if you can tell me whether it strikes you as an improvement or just another bling bling that doesn't add much.
Things I cannot understand is the disappearing of the curves when hovered (might be related to how I fake the segment and ray visibility) and so on.
So let me know what you think. You can have a look at it at
http://nbviewer.jupyter.org/gist/ilayn/f8cf8b0a68c6839dbcc346884511e2ed
~~PS: For some reason nbviewer only renders it with the `flush_cache` flag.~~
/r/Python
https://redd.it/5kbknn
GitHub
GitHub - ilayn/harold: An open-source systems and controls toolbox for Python3
An open-source systems and controls toolbox for Python3 - GitHub - ilayn/harold: An open-source systems and controls toolbox for Python3
Interview with Kenneth Reitz - Python 3, PipFile and Music!
http://castalio.info/episodio-80-kenneth-reitz-python-requests.html
/r/Python
https://redd.it/5kcscm
http://castalio.info/episodio-80-kenneth-reitz-python-requests.html
/r/Python
https://redd.it/5kcscm
Castálio Podcast
Episódio 80: Kenneth Reitz - Python Requests
Olá pessoal e sejam bem-vindos à mais um episódio do Castálio Podcast! Nosso convidado de hoje é o criador do Python Requests: HTTP para Humanos, atualmente trabalha no Heroku com um título bem interessante, PythonOverLord, possui uma coleção incrível de…
ThreadTone – Halftone images made of thread
http://www.thevelop.nl/blog/2016-12-25/ThreadTone/
/r/Python
https://redd.it/5kd09r
http://www.thevelop.nl/blog/2016-12-25/ThreadTone/
/r/Python
https://redd.it/5kd09r
theveloped.github.io
ThreadTone
A halftone representation of an image made of thread.
Scientific python cheat sheet by IPGP
https://ipgp.github.io/scientific_python_cheat_sheet/
/r/IPython
https://redd.it/4ndne7
https://ipgp.github.io/scientific_python_cheat_sheet/
/r/IPython
https://redd.it/4ndne7
ipgp.github.io
Scientific python cheat sheet by IPGP
A cheat sheet for scientific python. The cheat sheet focuses on the scientific/data Python tools, e.g. matplotlib, NumPy/SciPy or pandas.
watsongraph - concept discovery and recommendation library using IBM Watson
https://github.com/ResidentMario/watsongraph
/r/pystats
https://redd.it/42caac
https://github.com/ResidentMario/watsongraph
/r/pystats
https://redd.it/42caac
GitHub
ResidentMario/watsongraph
watsongraph - Concept discovery and recommendation library built on top of the IBM Watson cognitive API.
Pendulum (Python datetimes made easy) 0.8.0 is out: Improved ISO 8601 parsing and more
https://pendulum.eustace.io/blog/pendulum-0-8-0-is-out.html
/r/Python
https://redd.it/5kdd5w
https://pendulum.eustace.io/blog/pendulum-0-8-0-is-out.html
/r/Python
https://redd.it/5kdd5w
pendulum.eustace.io
Pendulum 0.8.0 is out: Improved ISO 8601 parsing and more | Blog | Pendulum - Python datetimes made easy
Pendulum 0.8.0 is now out.
Help Installing Ipython
Hello everyone. Been trying to install Ipython for 2h with no success. I previously installed Python 2.7.9 and then run command line and write - pip install ipython (Im following my teacher's tutorial).
In the end I always get this error - http://i.imgur.com/JLnXHJ9.png
I have tried reinstalling Python 2.7.9 but it didn't solve my problem. Im using Windows 8 64bits.
Any ideas how can I solve this?
EDIT: Solved, had to run Command Line in Admin mode.
/r/IPython
https://redd.it/4mdbtg
Hello everyone. Been trying to install Ipython for 2h with no success. I previously installed Python 2.7.9 and then run command line and write - pip install ipython (Im following my teacher's tutorial).
In the end I always get this error - http://i.imgur.com/JLnXHJ9.png
I have tried reinstalling Python 2.7.9 but it didn't solve my problem. Im using Windows 8 64bits.
Any ideas how can I solve this?
EDIT: Solved, had to run Command Line in Admin mode.
/r/IPython
https://redd.it/4mdbtg
Use Django or end up building a Django
https://hackernoon.com/use-django-or-end-up-building-a-django-6cce65eb7255#.rb9iqnynf
/r/django
https://redd.it/5kcyyh
https://hackernoon.com/use-django-or-end-up-building-a-django-6cce65eb7255#.rb9iqnynf
/r/django
https://redd.it/5kcyyh
Hacker Noon
Use Django or end up building a Django
No matter if you’re a beginner or Professional web developer, use Django Python web framework for your web project otherwise you’ll end up…
Spatial Analysis: Mapping Earthquakes in Japan, Korea, and China from 1970 to 2013
http://nbviewer.jupyter.org/github/Prooffreader/Misc_ipynb/blob/master/Japan_Earthquakes/earthquakes-jp.ipynb
/r/JupyterNotebooks
https://redd.it/47thtw
http://nbviewer.jupyter.org/github/Prooffreader/Misc_ipynb/blob/master/Japan_Earthquakes/earthquakes-jp.ipynb
/r/JupyterNotebooks
https://redd.it/47thtw
What's the state of django 3rd party libraries vs. rails?
Hi all,
I'm looking to build a responsive website with a handful of standard features, but really want to be able to leverage 3rd party frameworks and libraries to keep my life simple.
I'd far prefer to use python/django over rails if possible, but would go with whichever platform has more plug-and-play type functionality and have CLEAN widget design. I don't want to come up with a bunch of new UI element iconography.
Here are the main library types I'd be looking for:
Not sure on:
- Image upload & thumbnailing with cropping (to a CDN)
- Chat/messaging
- Forum type discussion
- Authentication via social media (FB)
- Search (by username and other custom filters)
- Payments (probably just stripe or braintree to start)
Probably standard:
- Autocomplete for search
- Easy form validation
- Captcha / spam prevention
/r/django
https://redd.it/5k9v2f
Hi all,
I'm looking to build a responsive website with a handful of standard features, but really want to be able to leverage 3rd party frameworks and libraries to keep my life simple.
I'd far prefer to use python/django over rails if possible, but would go with whichever platform has more plug-and-play type functionality and have CLEAN widget design. I don't want to come up with a bunch of new UI element iconography.
Here are the main library types I'd be looking for:
Not sure on:
- Image upload & thumbnailing with cropping (to a CDN)
- Chat/messaging
- Forum type discussion
- Authentication via social media (FB)
- Search (by username and other custom filters)
- Payments (probably just stripe or braintree to start)
Probably standard:
- Autocomplete for search
- Easy form validation
- Captcha / spam prevention
/r/django
https://redd.it/5k9v2f
reddit
What's the state of django 3rd party libraries vs. rails? • /r/django
Hi all, I'm looking to build a responsive website with a handful of standard features, but really want to be able to leverage 3rd party...
Watermark - An IPython magic extension for adding date and time stamps, version numbers, and hardware information to your notebooks
https://github.com/rasbt/watermark
/r/JupyterNotebooks
https://redd.it/47sifn
https://github.com/rasbt/watermark
/r/JupyterNotebooks
https://redd.it/47sifn
GitHub
GitHub - rasbt/watermark: An IPython magic extension for printing date and time stamps, version numbers, and hardware information
An IPython magic extension for printing date and time stamps, version numbers, and hardware information - rasbt/watermark
Where do you find Jypyter plugins?
Is there a central repo to search for plugins? I imagine pip might be a place, but it doesn't seem like all plugins are pip installable.
/r/IPython
https://redd.it/5kf6ve
Is there a central repo to search for plugins? I imagine pip might be a place, but it doesn't seem like all plugins are pip installable.
/r/IPython
https://redd.it/5kf6ve
reddit
Where do you find Jypyter plugins? • /r/IPython
Is there a central repo to search for plugins? I imagine pip might be a place, but it doesn't seem like all plugins are pip installable.
meza: A Python toolkit for processing tabular data
https://github.com/reubano/meza
/r/pystats
https://redd.it/4223qq
https://github.com/reubano/meza
/r/pystats
https://redd.it/4223qq
GitHub
GitHub - reubano/meza: A Python toolkit for processing tabular data
A Python toolkit for processing tabular data. Contribute to reubano/meza development by creating an account on GitHub.