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
[P] I turned Stable Diffusion into a lossy image compression codec and it performs great!

After playing around with the Stable Diffusion source code a bit, I got the idea to use it for lossy image compression and it works even better than expected.
Details and colab source code here:

https://matthias-buehlmann.medium.com/stable-diffusion-based-image-compresssion-6f1f0a399202?source=friends_link&sk=a7fb68522b16d9c48143626c84172366

/r/MachineLearning
https://redd.it/xix8ef
When to use whitenoise to serve static files?

If I am using Django solely as a backend and rest APIs to connect to a javascript front end, should I still use whitenoise? My thought is no, because Django isn't rendering the html/CSS? I am a relatively new developer, so I hope this isn't a dumb question.

/r/django
https://redd.it/xiuiry
Tuesday Daily Thread: Advanced questions

Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.

If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.

This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.

/r/Python
https://redd.it/xit1rr
How to make a plot with repeating values on the x-axis and that is non-chronological in Jupyter notebook?

I want to plot a graph from sensor data that has time (in the format "hour.minute") on the x-axis and the output (an integer) on the y-axis. The problem is that the time starts at 12.10 PM, takes place over several days and ends at 5.43 PM. I want the graph to show the initial time on the very left and show the rest of the time that follows, with repeated values having their own place on the graph.

I have attached a picture to show what I want the graph to look like, as well as a picture of the Jupyter notebook plot I currently have, and a picture of the .csv file with a look at how the data is arranged, with the measurements starting from the top and ending all the way at the bottom.

/r/IPython
https://redd.it/v7zgw7
Seeking more virtual pair programming buddies for a Django language learning app

I've been developing a language learning app since January and decided to use it as an opportunity to both learn and teach through pair/group programming about two months ago. At that time, I posted here, and we now have a small group of entry to mid level developers working on the app together in both pair/group programming sessions and on our own time.

This has been a wonderful experience for me, so I want to see if others would like to join us as well.

# Details

* We do pair & group programming sessions from 9am-5pm CST (Chicago time), Wednesday - Friday and some Saturdays. Attendees are welcome to join for any portion of the sessions they want.
* We're currently focusing on writing django tests and will soon be implementing more NLP functionality with Spacy. We are also working with the Django rest framework, Google & Bing translation APIs, and we're using a lot of signals. The front end is in React with Ionic.
* The only requirement is that you know and have some experience in Python. I love teaching and can help you setup & learn Django. I'm also an English teacher from the USA: our sessions are good practice for

/r/django
https://redd.it/xjb0kq
Seeking virtual pair programming buddies for a Django language learning app

I've been developing a language learning app since January and decided to use it as an opportunity to both learn and teach through pair/group programming about two months ago. At that time, I posted here, and we now have a small group of entry to mid level developers working on the app together in both pair/group programming sessions and on our own time.

This has been a wonderful experience for me, so I want to see if others would like to join us as well.

# Details

* We do pair & group programming sessions from 9am-5pm CST (Chicago time), Wednesday - Friday and some Saturdays. Attendees are welcome to join for any portion of the sessions they want.
* We're currently focusing on writing django tests and will soon be implementing more NLP functionality with Spacy. We are also working with the Django rest framework, Google & Bing translation APIs, and we're using a lot of signals. The front end is in React with Ionic.
* The only requirement is that you know and have some experience in Python. I love teaching and can help you setup & learn Django. I'm also an English teacher from the USA: our sessions are good practice for

/r/djangolearning
https://redd.it/xjb122
Wednesday Daily Thread: Beginner questions

New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!

This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.

/r/Python
https://redd.it/xjov3k
Django cannot assign must be an instance error

Hello, so i'm trying to add the user that clicked on a button by getting his ID and his trip ID and placing it into a reservation table I have.

views.py (thanks u/drbandre !)

def nbrplaces(request, id):

object = Trip.objects.get(id=id)
object.nbrplaces -= 1
object.save()
print(
object.id)
username = request.user
reser = Reservation(user
id=username, tripid=object.id)
reser.save()
return redirect(index)


Now I get the trip ID correctly and the username as well. But I get this error:

Cannot assign "3": "Reservation.trip
id" must be a "Trip" instance.

Now I tried with name, with just trip with many things but I believe the error is somewhere in my models :l

Here's what the table SHOULD look like: https://imgur.com/a/tsirpbI

Here's what it looks like:

class User(AbstractUser):
pass

class

/r/djangolearning
https://redd.it/xjnm80
Two Scopes of Django 3.x

Anyone read this book?... Is it good...

/r/django
https://redd.it/xjvfua
OpenZiti SDK: make your app secure with embedded zero trust networking

I am happy to introduce OpenZiti Python SDK: .

It allows you to:

* embed zero trust secure networking right into your Python application

* run your Python services without any open network ports.

Powered by: https://github.com/openziti/ziti

/r/Python
https://redd.it/xk3b58
P My co-founder and I quit our engineering jobs at AWS to build “Tensor Search”. Here is why.

My co-founder and I, a senior Amazon research scientist and AWS SDE respectively, launched Marqo a little over a week ago - a "tensor search" engine https://github.com/marqo-ai/marqo

Another project doing doing semantic search/dense retrieval. Why??

Semantic search using vectors does an amazing job when we look at sentences, or short paragraphs. Vectors also do well as an implementation for image search. Unfortunately, vector representations for video, long documents and other more complex data types perform poorly.

The reason isn't really to do with embeddings themselves not being good enough. If you asked a human to find the most relevant document to some search query given a list of long documents, an important question comes to mind - do we want the document that on average is most relevant to your query or the document that has a specific sentence that is very relevant to your search query?

Furthermore, what if the document has multiple components to it? Should we match based on the title of the document? Is that important? Or is the content more important?

These questions arn't things that we can expect an AI algorithm to solve for us, they need to be encoded into each specific search experience and use case.

Introducing Tensor

/r/MachineLearning
https://redd.it/xk31n8
TLJH Managing GPU visibility ( CUDAVISIBLEDEVICES )



Hello everyone,

I just joined this community, and this is my first message here. I am a second-year student studying SE in Serbia. I've set up JupyterHub from my Ubuntu server, which runs on 8GPUS. I am looking to restrict and manage GPU resources for the users of JupyterHub.Some schemes would look like this:

\-Admin

|- user1: 2 usable GPUs

|- user2: 3 usable GPUs

|- user3: 4 usable GPUs

|- user4: 1 usable GPU

I looked through documentation from links( such as:

\-https://medium.com/rapids-ai/setting-up-gpu-data-science-environments-for-hackathons-cdb52e7781a5

\-https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda\_visible\_devices/

\-https://tljh.jupyter.org/en/latest/topic/tljh-config.html

Trust me, my first three pages of google are purple :D ), and I could not find the particular thing that is suitable for me and working. This is what I have so far, and with sudo tljh-config show:


users:
admin:
- skynet
allowed:
- good-user1
- marko
limits:
memory: 4G
marko:
CUDA
VISIBLEDEVICES: 0,1,2
https:
enabled: true
user
environment:


/r/IPython
https://redd.it/xk3bm5
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

Discussion of using Python in a professional environment, getting jobs in Python as well as ask questions about courses to further your python education!

This thread is not for recruitment, please see r/PythonJobs or the thread in the sidebar for that.

/r/Python
https://redd.it/xkldrj
Add custom entries to the JupyterLab launcher with jupyterapplauncher

Hi all, I want to present my new JupyterLab extension jupyter_app_launcher (https://github.com/trungleduc/jupyter\_app\_launcher). It is used to customize the JupyterLab launcher with a simple YAML file.

​

https://reddit.com/link/xke81n/video/rd8ukezni9p91/player

Users can add custom entries to the launcher to:

Open a predefined notebook or markdown file.
Render a notebook in dashboard mode
Open a notebook with Voila
Local/remote services like Plotly Dash or Streamlit

A live demo is available at https://mybinder.org/v2/gh/trungleduc/jupyter\_app\_launcher/main?urlpath=lab

Documentation: https://jupyter-app-launcher.readthedocs.io/

/r/JupyterNotebooks
https://redd.it/xke81n
Add custom entries to the JupyterLab launcher with jupyterapplauncher

Hi all, I want to present my new JupyterLab extension jupyter_app_launcher (https://github.com/trungleduc/jupyter\_app\_launcher). It is used to customize the JupyterLab launcher with a simple YAML file.

https://reddit.com/link/xke6q4/video/myekrzjfi9p91/player

Users can add custom entries to the launcher to:

Open a predefined notebook or markdown file.
Render a notebook in dashboard mode
Open a notebook with Voila
Local/remote services like Plotly Dash or Streamlit

A live demo is available at https://mybinder.org/v2/gh/trungleduc/jupyter\_app\_launcher/main?urlpath=lab

Documentation: https://jupyter-app-launcher.readthedocs.io/

/r/JupyterNotebooks
https://redd.it/xke6q4
OpenAI's Whisper: an open-sourced neural net "that approaches human level robustness and accuracy on English speech recognition." Can be used as a Python package or from the command line
https://openai.com/blog/whisper/

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