Python accumulators
What is an accumulator? Should it be assigned any particular value? Why and why not?
/r/Python
https://redd.it/6aoy4z
What is an accumulator? Should it be assigned any particular value? Why and why not?
/r/Python
https://redd.it/6aoy4z
reddit
Python accumulators • r/Python
What is an accumulator? Should it be assigned any particular value? Why and why not?
[D] Did I get too far ahead of myself?
For the past 1.5 years I've been interning as an undergrad research engineer on ML, and I am getting results, and some of it is going to be published. From this perspective, it looks like I am doing quite ok, but in reality I have no idea what I am doing, and the paper(s) that I'll be publishing won't even be close to the quality of the papers that I'm reading. My understanding of ML algorithms is at a black box level, but I have a decent understanding of what approach I should take for a problem, and domain knowledge in the field that I'm applying ML to. However, my math understanding is terrible, and I can't even count to potato. I ignore the math problems and move on to problems that I am able to solve, but this severely limits my usefulness and I'm unable to reproduce most of the new research papers.
I came from a biology background, but I've been programming and reading up about comp sci topics ever since I was a kid. Never good at math, and that's the reason why I wasn't eligible for a math/compsci major, and had to self-study my way into this field.
At this point I am uncertain whether I am just overwhelmed by this new field, and that I should just continue applying ML and hopefully learn and understand it this way, or that I will eventually hit a wall and get stuck as a half-assed biologist and half-assed computer scientist. Instead of continuing with getting practical experience, I could take a few steps back and formally enroll for math/comp sci courses for a couple of years and take the usual safe route. In the long term, I would like to end up a tech company as a research engineer, but I feel like if I don't get a degree in math/comp sci, I will never be confident in my math skills and have a hard time getting past technical interviews.
Thanks for taking the time to read this. What do you guys think?
/r/MachineLearning
https://redd.it/6anu7y
For the past 1.5 years I've been interning as an undergrad research engineer on ML, and I am getting results, and some of it is going to be published. From this perspective, it looks like I am doing quite ok, but in reality I have no idea what I am doing, and the paper(s) that I'll be publishing won't even be close to the quality of the papers that I'm reading. My understanding of ML algorithms is at a black box level, but I have a decent understanding of what approach I should take for a problem, and domain knowledge in the field that I'm applying ML to. However, my math understanding is terrible, and I can't even count to potato. I ignore the math problems and move on to problems that I am able to solve, but this severely limits my usefulness and I'm unable to reproduce most of the new research papers.
I came from a biology background, but I've been programming and reading up about comp sci topics ever since I was a kid. Never good at math, and that's the reason why I wasn't eligible for a math/compsci major, and had to self-study my way into this field.
At this point I am uncertain whether I am just overwhelmed by this new field, and that I should just continue applying ML and hopefully learn and understand it this way, or that I will eventually hit a wall and get stuck as a half-assed biologist and half-assed computer scientist. Instead of continuing with getting practical experience, I could take a few steps back and formally enroll for math/comp sci courses for a couple of years and take the usual safe route. In the long term, I would like to end up a tech company as a research engineer, but I feel like if I don't get a degree in math/comp sci, I will never be confident in my math skills and have a hard time getting past technical interviews.
Thanks for taking the time to read this. What do you guys think?
/r/MachineLearning
https://redd.it/6anu7y
reddit
[D] Did I get too far ahead of myself? • r/MachineLearning
For the past 1.5 years I've been interning as an undergrad research engineer on ML, and I am getting results, and some of it is going to be...
Question on Libraries for Terrain
Hey there fellow Python aficionados!
I'm starting on a project that maps terrain data in Alaska and I honestly have no idea where to begin or what libraries to use. Hell, I can't even figure out where to get the data!
Anyone have any guidance? I want to take and build contour maps at integer hundreds of feet levels throughout southwest Alaska. Ideally it'd be nice to also draw great circles to arbitrary points then measure four or five miles either side of course and find the highest elevation.
Google says matplotlib and basemap but the setup for basemap looks like a bastard. I'm open to learning another programming language if that would be the easiest way to do this, but I'm partial to Python and I'm most comfortable with it. Thanks for the help, this project is a little beyond the scope what I normally do.
/r/Python
https://redd.it/6aprff
Hey there fellow Python aficionados!
I'm starting on a project that maps terrain data in Alaska and I honestly have no idea where to begin or what libraries to use. Hell, I can't even figure out where to get the data!
Anyone have any guidance? I want to take and build contour maps at integer hundreds of feet levels throughout southwest Alaska. Ideally it'd be nice to also draw great circles to arbitrary points then measure four or five miles either side of course and find the highest elevation.
Google says matplotlib and basemap but the setup for basemap looks like a bastard. I'm open to learning another programming language if that would be the easiest way to do this, but I'm partial to Python and I'm most comfortable with it. Thanks for the help, this project is a little beyond the scope what I normally do.
/r/Python
https://redd.it/6aprff
reddit
Question on Libraries for Terrain • r/Python
Hey there fellow Python aficionados! I'm starting on a project that maps terrain data in Alaska and I honestly have no idea where to begin or...
Fastest Redis configuration for Django
https://www.peterbe.com/plog/fastest-redis-optimization-for-django
/r/django
https://redd.it/6apx65
https://www.peterbe.com/plog/fastest-redis-optimization-for-django
/r/django
https://redd.it/6apx65
Scaling Python/Flask Microservice with Kubernetes
http://blog.apcelent.com/scaling-python-microservices-kubernetes.html
/r/flask
https://redd.it/6aqt21
http://blog.apcelent.com/scaling-python-microservices-kubernetes.html
/r/flask
https://redd.it/6aqt21
reddit
Scaling Python/Flask Microservice with Kubernetes • r/flask
1 points and 0 comments so far on reddit
Getting started with PyGObject
https://pygobject.readthedocs.io/en/latest/getting_started.html
/r/Python
https://redd.it/6aq936
https://pygobject.readthedocs.io/en/latest/getting_started.html
/r/Python
https://redd.it/6aq936
nbviewer does not see notebook in Github repository?
Hi Guys. Does anyone know why nbviewer would not be able to see a notebook I uploaded to one of my Github repositories? If I go to the repository, I can see the notebook and view its contents, but nbviewer will not recognize that it's there. Has anyone else experienced this?
/r/IPython
https://redd.it/6asfa6
Hi Guys. Does anyone know why nbviewer would not be able to see a notebook I uploaded to one of my Github repositories? If I go to the repository, I can see the notebook and view its contents, but nbviewer will not recognize that it's there. Has anyone else experienced this?
/r/IPython
https://redd.it/6asfa6
reddit
nbviewer does not see notebook in Github repository? • r/IPython
Hi Guys. Does anyone know why nbviewer would not be able to see a notebook I uploaded to one of my Github repositories? If I go to the repository,...
Invalid syntax when invoking package name?
I'm learning to use ipython qtconsole with scipy tools to practice graphing differential equations. I wrote a short script to set up the environment to work in. [Here is the script](https://pastebin.com/uhGRYycE).
When I use it in qtconsole, it gives me this error:
File "/Users/me/DiffEq/deenv.py", line 9
%matplotlib inline
^
SyntaxError: invalid syntax
However, when I just type "%matplotlib inline" into the console, it gives me no such error.
Why is this?
/r/IPython
https://redd.it/6b0vlw
I'm learning to use ipython qtconsole with scipy tools to practice graphing differential equations. I wrote a short script to set up the environment to work in. [Here is the script](https://pastebin.com/uhGRYycE).
When I use it in qtconsole, it gives me this error:
File "/Users/me/DiffEq/deenv.py", line 9
%matplotlib inline
^
SyntaxError: invalid syntax
However, when I just type "%matplotlib inline" into the console, it gives me no such error.
Why is this?
/r/IPython
https://redd.it/6b0vlw
Pastebin
from sympy import init_printing # Latex printing to screen import matplotlib. - Pastebin.com
How do I remove the In [ ] Out [ ] in a Jupyter notebook?
When coding in a Jupyter notebook, is it possible to disable showing the In [ ], Out [ ] next to each code cell? If not, is it possible to do when rendering the notebook using NBViewer? I'd like my notebooks to look a little nicer without the In [ ], Out [ ] sticking out next to every cell, so I'd like to get rid of these things. Thanks!
/r/IPython
https://redd.it/6ascqz
When coding in a Jupyter notebook, is it possible to disable showing the In [ ], Out [ ] next to each code cell? If not, is it possible to do when rendering the notebook using NBViewer? I'd like my notebooks to look a little nicer without the In [ ], Out [ ] sticking out next to every cell, so I'd like to get rid of these things. Thanks!
/r/IPython
https://redd.it/6ascqz
reddit
How do I remove the In [ ] Out [ ] in a Jupyter notebook? • r/IPython
When coding in a Jupyter notebook, is it possible to disable showing the In [ ], Out [ ] next to each code cell? If not, is it possible to do when...
Checkbox in the admin that changes search_fields in real time
I would like to have a checkbox/toggle/etc under the search_fields box. When the checkbox is/isn't checked, it will change the get_search_results() function. I'd prefer for this to be done using JavaScript (no JQuery if possible!) so that the search results still change after the "Search" button is pressed, but without the page needing to reload.
Please let me know of any insights you might have. Thank you!
/r/django
https://redd.it/6b0mvh
I would like to have a checkbox/toggle/etc under the search_fields box. When the checkbox is/isn't checked, it will change the get_search_results() function. I'd prefer for this to be done using JavaScript (no JQuery if possible!) so that the search results still change after the "Search" button is pressed, but without the page needing to reload.
Please let me know of any insights you might have. Thank you!
/r/django
https://redd.it/6b0mvh
reddit
Checkbox in the admin that changes search_fields in... • r/django
I would like to have a checkbox/toggle/etc under the search_fields box. When the checkbox is/isn't checked, it will change the...
How many people are around? Monitor wifi signals to count the number of cellphones around you
https://github.com/schollz/howmanypeoplearearound
/r/Python
https://redd.it/6aytne
https://github.com/schollz/howmanypeoplearearound
/r/Python
https://redd.it/6aytne
GitHub
GitHub - schollz/howmanypeoplearearound: Count the number of people around you by monitoring wifi signals :satellite:
Count the number of people around you :family_man_man_boy: by monitoring wifi signals :satellite: - GitHub - schollz/howmanypeoplearearound: Count the number of people around you by monitoring wifi...
Example API to query Google Places, Yelp and FourSquare at the same time, with Bayesian Rankings
https://github.com/octohedron/TouristFriend
/r/flask
https://redd.it/6az5ee
https://github.com/octohedron/TouristFriend
/r/flask
https://redd.it/6az5ee
GitHub
octohedron/TouristFriend
🌆 TouristFriend API lets you query Google Places, Yelp and FourSquare at the same time, with bayesian rankings!
Django limit the choices of a many to many relationship
https://stackoverflow.com/questions/43960840/django-limit-the-choices-of-a-many-to-many-relationship
/r/django
https://redd.it/6b2ooy
https://stackoverflow.com/questions/43960840/django-limit-the-choices-of-a-many-to-many-relationship
/r/django
https://redd.it/6b2ooy
Stackoverflow
Django limit the choices of a many to many relationship
I know the title says the question has been asked before but the situation is different.
I have something called Agent:
class Agent(models.Model):
user = models.ForeignKey(settings.AUTH_USER_...
I have something called Agent:
class Agent(models.Model):
user = models.ForeignKey(settings.AUTH_USER_...
Django REST framework 3.6.3 now released.
http://www.django-rest-framework.org/topics/release-notes/#363
/r/django
https://redd.it/6asat4
http://www.django-rest-framework.org/topics/release-notes/#363
/r/django
https://redd.it/6asat4
sanitizing code for an exec command
I have a script that runs code provided by the user via an exec command. I know this can be considered a security hazard. As a precaution, before compiling I look for the term "import" anywhere in the code and if I find it the code is rejected. When code is executed, it's only given access to the builtins and a specific locals dictionary of functions and classes that it is meant to be able to interact with. The program is running on a remote server so the user cannot see any output to stdout.
Can anyone tell me if/how this is still unsafe? Is there something I'm not considering that would allow a user to run malicious code?
Thanks for any input.
/r/Python
https://redd.it/6b3zzy
I have a script that runs code provided by the user via an exec command. I know this can be considered a security hazard. As a precaution, before compiling I look for the term "import" anywhere in the code and if I find it the code is rejected. When code is executed, it's only given access to the builtins and a specific locals dictionary of functions and classes that it is meant to be able to interact with. The program is running on a remote server so the user cannot see any output to stdout.
Can anyone tell me if/how this is still unsafe? Is there something I'm not considering that would allow a user to run malicious code?
Thanks for any input.
/r/Python
https://redd.it/6b3zzy
reddit
sanitizing code for an exec command • r/Python
I have a script that runs code provided by the user via an exec command. I know this can be considered a security hazard. As a precaution,...
Help with
class Place(models.Model):
address = models.CharField()
class Restaurant(Place):
unique_to_restaurant = models.CharField()
competitors = models.ManyToManyField(Place)
class Stadium(Place):
unique_to_stadium = models.TextField()
class Favorites(models.Model):
description = models.TextField()
favorites = models.ManyToManyField(Place)
I'm not great with databases and this is really giving me headaches. What is the best way to do this database? This is the gist of what I have currently, which functionally does exactly what I need. However the amount of queries are out of control. The children of Place share a lot of the same fields as Place but have some unique ones. I need to query place and favorites often. Favorites must be able to access the children of Place and the children of Place sometimes access the children of Place as well. Generic Foreign keys don't work (I don't think?) because the instance will be used more than once, so I would need to clone an instance. If anybody could help me out that would be absolutely amazing.
Edit: Sorry about the title! I was worried so much about the formatting of the code that I forgot to complete it and now I'm stuck with it :(
/r/django
https://redd.it/6b4cbe
class Place(models.Model):
address = models.CharField()
class Restaurant(Place):
unique_to_restaurant = models.CharField()
competitors = models.ManyToManyField(Place)
class Stadium(Place):
unique_to_stadium = models.TextField()
class Favorites(models.Model):
description = models.TextField()
favorites = models.ManyToManyField(Place)
I'm not great with databases and this is really giving me headaches. What is the best way to do this database? This is the gist of what I have currently, which functionally does exactly what I need. However the amount of queries are out of control. The children of Place share a lot of the same fields as Place but have some unique ones. I need to query place and favorites often. Favorites must be able to access the children of Place and the children of Place sometimes access the children of Place as well. Generic Foreign keys don't work (I don't think?) because the instance will be used more than once, so I would need to clone an instance. If anybody could help me out that would be absolutely amazing.
Edit: Sorry about the title! I was worried so much about the formatting of the code that I forgot to complete it and now I'm stuck with it :(
/r/django
https://redd.it/6b4cbe
reddit
Help with • r/django
class Place(models.Model): address = models.CharField() class Restaurant(Place): unique_to_restaurant = models.CharField() ...
Need help with making a Python Numpy function for calculating distance of line in grid cells
So the situation is basically that there is a unit square (with corners (0,0),(1,0),(0,1) and (1,1)) which is made up by n*n (so n-squared) square 'grid cells'.
I need to define a function F(n,a,b) that takes as input 2 points a and b in the square, for example a=[0.3,0.4] and b=[0.6,0.8], and n (the amount of grid cells per side), and that function should give me (in very good approximation) the total distance that a straight line between those points covers in each grid cell.
So it should return an ordered list of n*n length, each element of the list representing the distance that the straight line covers in that grid cell. The order should be so that the top left grid cell is the 0th element (first element) and then the grid cell to the right of it should be the second element, so row by row.
EXAMPLE:
Suppose we take the very simple and trivial situation n=2, so 4 grid cells, and the coordinates [0,0] and [1,1].
Then the function F(2,[0,0],[1,1]) should return [0, sqrt(2)/2, sqrt(2)/2, 0] (as a numpy array preferably, and of course sqrt(2)/2 as a numerical approximation).
The function should be reasonably well optimised for like 100*100 grid cells and should be very fast (<0.5 sec)
I really hope anyone can help me with this because I've been struggling with the problem for like 10 hours or more already.
/r/Python
https://redd.it/6b4cd2
So the situation is basically that there is a unit square (with corners (0,0),(1,0),(0,1) and (1,1)) which is made up by n*n (so n-squared) square 'grid cells'.
I need to define a function F(n,a,b) that takes as input 2 points a and b in the square, for example a=[0.3,0.4] and b=[0.6,0.8], and n (the amount of grid cells per side), and that function should give me (in very good approximation) the total distance that a straight line between those points covers in each grid cell.
So it should return an ordered list of n*n length, each element of the list representing the distance that the straight line covers in that grid cell. The order should be so that the top left grid cell is the 0th element (first element) and then the grid cell to the right of it should be the second element, so row by row.
EXAMPLE:
Suppose we take the very simple and trivial situation n=2, so 4 grid cells, and the coordinates [0,0] and [1,1].
Then the function F(2,[0,0],[1,1]) should return [0, sqrt(2)/2, sqrt(2)/2, 0] (as a numpy array preferably, and of course sqrt(2)/2 as a numerical approximation).
The function should be reasonably well optimised for like 100*100 grid cells and should be very fast (<0.5 sec)
I really hope anyone can help me with this because I've been struggling with the problem for like 10 hours or more already.
/r/Python
https://redd.it/6b4cd2
reddit
Need help with making a Python Numpy function for... • r/Python
So the situation is basically that there is a unit square (with corners (0,0),(1,0),(0,1) and (1,1)) which is made up by n*n (so n-squared) square...
Can anybody think of a way to do this with less variables?
def approxPi( error ):
num = 4
denom = 1
curr = num/denom
prev = 0
while abs(curr-prev)>error:
num *= -1
denom += 2
prev = curr
curr += num/denom
return curr
/r/Python
https://redd.it/6b56tn
def approxPi( error ):
num = 4
denom = 1
curr = num/denom
prev = 0
while abs(curr-prev)>error:
num *= -1
denom += 2
prev = curr
curr += num/denom
return curr
/r/Python
https://redd.it/6b56tn
reddit
Can anybody think of a way to do this with less variables? • r/Python
def approxPi( error ): num = 4 denom = 1 curr = num/denom prev = 0 while abs(curr-prev)>error: ...
[D] /r/MachineLearning should do an unconference
Reject, Accept or In Submission? Why not post your paper here?
This field is moving too fast to wait 6 months to see the great research that's happening (and that's assuming the review process isn't noisy).
/r/MachineLearning has already been an unofficial mini-conference for the papers submitted here. I find the best discussion happens when the authors show up to answer questions and address comments. It seems like this is happening mostly by coincidence. Someone will post a paper they like and the authors will happen to notice and engage in the discussion.
It stands to reason that if this happens so often by chance, there's enough critical mass of users here to create something more official. Let's get authors posting their work and discussing it on /r/MachineLearning, sort of like a virtual poster session.
/r/MachineLearning
https://redd.it/6ay2ac
Reject, Accept or In Submission? Why not post your paper here?
This field is moving too fast to wait 6 months to see the great research that's happening (and that's assuming the review process isn't noisy).
/r/MachineLearning has already been an unofficial mini-conference for the papers submitted here. I find the best discussion happens when the authors show up to answer questions and address comments. It seems like this is happening mostly by coincidence. Someone will post a paper they like and the authors will happen to notice and engage in the discussion.
It stands to reason that if this happens so often by chance, there's enough critical mass of users here to create something more official. Let's get authors posting their work and discussing it on /r/MachineLearning, sort of like a virtual poster session.
/r/MachineLearning
https://redd.it/6ay2ac
reddit
[D] /r/MachineLearning should do an unconference • r/MachineLearning
Reject, Accept or In Submission? Why not post your paper here? This field is moving too fast to wait 6 months to see the great research that's...