Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Best method to plot time of day independent of date?

I often work data that needs to be plotted by time of day with no regard for the date. Typically I'm just making simple scatter plots of values vs time of day. I have a lot of issues plotting this as actual time so I've been covering time to minutes past midnight for a smooth plot. I'm certain this isn't an affective strategy and . Do y'all have recommendations? Pandas datetime format seems to wreak havoc on any plots I make and always adds a date.

/r/pystats
https://redd.it/cb50kz
What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.

/r/Python
https://redd.it/cb1d1q
Jupyter Notebook Doesn't Show Files When It Loads

I start up Jupyter Notebook using the Anaconda prompt, it loads, and there are no files shown. I also can't create new files through Jupyter. I've reinstalled the program, restarted my computer, reinstalled Anaconda; nothing is working. Please help.

/r/JupyterNotebooks
https://redd.it/cb4qde
allowed_hosts behind load balancer

What value can I set allowed_hosts to if my server(s) are behind a reverse proxy or load balancer? In particular, this is an Elastic Load Balancer, so the front-end IPs are dynamic.

I have * as the current setting.

/r/django
https://redd.it/cb6tcq
CAN NOT serve website with Apache2

I have been stuck on this for over a week now. Nothing I do fixes this problem.

​

Basically, on my digital Ocean VPS I have my Django project. When I run the command "python3 [manage.py](https://manage.py) runserver [0.0.0.0:8000](https://0.0.0.0:8000)" it perfectly works. I can open my vps IP address at the port :8000 and it loads just fine.

However, when I try to serve it using Apache and I go on the IP address, I just get a page that says "Server Error (500)".

My config file looks [The same as this](https://github.com/CoreyMSchafer/code_snippets/blob/master/Django_Blog/snippets/django_project.conf) except filled in with the correct file paths.

​

I have set the permissions using chmod and :www-data according to like 5 different tutorials, none have changed anything. What do I do?

/r/django
https://redd.it/cbbhb2
Django models

What is the use of models if I am not storing any data in the database? I am purely getting data from the database to display on the template.

/r/django
https://redd.it/cbbdhc
This media is not supported in your browser
VIEW IN TELEGRAM
Created a fun script to poorly replicate any image with Turtle

/r/Python
https://redd.it/cb1gkd
Flask Restful API

Hey,

I want to master creating APIs in flask for big applications using flask Restful and blueprints which documentation should i follow to be a pro in this.

Any suggestion will be appreciated.

/r/flask
https://redd.it/cbdu5m
Can anybody pls pls pls help me

I have this statement to fetch data from database posts=Posts.query.filter_by().all(). So, my question is posts is class and query is attribute and after query there is function filter_by so why we put attribute before query I want to know how it's work. And one more thing after function filter_by()another function .all(). So,how these function and attribute works from under the hood

/r/flask
https://redd.it/cbc1c1
Help finding it hard to memorize all the functions and operating languages. Is there a cheatsheet or anything so i don't have to remember all of this?

It doesnt have to be super indepth. Just need something for the basics, strings and whatnot.

/r/Python
https://redd.it/cbfkfm
[D] Controversial Theories in ML/AI?

As we know, Deep Learning faces certain issues (e.g., generalizability, data hunger, etc.). If we want to speculate, which controversial theories do you have in your sights you think that it is worth to look nowadays?

So far, I've come across 3 interesting ones:

1. Cognitive science approach by Tenenbaum: [Building machines that learn and think like people](https://arxiv.org/abs/1604.00289). It portrays the problem as an architecture problem.
2. Capsule Networks by Hinton: [Transforming Autoencoders](https://www.cs.toronto.edu/~hinton/absps/transauto6.pdf). More generalizable DL.
3. Neuroscience approach by Hawkins: [The Thousand Brains Theory](https://numenta.com/neuroscience-research/research-publications/papers/a-framework-for-intelligence-and-cortical-function-based-on-grid-cells-in-the-neocortex/). Inspired by the neocortex.

What are your thoughts about those 3 theories or do you have other theories that catch your attention?

/r/MachineLearning
https://redd.it/cbgizh
Lost Phone

Has anyone on this sub lost a phone on Alnmouth beach Northumberland? We can’t ring the contact who text the phone but there was a notification from this sub.

Edit: The phone was found on the beach between Alnmouth and Warkworth

/r/Python
https://redd.it/cbgpqu
This media is not supported in your browser
VIEW IN TELEGRAM
I made a program which encrypts the RGB value of each pixel using an 8 bit key and xor encryption that i learnt in school. Not sure if there is a real usecase for this however i find it pretty cool

/r/Python
https://redd.it/cbhenw
Best practice on ATOMIC_REQUESTS

It looks like ATOMIC\_REQUESTS is off by default in Django, but I've talked to a lot of people who turn it on. I agree that it does help reason about requests (since a request can complete fully or not at all), but to me it also creates potential hazards. For instance, what if, as a side-effect, I send a user an alert or something, then end up rolling back the transaction? I could always put that in an "on\_commit" call but that seems tedious.

​

What do people usually do?

/r/django
https://redd.it/cbmehj
Learning Python as a blind person, any advice?

So, I've diligently been trying to learn Python on my own, as I've heard there are many advantages to how easy the syntax is. I even tried to make an interest calculator from scratch.
I believe that the only way to learn programming is to type the commands out yourself, even if you have them right in front of you. This enforces true conceptual learning and makes it easier to memorize. I did this with both JS and HTML 5, and they worked. I'm getting my tutorials straight from python.org.
With all of this said, It's really difficult to judge how much white space I need before every line, thus I keep getting syntax errors based on this one simple problem.
As the post title states, I am indeed fully blind, as in can't see at all. So, it's really difficult to judge the amount of white space required for this reason, and Idol is not exactly screen reader friendly either. Unfortunately, as I know that Idol is what comes with Python when you get it. I'm currently running Python 3.7.
With all of this info, do any of you Python programmers have any advice as to which editors are

/r/Python
https://redd.it/cbpcw6