Bokeh poor support of Pandas DataFrame?
Just curious if anybody else find it surprising that Bokeh doesn't support Pandas dataframe as well as they would like as compared to plotly? Bokeh, seaborn, dask, pandas, et. el. are all part of the pydata organization. So I was surprised for instance, if you make a Bokeh chart of multiple lines from a pandas dataframe, the hover tool doesn't include the column names. It includes the (x,y) coordinates and index value, but omits the line labels!!! Hmmm...wow. One of the usefulness of the hover tool is when you have multiple lines, you want to easily identify the corresponding line label. In Bokeh, to get the line labels/column names in the hover tool you have to create a ColumnDataSource object from the Pandas dataframe, create a Hover object, and then use a FOR loop to render each line, otherwise resort to using HoloViews (a higher level API around Bokeh), which I still don't see how to get line labels. So I look into HoloViews further and I also find out it doesn't support pandas dataframe index, you have to resort to doing an additional reset_index() per their [doc](http://dev.holoviews.org/Tutorials/Pandas_Conversion.html).
Plotly surprisingly supports Pandas dataframes more completely compared to Bokeh (shows column names/line labels in the hover tool) and supports dataframe index. This is part of the major reason why it looks like I will have to stick with Plotly for interactive visualizations. If I have a need for a viz server or plot billions of data points, then I'll use Bokeh.
/r/pystats
https://redd.it/6xtmes
Just curious if anybody else find it surprising that Bokeh doesn't support Pandas dataframe as well as they would like as compared to plotly? Bokeh, seaborn, dask, pandas, et. el. are all part of the pydata organization. So I was surprised for instance, if you make a Bokeh chart of multiple lines from a pandas dataframe, the hover tool doesn't include the column names. It includes the (x,y) coordinates and index value, but omits the line labels!!! Hmmm...wow. One of the usefulness of the hover tool is when you have multiple lines, you want to easily identify the corresponding line label. In Bokeh, to get the line labels/column names in the hover tool you have to create a ColumnDataSource object from the Pandas dataframe, create a Hover object, and then use a FOR loop to render each line, otherwise resort to using HoloViews (a higher level API around Bokeh), which I still don't see how to get line labels. So I look into HoloViews further and I also find out it doesn't support pandas dataframe index, you have to resort to doing an additional reset_index() per their [doc](http://dev.holoviews.org/Tutorials/Pandas_Conversion.html).
Plotly surprisingly supports Pandas dataframes more completely compared to Bokeh (shows column names/line labels in the hover tool) and supports dataframe index. This is part of the major reason why it looks like I will have to stick with Plotly for interactive visualizations. If I have a need for a viz server or plot billions of data points, then I'll use Bokeh.
/r/pystats
https://redd.it/6xtmes
Postgres vs MySql - Which is better? Why?
I use MySql, as pythonanywhere has that preinstalled for free accounts. Any reason why you might go with postgres over mysql?
/r/flask
https://redd.it/6y2u0m
I use MySql, as pythonanywhere has that preinstalled for free accounts. Any reason why you might go with postgres over mysql?
/r/flask
https://redd.it/6y2u0m
reddit
Postgres vs MySql - Which is better? Why? • r/flask
I use MySql, as pythonanywhere has that preinstalled for free accounts. Any reason why you might go with postgres over mysql?
[AF] Where to store data and and static charts to be accessed by a Flask app
Flask newbie here! I have a question about how best to supply data to a Flask app.
I have a Flask app that shows some data and charts that are updated every hour. I'd consider the data "small" (a table of ~50 rows and 3 columns). The data and charts are generated by an R script that I have running outside and independently of my Flask app. The R script stores the data as a csv file and the charts as images on AWS S3, which the Flask app loads and presents. The Flask app does not write to the data set; it only reads it.
This setup works fine for now, but I'm wondering if I will experience issues as usage of the app (hopefully) scales. Are there issues with the app loading a csv file instead of reading from a database? Are there issues with the data and charts sitting outside of the app entirely?
Being new to web app development, I just want to make sure that I'm on the right path and not making egregious mistakes. Apologies if my current setup is way off the mark, but I would appreciate feedback. Thanks for your help!
/r/flask
https://redd.it/6xvlwk
Flask newbie here! I have a question about how best to supply data to a Flask app.
I have a Flask app that shows some data and charts that are updated every hour. I'd consider the data "small" (a table of ~50 rows and 3 columns). The data and charts are generated by an R script that I have running outside and independently of my Flask app. The R script stores the data as a csv file and the charts as images on AWS S3, which the Flask app loads and presents. The Flask app does not write to the data set; it only reads it.
This setup works fine for now, but I'm wondering if I will experience issues as usage of the app (hopefully) scales. Are there issues with the app loading a csv file instead of reading from a database? Are there issues with the data and charts sitting outside of the app entirely?
Being new to web app development, I just want to make sure that I'm on the right path and not making egregious mistakes. Apologies if my current setup is way off the mark, but I would appreciate feedback. Thanks for your help!
/r/flask
https://redd.it/6xvlwk
reddit
[AF] Where to store data and and static charts to be... • r/flask
Flask newbie here! I have a question about how best to supply data to a Flask app. I have a Flask app that shows some data and charts that are...
Great talk by David Beazley about the new features of python 3.6
https://www.youtube.com/watch?v=js_0wjzuMfc
/r/Python
https://redd.it/6ydaw4
https://www.youtube.com/watch?v=js_0wjzuMfc
/r/Python
https://redd.it/6ydaw4
YouTube
The Fun of Reinvention (Screencast)
Invited Keynote Talk from PyCon Israel, June 12, 2017. I cause trouble and build a framework using all sorts of new Python 3.6+ features.
This video can be discussed at https://forum.dabeaz.com/t/the-fun-of-reinvention-pycon-israel-june-12-2017/204/1
David…
This video can be discussed at https://forum.dabeaz.com/t/the-fun-of-reinvention-pycon-israel-june-12-2017/204/1
David…
Python for Data Science and Machine Learning Bootcamp
https://medium.com/@amtoddstewart/learn-python-for-data-science-and-machine-learning-with-jose-portilla-1445beddf345
/r/Python
https://redd.it/6ye3n7
https://medium.com/@amtoddstewart/learn-python-for-data-science-and-machine-learning-with-jose-portilla-1445beddf345
/r/Python
https://redd.it/6ye3n7
Medium
Learn Python For Data Science And Machine Learning With Jose Portilla
You will learn to use NumPy, Pandas, Seaborn, Matplotlib, Plotly, Scikit-Learn, Machine Learning, Tensorflow, and much more
Creative Applications of Deep Learning python package (open-sourced TensorFlow models from MOOC)
https://github.com/pkmital/pycadl
/r/Python
https://redd.it/6ycuye
https://github.com/pkmital/pycadl
/r/Python
https://redd.it/6ycuye
GitHub
pkmital/pycadl
pycadl - Python package with source code from the course "Creative Applications of Deep Learning w/ TensorFlow"
Help to redo Economics: The Agent-Based Computational Economics Library. I worked for 5 years and it is finally stable.
https://github.com/AB-CE/abce/releases/tag/0.9b
/r/Python
https://redd.it/6ybnhj
https://github.com/AB-CE/abce/releases/tag/0.9b
/r/Python
https://redd.it/6ybnhj
GitHub
AB-CE/abce
abce - Agent-Based Complete Economy, the Python library that makes AB modelling easier..
A journey of reproducibility from Excel to Pandas
https://www.software.ac.uk/blog/2017-09-01-lonely-journey-excel-pandas
/r/Python
https://redd.it/6yfrhh
https://www.software.ac.uk/blog/2017-09-01-lonely-journey-excel-pandas
/r/Python
https://redd.it/6yfrhh
reddit
A journey of reproducibility from Excel to Pandas • r/Python
2 points and 0 comments so far on reddit
Any Python project for students?
Hi, Reddit! I'm a student of MIPT and I have a course about programming and innovations (not really innovations, administration just calls it this way), and during this course we will have to create different "innovative" projects in small teams (about 2 - 3 student per team). These projects don't have to be really innovative, but it's also not a good idea to create someting that was created thousands times before, like TODO application. Unfortunately, I don't have any good ideas for such project! The only one I have is to create some kind of Wolfram Alpha analogue using Telegram Bot and SymPy.
So, do you have any ideas, what should we (my team and I) implement? Any help will be appreciated!
/r/Python
https://redd.it/6yg2qx
Hi, Reddit! I'm a student of MIPT and I have a course about programming and innovations (not really innovations, administration just calls it this way), and during this course we will have to create different "innovative" projects in small teams (about 2 - 3 student per team). These projects don't have to be really innovative, but it's also not a good idea to create someting that was created thousands times before, like TODO application. Unfortunately, I don't have any good ideas for such project! The only one I have is to create some kind of Wolfram Alpha analogue using Telegram Bot and SymPy.
So, do you have any ideas, what should we (my team and I) implement? Any help will be appreciated!
/r/Python
https://redd.it/6yg2qx
reddit
Any Python project for students? • r/Python
Hi, Reddit! I'm a student of MIPT and I have a course about programming and innovations (not really innovations, administration just calls it this...
A Python module for parallel optimization of expensive black-box functions
https://github.com/paulknysh/blackbox
/r/Python
https://redd.it/6yg0d6
https://github.com/paulknysh/blackbox
/r/Python
https://redd.it/6yg0d6
GitHub
GitHub - paulknysh/blackbox: A Python module for parallel optimization of expensive black-box functions
A Python module for parallel optimization of expensive black-box functions - paulknysh/blackbox
Problem with Flask-SQLAlchemy
Hi, everybody. I'm trying to pass an HTML text (a tag text) to a table using "db.session.Model(HTML)", but I get "sqlalchemy.exc.InterfaceError: (sqlite3.InterfaceError) Error binding parameter 0 - probably unsupported type." If I then pass "HTML" inside a str() function, to turn it into a string, I get "sqlalchemy.orm.exc.UnmappedInstanceError: Class 'builtins.str' is not mapped".
Does anyone know how to solve that problem?
/r/flask
https://redd.it/6wsbz0
Hi, everybody. I'm trying to pass an HTML text (a tag text) to a table using "db.session.Model(HTML)", but I get "sqlalchemy.exc.InterfaceError: (sqlite3.InterfaceError) Error binding parameter 0 - probably unsupported type." If I then pass "HTML" inside a str() function, to turn it into a string, I get "sqlalchemy.orm.exc.UnmappedInstanceError: Class 'builtins.str' is not mapped".
Does anyone know how to solve that problem?
/r/flask
https://redd.it/6wsbz0
reddit
Problem with Flask-SQLAlchemy • r/flask
Hi, everybody. I'm trying to pass an HTML text (a tag text) to a table using "db.session.Model(HTML)", but I get "sqlalchemy.exc.InterfaceError:...
Easiest way to send information to a site
Hi all,
I have a site running on pythonanywhere that uses a database to display information to users. The problem is that pythonanywhere doesn't let you remotely write to a database so it is a pain to update the database and I'm looking for a way to automate it. I was thinking of having a specific route in which I could send it a list of values and these values would be written to the database. I was looking and it seems that an API would be an option. I'm not in the mood to learn how to create an API right now if I don't have to. Is there an easier way to do this? Basically I would like to have a python script running on my home computer then at a certain point, it accesses the appropriate page (using requests or something like that) and these values get written to the database.
Thanks
/r/flask
https://redd.it/6wr416
Hi all,
I have a site running on pythonanywhere that uses a database to display information to users. The problem is that pythonanywhere doesn't let you remotely write to a database so it is a pain to update the database and I'm looking for a way to automate it. I was thinking of having a specific route in which I could send it a list of values and these values would be written to the database. I was looking and it seems that an API would be an option. I'm not in the mood to learn how to create an API right now if I don't have to. Is there an easier way to do this? Basically I would like to have a python script running on my home computer then at a certain point, it accesses the appropriate page (using requests or something like that) and these values get written to the database.
Thanks
/r/flask
https://redd.it/6wr416
reddit
Easiest way to send information to a site • r/flask
Hi all, I have a site running on pythonanywhere that uses a database to display information to users. The problem is that pythonanywhere doesn't...
DjangoCon 2017 Videos are up and a question!
Firstly, I know a lot of people have been waiting, but the [recordings from DjangoCon 2017 are finally up!](https://www.youtube.com/channel/UC0yY6a79pPY9J0ShIHRf6yw/videos)
Secondly, I want to know from you, the community, what would you like to see covered next year?
/r/django
https://redd.it/6yio1q
Firstly, I know a lot of people have been waiting, but the [recordings from DjangoCon 2017 are finally up!](https://www.youtube.com/channel/UC0yY6a79pPY9J0ShIHRf6yw/videos)
Secondly, I want to know from you, the community, what would you like to see covered next year?
/r/django
https://redd.it/6yio1q
YouTube
DjangoCon US
Six days of talks, sprints, and tutorials by the community for the community.
The Incredible Growth of Python
https://stackoverflow.blog/2017/09/06/incredible-growth-python/
/r/Python
https://redd.it/6ygxne
https://stackoverflow.blog/2017/09/06/incredible-growth-python/
/r/Python
https://redd.it/6ygxne
Stack Overflow Blog
The Incredible Growth of Python
When we focus on high-income countries, the growth of Python is even larger than it might appear from tools like Stack Overflow Trends.
How do I perform additional functions on my database ?
I have created a Django app that is based on a database on product sales. Besides, displaying the data in tables, I want to perform and show some statistics on them, ex. min, max, average etc.
I am not sure how to do that and where the code should reside, perhaps in views.py.
Below it is a simple example of what I have:
models.py
from django.db import models
class Sale(models.Model):
date = models.DateTimeField()
customer_name = models.CharField(max_length=264)
product = models.CharField(max_length=264)
amount = models.PositiveIntegerField()
value = models.DecimalField(max_digits=10, decimal_places=3)
views.py
from django.views.generic import DetailView, ListView
from . import models
class SalesView(ListView):
context_object_name = "sales"
model = models.Sale
template_name = "sales.html"
def get_queryset(self):
return models.Sale.objects.all().order_by("-timestamp")
/r/django
https://redd.it/6yjd9h
I have created a Django app that is based on a database on product sales. Besides, displaying the data in tables, I want to perform and show some statistics on them, ex. min, max, average etc.
I am not sure how to do that and where the code should reside, perhaps in views.py.
Below it is a simple example of what I have:
models.py
from django.db import models
class Sale(models.Model):
date = models.DateTimeField()
customer_name = models.CharField(max_length=264)
product = models.CharField(max_length=264)
amount = models.PositiveIntegerField()
value = models.DecimalField(max_digits=10, decimal_places=3)
views.py
from django.views.generic import DetailView, ListView
from . import models
class SalesView(ListView):
context_object_name = "sales"
model = models.Sale
template_name = "sales.html"
def get_queryset(self):
return models.Sale.objects.all().order_by("-timestamp")
/r/django
https://redd.it/6yjd9h
reddit
How do I perform additional functions on my database ? • r/django
I have created a Django app that is based on a database on product sales. Besides, displaying the data in tables, I want to perform and show some...
[AF] Flask.Session + ReactJS. Session not persisting after component change.
I have two components. Login and Main.
The initial view is Login, which sends a username and password to the Flask server using [Axios API ](https://github.com/mzabriskie/axios) and if the credentials are valid, a session is set, and the server sends back a JSON with a hashed user ID and status code.
The component then switches to Main. However when I make any HTTP request within the Main component, (POST, GET, DELETE), the session key which I made when login is valid no longer exists.
Could this problem be server-side?
/r/flask
https://redd.it/6yjul1
I have two components. Login and Main.
The initial view is Login, which sends a username and password to the Flask server using [Axios API ](https://github.com/mzabriskie/axios) and if the credentials are valid, a session is set, and the server sends back a JSON with a hashed user ID and status code.
The component then switches to Main. However when I make any HTTP request within the Main component, (POST, GET, DELETE), the session key which I made when login is valid no longer exists.
Could this problem be server-side?
/r/flask
https://redd.it/6yjul1
GitHub
GitHub - axios/axios: Promise based HTTP client for the browser and node.js
Promise based HTTP client for the browser and node.js - axios/axios
Python Slack Community: PySlackers. 8,500 users strong
We have commented a couple times about our python slack community, but I would like to make an official post about it now.
We are PySlackers, a community driven slack group of ~8,500 users from all over the world and all levels of experience. We have popular channels for most topics people care about such as:
#flask
#django
#devops
#async
#beer_geeks
and even many based on location like `#i18n_nyc` and more.
We would like to invite you all to our great community. You can find our website over at https://pyslackers.com where you can find a big button to automatically join our community. We also have a few community projects (`#community_projects`) where we are working on the website (django) and a slack bot (aiohttp) and are talking about others.
You can also find us on github at:
https://github.com/pyslackers
If you want to give back to the community and want to learn how to build things. We are also open to new ideas.
So on behalf of the other admins, we invite you all to join, and grow with us and the rest of the community and write some python!
Shawn (autoferrit)
/r/Python
https://redd.it/6yh5uy
We have commented a couple times about our python slack community, but I would like to make an official post about it now.
We are PySlackers, a community driven slack group of ~8,500 users from all over the world and all levels of experience. We have popular channels for most topics people care about such as:
#flask
#django
#devops
#async
#beer_geeks
and even many based on location like `#i18n_nyc` and more.
We would like to invite you all to our great community. You can find our website over at https://pyslackers.com where you can find a big button to automatically join our community. We also have a few community projects (`#community_projects`) where we are working on the website (django) and a slack bot (aiohttp) and are talking about others.
You can also find us on github at:
https://github.com/pyslackers
If you want to give back to the community and want to learn how to build things. We are also open to new ideas.
So on behalf of the other admins, we invite you all to join, and grow with us and the rest of the community and write some python!
Shawn (autoferrit)
/r/Python
https://redd.it/6yh5uy
Pyslackers
A community dedicated to building and enabling the global Python community by providing a safe
and inclusive place to learn, share, and grow as a Pythonista.
and inclusive place to learn, share, and grow as a Pythonista.
Realtime Reddit Feed App
Hey everyone!
Just wanted to show off something useless as hell that I made, but kinda cool to look at. I use it to view the latest news coming in when I'm surfing the web. I'll glance back at it every few min to see what's happening in the news.
[Here's a video of it](https://streamable.com/5yst8). I'm in the process of getting hosting and then i'll have this running on a webpage showing news, and maybe have a separate page streaming /r/all, and i'll probably have it wipe that every couple hours.
I have a similar python script that can stream comments in real time from a particular subreddit or /r/all, and use keyword filters.
If i wanted to, I can easily make a bot out of these scripts and set up an auto-reply or do whatever to certain submissions or comment phrases.
I dont plan on making any money off of these. I'm hoping I can make some type of web app where people can pull up their own custom feed view and define what subreddits and/or keywords they want to filter out on their end.
/r/Python
https://redd.it/6yltvu
Hey everyone!
Just wanted to show off something useless as hell that I made, but kinda cool to look at. I use it to view the latest news coming in when I'm surfing the web. I'll glance back at it every few min to see what's happening in the news.
[Here's a video of it](https://streamable.com/5yst8). I'm in the process of getting hosting and then i'll have this running on a webpage showing news, and maybe have a separate page streaming /r/all, and i'll probably have it wipe that every couple hours.
I have a similar python script that can stream comments in real time from a particular subreddit or /r/all, and use keyword filters.
If i wanted to, I can easily make a bot out of these scripts and set up an auto-reply or do whatever to certain submissions or comment phrases.
I dont plan on making any money off of these. I'm hoping I can make some type of web app where people can pull up their own custom feed view and define what subreddits and/or keywords they want to filter out on their end.
/r/Python
https://redd.it/6yltvu
Streamable
Realtime Reddit Feed - Streamable
Check out this video on Streamable using your phone, tablet or desktop.
[AF] Jinja and Flask Routing
Hi, i'm currently trying to route something in my apps and i don't know how to make it work. I have this route in my flask app and it's working when i'm writing typing http://127.0.0.1:5000/user/Sam
@app.route('/user/<username>')
def crypto(username):
return render_template('crypto.html', username=username)
Where it's not working it's my Navbar i'm trying to make a link with Jinja to get to /user/Sam
<a class="nav-link" href="{{ url_for('user', username=username) }}">User</a>
But it's only give me http://127.0.0.1:5000/user/ what i'm missing to get the username to my link?
/r/flask
https://redd.it/6ylud9
Hi, i'm currently trying to route something in my apps and i don't know how to make it work. I have this route in my flask app and it's working when i'm writing typing http://127.0.0.1:5000/user/Sam
@app.route('/user/<username>')
def crypto(username):
return render_template('crypto.html', username=username)
Where it's not working it's my Navbar i'm trying to make a link with Jinja to get to /user/Sam
<a class="nav-link" href="{{ url_for('user', username=username) }}">User</a>
But it's only give me http://127.0.0.1:5000/user/ what i'm missing to get the username to my link?
/r/flask
https://redd.it/6ylud9
reddit
[AF] Jinja and Flask Routing • r/flask
Hi, i'm currently trying to route something in my apps and i don't know how to make it work. I have this route in my flask app and it's working...