Humble Software Bundle: Opearation Python 2022
https://www.humblebundle.com/operation-python-2022-software
/r/django
https://redd.it/vu5jzx
https://www.humblebundle.com/operation-python-2022-software
/r/django
https://redd.it/vu5jzx
Humble Bundle
Humble Software Bundle: Operation Python 2022
Learn Python programming through a mix of online courses, video lessons, and ebooks Write Pythonic Code Like a Seasoned Developer. Pay what you want & support charity!
Just finished up a big release for a little side project. I rarely see real-world examples of Flask projects on this sub, so I figured I'd share what I built. It's fairly simple, but happy to answer questions.
http://www.fantasynamesearch.com
/r/flask
https://redd.it/vud22s
http://www.fantasynamesearch.com
/r/flask
https://redd.it/vud22s
Fantasy Name Search
Fantasy Name Search: Dominate the Name Game
Fantasy Name Search is the #1 fantasy team name search engine. It's your one-stop shop for finding a new fantasy team name and fantasy sports analytics.
Jupyter Notebook Competition deadline coming up!
The Jupyter Notebook Competition deadline is fast approaching!
https://preview.redd.it/7zh3i14eyx991.png?width=1920&format=png&auto=webp&s=954265fdc4daad581167051f72f4f17eb33d94bf
Don't miss out on your chance to contribute to a community-driven resource of notebooks on the Copernicus WEkEO platform, AND be in with a chance of winning cash prizes!
Visit: https://www.eumetsat.int/features/new-jupyter-notebook-competition
/r/JupyterNotebooks
https://redd.it/vsotwi
The Jupyter Notebook Competition deadline is fast approaching!
https://preview.redd.it/7zh3i14eyx991.png?width=1920&format=png&auto=webp&s=954265fdc4daad581167051f72f4f17eb33d94bf
Don't miss out on your chance to contribute to a community-driven resource of notebooks on the Copernicus WEkEO platform, AND be in with a chance of winning cash prizes!
Visit: https://www.eumetsat.int/features/new-jupyter-notebook-competition
/r/JupyterNotebooks
https://redd.it/vsotwi
Deploy react inside django as a django app on Heroku
I have worked with deploying django and react separately as separate heroku apps and integrate them. But I don't know how to deploy a structure where the reactapp is inside Django's project directory disguised as a django app. How do you run the npm build on Heroku? I couldn't find any tutorials that does this, can someone help me out here? thanks!
/r/django
https://redd.it/w12hk0
I have worked with deploying django and react separately as separate heroku apps and integrate them. But I don't know how to deploy a structure where the reactapp is inside Django's project directory disguised as a django app. How do you run the npm build on Heroku? I couldn't find any tutorials that does this, can someone help me out here? thanks!
/r/django
https://redd.it/w12hk0
reddit
Deploy react inside django as a django app on Heroku
I have worked with deploying django and react separately as separate heroku apps and integrate them. But I don't know how to deploy a structure...
nbsnapshot - Automated Jupyter Notebook Testing
​
https://preview.redd.it/hfag3h6fyl991.png?width=1201&format=png&auto=webp&s=ce07fd38ec64cdd33578d2157a7c955a82ce4b42
Hi all!
I want to share a project I've been working on to facilitate Jupyter notebook testing!
When analyzing data in a Jupyter notebook, I unconsciously memorize "rules of thumb" to determine if my results are correct. For example, I might print some summary statistics and become skeptical of some outputs if they deviate too much from what I've seen historically. For more complex analysis, I often create diagnostic plots (e.g., a histogram) and check them whenever new data arrives.
Since I constantly repeat the same process, I figured I'd code a small library to streamline this process. nbsnapshot benchmarks cell's outputs with historical results and raises an error if the output deviates from an expected range (by default, 3 standard deviations from the mean). You can see an example in the image accompanying this post.
To learn more, check out the blog post.
I'd love to hear what you think!
/r/IPython
https://redd.it/vrg1yv
​
https://preview.redd.it/hfag3h6fyl991.png?width=1201&format=png&auto=webp&s=ce07fd38ec64cdd33578d2157a7c955a82ce4b42
Hi all!
I want to share a project I've been working on to facilitate Jupyter notebook testing!
When analyzing data in a Jupyter notebook, I unconsciously memorize "rules of thumb" to determine if my results are correct. For example, I might print some summary statistics and become skeptical of some outputs if they deviate too much from what I've seen historically. For more complex analysis, I often create diagnostic plots (e.g., a histogram) and check them whenever new data arrives.
Since I constantly repeat the same process, I figured I'd code a small library to streamline this process. nbsnapshot benchmarks cell's outputs with historical results and raises an error if the output deviates from an expected range (by default, 3 standard deviations from the mean). You can see an example in the image accompanying this post.
To learn more, check out the blog post.
I'd love to hear what you think!
/r/IPython
https://redd.it/vrg1yv
Incoporating lens(df) value into groupby() function
Task 5b: Calculate percentage of people with work experience that are offered a job, the percentage of people with work experience not offered a job, the people with no work experience offered a job and the percentage of people with no work experience not offered a job.
len(df.index)
print(df.index)
output
RangeIndex(start=0, stop=120, step=1)
Tried to put the value of 120 into groupby but failed
​
dfworkexp = (df.groupby('index')['status']
.valuecounts(normalize=True)
.resetindex(name='perc'))
print (dfworkexp)
/r/IPython
https://redd.it/w3isc0
Task 5b: Calculate percentage of people with work experience that are offered a job, the percentage of people with work experience not offered a job, the people with no work experience offered a job and the percentage of people with no work experience not offered a job.
len(df.index)
print(df.index)
output
RangeIndex(start=0, stop=120, step=1)
Tried to put the value of 120 into groupby but failed
​
dfworkexp = (df.groupby('index')['status']
.valuecounts(normalize=True)
.resetindex(name='perc'))
print (dfworkexp)
/r/IPython
https://redd.it/w3isc0
reddit
Incoporating lens(df) value into groupby() function
Task 5b: Calculate percentage of people with work experience that are offered a job, the percentage of people with work experience not offered a...
Publishing charts on the web with Panel - is HvPlot relevant?
I switched a while back from Matplotlib and Seaborg to Plotly - since it's interactive and just IMHO looks better. I've been looking to implement some of my figures on my website. There is a simple way to simply export to HTML from Jupyter, but I see two limitations with this:
1) The code is very long, and sometimes crashes my browser when just pasting the code for a single figure
2) As I understand it there are limitations to the interactivity with this approach.
Due to this, I've been looking into Panel and HvPlot. There are so many modules mentioned around the docs though that I can hardly see what is relevant to my use case. It seems Plotly can be implemented directly in Panel so I'm not sure if HvPlot should be used as a medium between Plotly and Panel to enable more functions or rather as an alternative to Plotly.
If anyone has experience setting up widgets and similar, I'd be very interested in some tips here!
/r/IPython
https://redd.it/vri0lz
I switched a while back from Matplotlib and Seaborg to Plotly - since it's interactive and just IMHO looks better. I've been looking to implement some of my figures on my website. There is a simple way to simply export to HTML from Jupyter, but I see two limitations with this:
1) The code is very long, and sometimes crashes my browser when just pasting the code for a single figure
2) As I understand it there are limitations to the interactivity with this approach.
Due to this, I've been looking into Panel and HvPlot. There are so many modules mentioned around the docs though that I can hardly see what is relevant to my use case. It seems Plotly can be implemented directly in Panel so I'm not sure if HvPlot should be used as a medium between Plotly and Panel to enable more functions or rather as an alternative to Plotly.
If anyone has experience setting up widgets and similar, I'd be very interested in some tips here!
/r/IPython
https://redd.it/vri0lz
Reddit
From the IPython community on Reddit
Explore this post and more from the IPython community
Sunday Daily Thread: 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/wcb3af
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/wcb3af
reddit
Sunday Daily Thread: 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...
Plotting 3D vectors with autosized coordinate axis
I often need to visualize 3D vectors for statics problems in Jupyter Lab for which i currently use the following code using matplotlib quiver. I currently normalize the vectors to keep them within the area, but that's a huge limitation.
I'd like to have the colored coordinate axis (x,y,z) shown all the time, and have the axis scale with the plot area automatically, depending on the position and size of the plotted vectors. The plot would show the actual magnitude and direction of the vector. Can anyone help me out?
The following code produces the plot:
[Plot](https://i.stack.imgur.com/1kz8n.png)
import matplotlib.pyplot as plt
%matplotlib ipympl
# vector data. not important
roa_vek=Matrix([0,0,12])
rob_vek=Matrix([4,12,0])
rab_vek=rob_vek-roa_vek
f=2000
fab_vek=f*rab_vek/rab_vek.norm()
mo=roa_vek.cross(fab_vek)
ax=plt.figure().add_subplot(projection='3d')
# if i dont set these, the plot is all zoomed in
ax.set_xlim([-1,1])
ax.set_ylim([-1,1])
ax.set_zlim([-1,1])
ax.set_xlabel("X")
ax.set_ylabel("Y")
ax.set_zlabel("Z")
origo=[0,0,0]
ax.view_init(30, 45)
# Coordinate system
/r/IPython
https://redd.it/wfums8
I often need to visualize 3D vectors for statics problems in Jupyter Lab for which i currently use the following code using matplotlib quiver. I currently normalize the vectors to keep them within the area, but that's a huge limitation.
I'd like to have the colored coordinate axis (x,y,z) shown all the time, and have the axis scale with the plot area automatically, depending on the position and size of the plotted vectors. The plot would show the actual magnitude and direction of the vector. Can anyone help me out?
The following code produces the plot:
[Plot](https://i.stack.imgur.com/1kz8n.png)
import matplotlib.pyplot as plt
%matplotlib ipympl
# vector data. not important
roa_vek=Matrix([0,0,12])
rob_vek=Matrix([4,12,0])
rab_vek=rob_vek-roa_vek
f=2000
fab_vek=f*rab_vek/rab_vek.norm()
mo=roa_vek.cross(fab_vek)
ax=plt.figure().add_subplot(projection='3d')
# if i dont set these, the plot is all zoomed in
ax.set_xlim([-1,1])
ax.set_ylim([-1,1])
ax.set_zlim([-1,1])
ax.set_xlabel("X")
ax.set_ylabel("Y")
ax.set_zlabel("Z")
origo=[0,0,0]
ax.view_init(30, 45)
# Coordinate system
/r/IPython
https://redd.it/wfums8
Sunday Daily Thread: 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/wi1x0f
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/wi1x0f
reddit
Sunday Daily Thread: 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...
Monday Daily Thread: Project ideas!
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/wiu0so
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/wiu0so
reddit
Monday Daily Thread: Project ideas!
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with...
Text generation using my own dataset of titles/content?
I have a csv file containing article titles and article content. I'm trying to find a way to take a new title as input and use the training model to generate content. I've found a bunch of resources on how to use GPT2 or transformer pipelines to do complete sentences, etc. but I'd like to be able to provide my own data/model instead of using something from e.g. HuggingFace.
Can anyone point me in the right direction?
/r/pystats
https://redd.it/wejqfo
I have a csv file containing article titles and article content. I'm trying to find a way to take a new title as input and use the training model to generate content. I've found a bunch of resources on how to use GPT2 or transformer pipelines to do complete sentences, etc. but I'd like to be able to provide my own data/model instead of using something from e.g. HuggingFace.
Can anyone point me in the right direction?
/r/pystats
https://redd.it/wejqfo
reddit
Text generation using my own dataset of titles/content?
I have a csv file containing article titles and article content. I'm trying to find a way to take a new title as input and use the training model...
Python libraries or ideas on how you would go about solving this?
So there's this dating show where there are 12 guys and 12 girls. Each person has a "perfect pair" and they're supposed to try to find out who it is. So every trial they match up with someone and then we find out how many of those pairs are correct (but not which ones they are). Also one of the pairs is randomly chosen, and we find out if they are a pair or not.
I basically want to build a python app using that data, and show how many possible combinations there are after each trial.
I've only done one intro to stats course in college, so I don't really know where to begin. I know this is a super broad question, but can anyone give me any advice on how to start? Maybe some formulas or concepts I should look into? Thanks!
/r/pystats
https://redd.it/w9z2n5
So there's this dating show where there are 12 guys and 12 girls. Each person has a "perfect pair" and they're supposed to try to find out who it is. So every trial they match up with someone and then we find out how many of those pairs are correct (but not which ones they are). Also one of the pairs is randomly chosen, and we find out if they are a pair or not.
I basically want to build a python app using that data, and show how many possible combinations there are after each trial.
I've only done one intro to stats course in college, so I don't really know where to begin. I know this is a super broad question, but can anyone give me any advice on how to start? Maybe some formulas or concepts I should look into? Thanks!
/r/pystats
https://redd.it/w9z2n5
reddit
Python libraries or ideas on how you would go about solving this?
So there's this dating show where there are 12 guys and 12 girls. Each person has a "perfect pair" and they're supposed to try to find out who it...
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/wmzx0f
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/wmzx0f
reddit
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic? Use this thread to chat about and...
Sunday Daily Thread: 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/wnsaun
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/wnsaun
reddit
Sunday Daily Thread: 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...
Just learned how to code the game: rock,paper,scissors as a complete beginner
Hey everyone! I began learning Python from zero last week and today I finally learned how to code a rock,paper, and scissors game. This might not be a big accomplishment to some, but it’s crazy to me as a complete beginner!
/r/Python
https://redd.it/wnynqq
Hey everyone! I began learning Python from zero last week and today I finally learned how to code a rock,paper, and scissors game. This might not be a big accomplishment to some, but it’s crazy to me as a complete beginner!
/r/Python
https://redd.it/wnynqq
Reddit
r/Python on Reddit: Just learned how to code the game: rock,paper,scissors as a complete beginner
Posted by u/rcinvestments - 540 votes and 66 comments
Ploomber Convert: A free online tool to convert Jupyter notebooks to PDF
Hi, r/IPython!
We’re launching Ploomber Convert today, a web-based application that allows data scientists to convert notebooks to PDF, no setup required. We don't store notebooks or PDFs.
Ploomber convert demo
As data scientists, we have to share our work with non-technical colleagues to communicate results. To allow them to read our findings, we've used nbconvert, which enables us to export notebooks to PDF or HTML. Unfortunately, nbconvert requires Pandoc, TeX/XeLaTeX, Pyppeteer, Chromium, and other packages, whose installation is complicated. Members of our community kept asking for help to get all the packages installed so we decided to build something to fix this: Ploomber Convert provides the nbconvert functionality without installing a single package.
Ploomber Convert is built on top of AWS and runs all the necessary packages in a docker container. Since notebooks often contain sensitive information, we do not store any notebooks or PDF files.
Ploomber Convert is free to use. Go to https://convert.ploomber.io, drop your Jupyter Notebook to convert, hit ‘Convert to PDF’, and save it.
We want to make Ploomber Convert the go-to tool for data scientists to turn their notebooks into shareable reports. We’re working on adding support for Quarto, custom CSS templates, export to HTML, and other features. Let us
/r/IPython
https://redd.it/wk93py
Hi, r/IPython!
We’re launching Ploomber Convert today, a web-based application that allows data scientists to convert notebooks to PDF, no setup required. We don't store notebooks or PDFs.
Ploomber convert demo
As data scientists, we have to share our work with non-technical colleagues to communicate results. To allow them to read our findings, we've used nbconvert, which enables us to export notebooks to PDF or HTML. Unfortunately, nbconvert requires Pandoc, TeX/XeLaTeX, Pyppeteer, Chromium, and other packages, whose installation is complicated. Members of our community kept asking for help to get all the packages installed so we decided to build something to fix this: Ploomber Convert provides the nbconvert functionality without installing a single package.
Ploomber Convert is built on top of AWS and runs all the necessary packages in a docker container. Since notebooks often contain sensitive information, we do not store any notebooks or PDF files.
Ploomber Convert is free to use. Go to https://convert.ploomber.io, drop your Jupyter Notebook to convert, hit ‘Convert to PDF’, and save it.
We want to make Ploomber Convert the go-to tool for data scientists to turn their notebooks into shareable reports. We’re working on adding support for Quarto, custom CSS templates, export to HTML, and other features. Let us
/r/IPython
https://redd.it/wk93py
www.convert.ploomber.io
Notebook Converter by Ploomber
Convert your Jupyter Notebooks (IPYNB) into professional PDF and LaTeX documents. Our free online converter ensures your code, visualizations, and markdown are beautifully preserved.
Flask Boilerplate and Mini Guide to Flask
Hey guys. I made a Flask boilerplate: Flask-Backbone. It comes with SQLAlchemy, Alembic, Flask-Debug, Flask-Caching, and Sentry. Blueprints are the main concept in this boilerplate. I also incorporated Flask commands, since I use it pretty often in my projects. This way you can create custom commands both for application or for individual blueprints.
I tried to organize everything in a clean and easy-to-understand way. As with every boilerplate, it's a WIP, but I already use it for my new projects.
https://preview.redd.it/r51wqam5mhi91.jpg?width=2400&format=pjpg&auto=webp&s=2ddd3ac4be64f3bf95ac9e8f5dbcb68f4fee40bc
Boilerplate is based on Flask 2.2, so keep in mind that python 3.7 or newer is required.
You will not find any bootstrap or front-end-related stuff inside, because I wanted to keep it clean, and anyway, usually, most developers use a custom front-end stack. If you don't need database support then this boilerplate will work out for you as well.
I also wrote an article about how and why I created this boilerplate. It might be a good starting point for newbie developers or for those who are new to Flask. Don't forget to check it.
Source code: https://github.com/abstractkitchen/flask-backbone
Article: https://abstractkitchen.com/blog/flask-backbone/
Hope you'll like it.
/r/flask
https://redd.it/wrm8lo
Hey guys. I made a Flask boilerplate: Flask-Backbone. It comes with SQLAlchemy, Alembic, Flask-Debug, Flask-Caching, and Sentry. Blueprints are the main concept in this boilerplate. I also incorporated Flask commands, since I use it pretty often in my projects. This way you can create custom commands both for application or for individual blueprints.
I tried to organize everything in a clean and easy-to-understand way. As with every boilerplate, it's a WIP, but I already use it for my new projects.
https://preview.redd.it/r51wqam5mhi91.jpg?width=2400&format=pjpg&auto=webp&s=2ddd3ac4be64f3bf95ac9e8f5dbcb68f4fee40bc
Boilerplate is based on Flask 2.2, so keep in mind that python 3.7 or newer is required.
You will not find any bootstrap or front-end-related stuff inside, because I wanted to keep it clean, and anyway, usually, most developers use a custom front-end stack. If you don't need database support then this boilerplate will work out for you as well.
I also wrote an article about how and why I created this boilerplate. It might be a good starting point for newbie developers or for those who are new to Flask. Don't forget to check it.
Source code: https://github.com/abstractkitchen/flask-backbone
Article: https://abstractkitchen.com/blog/flask-backbone/
Hope you'll like it.
/r/flask
https://redd.it/wrm8lo
R is not auto-indenting in JupyterLab
I'm using R in JupyterLab. Whenever I create functions with ggplot, JupyterLab does not auto-indent my script after the '+' operator. The same holds for when I'm piping: JupyterLab does not auto-indent my script after the '%>%' operator.
What could I do to change this? Is there, perhaps, a GitHub repository out there with a catalog of user settings to make R behave more like it does in RStudio - but in JupyterLab?
Thank you!
/r/JupyterNotebooks
https://redd.it/wtnna5
I'm using R in JupyterLab. Whenever I create functions with ggplot, JupyterLab does not auto-indent my script after the '+' operator. The same holds for when I'm piping: JupyterLab does not auto-indent my script after the '%>%' operator.
What could I do to change this? Is there, perhaps, a GitHub repository out there with a catalog of user settings to make R behave more like it does in RStudio - but in JupyterLab?
Thank you!
/r/JupyterNotebooks
https://redd.it/wtnna5
reddit
R is not auto-indenting in JupyterLab
I'm using R in JupyterLab. Whenever I create functions with ggplot, JupyterLab does not auto-indent my script after the '+' operator. The same...
Sunday Daily Thread: 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/wtl976
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/wtl976
Reddit
r/Python - Sunday Daily Thread: What's everyone working on this week?
12 votes and 21 comments so far on Reddit