IPython terminal would display a string with \n in the same line, how to change this behavior?
given a snippet in IPython terminal
s = 'AAA\nBBB'
s
it would give
I have to call
AAA
BBB
Is there some config to make IPython's display to show the \n in a string as linebreak?
/r/IPython
https://redd.it/y6ce9p
given a snippet in IPython terminal
s = 'AAA\nBBB'
s
it would give
'AAA\nBBB' as output.I have to call
print(s) to get AAA
BBB
Is there some config to make IPython's display to show the \n in a string as linebreak?
/r/IPython
https://redd.it/y6ce9p
reddit
IPython terminal would display a string with \n in the same line,...
given a snippet in IPython terminal s = 'AAA\nBBB' s it would give `'AAA\nBBB'` as output. I have to call `print(s)` to get ...
P Awesome Image Segmentation Project Based on Deep Learning (5.6k star)
Hi, I'd like to introduce PaddleSeg, which provides the ability of designing, training and deploying segmentation models.
This might be some help to you. Hope you enjoy it.
Code and docs: https://github.com/PaddlePaddle/PaddleSeg
Features Set:
Support several tasks: Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image Matting, etc.
Provide 40+ state-of-art semantic segmentation models and 140+ high-quality pre-training models
Provide efficient interactive segmentation tool (EISeg) for annotating segmentation images
Release a variety of human matting and portrait segmentation models for practical application without training
Support 3D medical image segmentation
etc
https://i.redd.it/pi0pjee2ncu91.gif
https://i.redd.it/7cuiqre3ncu91.gif
/r/MachineLearning
https://redd.it/y68dzn
Hi, I'd like to introduce PaddleSeg, which provides the ability of designing, training and deploying segmentation models.
This might be some help to you. Hope you enjoy it.
Code and docs: https://github.com/PaddlePaddle/PaddleSeg
Features Set:
Support several tasks: Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image Matting, etc.
Provide 40+ state-of-art semantic segmentation models and 140+ high-quality pre-training models
Provide efficient interactive segmentation tool (EISeg) for annotating segmentation images
Release a variety of human matting and portrait segmentation models for practical application without training
Support 3D medical image segmentation
etc
https://i.redd.it/pi0pjee2ncu91.gif
https://i.redd.it/7cuiqre3ncu91.gif
/r/MachineLearning
https://redd.it/y68dzn
GitHub
GitHub - PaddlePaddle/PaddleSeg: Easy-to-use image segmentation library with awesome pre-trained model zoo, supporting wide-range…
Easy-to-use image segmentation library with awesome pre-trained model zoo, supporting wide-range of practical tasks in Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image ...
Jupyter Notebooks on EC2 Windows Instance
I have googled this for a good hour now and can't find any mention of running Jupyter Notebooks on an EC2 Windows Instance - specifically running Jupyter after remote-ing into the machine.
1 - Is this possible?
2a - If not - why not?
2a - If not - what is an alternative notebook that will work on an EC2 Windows Instance?
3 - If so, any one know of a guide to get it up and running somewhere?
Thanks in Advance.
/r/JupyterNotebooks
https://redd.it/vn4ajp
I have googled this for a good hour now and can't find any mention of running Jupyter Notebooks on an EC2 Windows Instance - specifically running Jupyter after remote-ing into the machine.
1 - Is this possible?
2a - If not - why not?
2a - If not - what is an alternative notebook that will work on an EC2 Windows Instance?
3 - If so, any one know of a guide to get it up and running somewhere?
Thanks in Advance.
/r/JupyterNotebooks
https://redd.it/vn4ajp
reddit
Jupyter Notebooks on EC2 Windows Instance
I have googled this for a good hour now and can't find any mention of running Jupyter Notebooks on an EC2 Windows Instance - specifically running...
Auto import for VSCode
How to make possible auto imports from Django Rest Framework in VSCode.
I have Pylance extension but it doesn't work
/r/django
https://redd.it/y6gsic
How to make possible auto imports from Django Rest Framework in VSCode.
I have Pylance extension but it doesn't work
/r/django
https://redd.it/y6gsic
reddit
Auto import for VSCode
How to make possible auto imports from Django Rest Framework in VSCode. I have Pylance extension but it doesn't work
Text Corpus Tagging System
I have a feature idea for an app I'm helping develop, and I'm wondering if it makes sense before I go too deep down the rabbit hole.
I want to find a way for a front-end user to edit a large text document and add a custom ID tag to a certain section of text of arbitrary length. My initial idea is to store the text as HTML and use a WYSIWYG editor with most of the functionality disabled, and just leave the ability to highlight a range of text and choose an ID attribute from a pre-defined list to add to a <span> tag or something like that. Would that work? If so, any recommendations on a WYSIWYG editor that would work well with this? Or is there a better way to accomplish this?
/r/django
https://redd.it/y6q5bd
I have a feature idea for an app I'm helping develop, and I'm wondering if it makes sense before I go too deep down the rabbit hole.
I want to find a way for a front-end user to edit a large text document and add a custom ID tag to a certain section of text of arbitrary length. My initial idea is to store the text as HTML and use a WYSIWYG editor with most of the functionality disabled, and just leave the ability to highlight a range of text and choose an ID attribute from a pre-defined list to add to a <span> tag or something like that. Would that work? If so, any recommendations on a WYSIWYG editor that would work well with this? Or is there a better way to accomplish this?
/r/django
https://redd.it/y6q5bd
reddit
Text Corpus Tagging System
I have a feature idea for an app I'm helping develop, and I'm wondering if it makes sense before I go too deep down the rabbit hole. I want to...
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/y6qyo5
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/y6qyo5
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
SSL certificate
My django app on an EC2 instance works fine with http://IP.address. I also used Route 53 to link up with a domain and now http://domain.com works
But why does https://domain.com not work? The domain had been previously linked with an SSL certificate. HTTPS is allowed on my EC2s security group. Do I need another SSL ?
/r/django
https://redd.it/y6xanb
My django app on an EC2 instance works fine with http://IP.address. I also used Route 53 to link up with a domain and now http://domain.com works
But why does https://domain.com not work? The domain had been previously linked with an SSL certificate. HTTPS is allowed on my EC2s security group. Do I need another SSL ?
/r/django
https://redd.it/y6xanb
PYTHON CHARTS: the Python data visualization site with more than 500 different charts with reproducible code and color tools
Link: https://python-charts.com/
Link (spanish version): https://python-charts.com/es/
This site provides tutorials divided into chart types and graphic libraries:
https://preview.redd.it/6yk59rxp8eu91.png?width=748&format=png&auto=webp&s=0581694dcacd8d7e9e7909b2c13dd0b76f7bd64c
​
The graphs can be filtered based on the library or chart type:
​
https://preview.redd.it/dyo2btgz8eu91.png?width=1058&format=png&auto=webp&s=a22b43408411950c2351367a96e871279f368acc
​
Each post contains detailed instructions about how to create and customize each chart. All the examples provide reproducible code and can be copied with a single click:
https://preview.redd.it/d681tn319eu91.png?width=1553&format=png&auto=webp&s=05fd21d7a896082753c55cec461df67460ee07fb
​
The site also provides a color tool which allows copying the named, colors or its HEX reference:
​
https://preview.redd.it/ptwelwb99eu91.png?width=1299&format=png&auto=webp&s=54bc17e012790a55d62604f1d8a5fcb6565ab381
There is also a quick search feature which allows looking for charts:
​
https://preview.redd.it/gpoz93wd9eu91.png?width=1013&format=png&auto=webp&s=fa3af72c6b2ef43444278e74032a0ebae3d9c143
Hope you like it!
/r/Python
https://redd.it/y6fumv
Link: https://python-charts.com/
Link (spanish version): https://python-charts.com/es/
This site provides tutorials divided into chart types and graphic libraries:
https://preview.redd.it/6yk59rxp8eu91.png?width=748&format=png&auto=webp&s=0581694dcacd8d7e9e7909b2c13dd0b76f7bd64c
​
The graphs can be filtered based on the library or chart type:
​
https://preview.redd.it/dyo2btgz8eu91.png?width=1058&format=png&auto=webp&s=a22b43408411950c2351367a96e871279f368acc
​
Each post contains detailed instructions about how to create and customize each chart. All the examples provide reproducible code and can be copied with a single click:
https://preview.redd.it/d681tn319eu91.png?width=1553&format=png&auto=webp&s=05fd21d7a896082753c55cec461df67460ee07fb
​
The site also provides a color tool which allows copying the named, colors or its HEX reference:
​
https://preview.redd.it/ptwelwb99eu91.png?width=1299&format=png&auto=webp&s=54bc17e012790a55d62604f1d8a5fcb6565ab381
There is also a quick search feature which allows looking for charts:
​
https://preview.redd.it/gpoz93wd9eu91.png?width=1013&format=png&auto=webp&s=fa3af72c6b2ef43444278e74032a0ebae3d9c143
Hope you like it!
/r/Python
https://redd.it/y6fumv
PYTHON CHARTS
PYTHON CHARTS | The definitive Python data visualization site
Learn data visualization in Python with PYTHON CHARTS! Create beautiful graphs step-by-step with matplotlib, seaborn and plotly with examples
Why is X not defined?
import numpy as np
​
a = float(input("oppgi nedre grense, a, på intervallet:"))
b = float(input("oppgi øvre grense, b, på intervallet"))
n = int(input("oppgi ønsket antall partisjoner (delintervaller) (Husk partall):"))
ant_des = int(input("oppgi ønsket antall desimalet i svaret:"))
​
h = (b-a)/n
​
\#simpsons metode
x_vektor = np.linspace (a,b,n+1)
y_vektor = 1/ 1 + x**6
​
vekt = np.ones(len(x_vektor))
for i in range (1,n):
if i % 2 == 0:
vekt [i\] = 2
else:
vekt [i\] = 4
​
print ("Komponenten vektes etter flg system", vekt)
​
skalarprodukt = y_vektor * vekt
Sum= skalarprodukt * h/3
print (round(sum,ant_des))
​
I dont understand why this code dosent work. its a code thats suppose to give you the numbers to simpsons methode in math
/r/JupyterNotebooks
https://redd.it/y77txv
import numpy as np
​
a = float(input("oppgi nedre grense, a, på intervallet:"))
b = float(input("oppgi øvre grense, b, på intervallet"))
n = int(input("oppgi ønsket antall partisjoner (delintervaller) (Husk partall):"))
ant_des = int(input("oppgi ønsket antall desimalet i svaret:"))
​
h = (b-a)/n
​
\#simpsons metode
x_vektor = np.linspace (a,b,n+1)
y_vektor = 1/ 1 + x**6
​
vekt = np.ones(len(x_vektor))
for i in range (1,n):
if i % 2 == 0:
vekt [i\] = 2
else:
vekt [i\] = 4
​
print ("Komponenten vektes etter flg system", vekt)
​
skalarprodukt = y_vektor * vekt
Sum= skalarprodukt * h/3
print (round(sum,ant_des))
​
I dont understand why this code dosent work. its a code thats suppose to give you the numbers to simpsons methode in math
/r/JupyterNotebooks
https://redd.it/y77txv
reddit
Why is X not defined?
import numpy as np a = float(input("oppgi nedre grense, a, på intervallet:")) b = float(input("oppgi øvre grense, b, på...
seaborn v0.12.1 released
https://github.com/mwaskom/seaborn/releases/tag/v0.12.1
/r/Python
https://redd.it/y76oxi
https://github.com/mwaskom/seaborn/releases/tag/v0.12.1
/r/Python
https://redd.it/y76oxi
GitHub
Release v0.12.1 · mwaskom/seaborn
This is an incremental release that is a recommended upgrade for all
users. It addresses a handful of bugs / regressions in v0.12.0 and adds
several features and enhancements to the new objects int...
users. It addresses a handful of bugs / regressions in v0.12.0 and adds
several features and enhancements to the new objects int...
Functional Programming Principles You Can Use in Python
https://elbear.com/functional-programming-principles-you-can-use-in-python.html
/r/Python
https://redd.it/y786ch
https://elbear.com/functional-programming-principles-you-can-use-in-python.html
/r/Python
https://redd.it/y786ch
reddit
Functional Programming Principles You Can Use in Python
Posted in r/Python by u/LucianU • 43 points and 9 comments
Automated PDF Reports with Python Notebooks
https://mljar.com/blog/automated-reports-python/
/r/JupyterNotebooks
https://redd.it/vmjhzg
https://mljar.com/blog/automated-reports-python/
/r/JupyterNotebooks
https://redd.it/vmjhzg
MLJAR
Automated PDF Reports with Python
Explore building an automated reporting system in Python using Jupyter Notebook and the Mercury framework. Fetch stock market data, display news, price chart, and analysis. Schedule daily execution, convert the notebook to PDF, and send it via email.
Real life examples of complex applications
Are there some good examples of real applications (not hello world todo/blog post or tutorials) of Flask applications, from where a new flask user could learn best practices from?
Flask doesn't force any design patterns or specific ways to do anything on me, and that leaves me wondering about what are the best ways to do something. How do I split up the routes file from all-routes-in-a-file.py to something more manageable, how do I validate input requests coming from a JS front-end, what are the best practices for doing thing X and Y, that I haven't even thought about yet.
Background information: I am writing a back-end api for a Vue frontend, there are no templates in the flask app, I am using JWT for authentication already. I think I don't need blueprints, because I don't have any templates to separate from the other things. I just don't want to bunch all my routes together in a huge file, like.. all the examples on the internet do.
I have found some open-source flask examples, but they seemed to be doing something weird, or.. were really outdated.
Or should I just write my back-end in Java and Spring, since that is used at work,
/r/flask
https://redd.it/y7hkgo
Are there some good examples of real applications (not hello world todo/blog post or tutorials) of Flask applications, from where a new flask user could learn best practices from?
Flask doesn't force any design patterns or specific ways to do anything on me, and that leaves me wondering about what are the best ways to do something. How do I split up the routes file from all-routes-in-a-file.py to something more manageable, how do I validate input requests coming from a JS front-end, what are the best practices for doing thing X and Y, that I haven't even thought about yet.
Background information: I am writing a back-end api for a Vue frontend, there are no templates in the flask app, I am using JWT for authentication already. I think I don't need blueprints, because I don't have any templates to separate from the other things. I just don't want to bunch all my routes together in a huge file, like.. all the examples on the internet do.
I have found some open-source flask examples, but they seemed to be doing something weird, or.. were really outdated.
Or should I just write my back-end in Java and Spring, since that is used at work,
/r/flask
https://redd.it/y7hkgo
Can i host my django app under 10$?
So i am trying to create a project for my portfolio and it will be a simple blog application and i want to know if i will be able to host it under 10$ a month if only me and maybe 5-10 of my friends will visit it(not daily maybe once or twice a week).
English is not my first language so sorry if i did not express my thoughts clearly.
/r/django
https://redd.it/y7lmtd
So i am trying to create a project for my portfolio and it will be a simple blog application and i want to know if i will be able to host it under 10$ a month if only me and maybe 5-10 of my friends will visit it(not daily maybe once or twice a week).
English is not my first language so sorry if i did not express my thoughts clearly.
/r/django
https://redd.it/y7lmtd
reddit
Can i host my django app under 10$?
So i am trying to create a project for my portfolio and it will be a simple blog application and i want to know if i will be able to host it under...
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/y7n3gz
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/y7n3gz
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
Django + async: delete from DB
Django version 4.1.2
I just used the following code snippet:
This fails with: "AttributeError: 'mymodel' object has no attribute 'adelete'
But this does work though:
Any fix for this?
/r/django
https://redd.it/y7w5dm
Django version 4.1.2
I just used the following code snippet:
r = await mymodel.objects.aget(some_name=myname)
await r.adelete()
This fails with: "AttributeError: 'mymodel' object has no attribute 'adelete'
But this does work though:
r = await mymodel.objects.aget(some_name=myname)
await sync_to_async(r.delete)()
Any fix for this?
/r/django
https://redd.it/y7w5dm
reddit
Django + async: delete from DB
Django version 4.1.2 I just used the following code snippet: ``` r = await mymodel.objects.aget(some_name=myname) await r.adelete() ``` This...
Call for questions for Guido van Rossum from Lex Fridman
Hi, my name is Lex Fridman. I host a podcast and I've previously interviewed Guido van Rossum (4 years ago). I'm talking to him again soon and would like to hear if you have questions/topic suggestions, including technical and philosophical ones, on Python or programming in general.
/r/Python
https://redd.it/y7q4gv
Hi, my name is Lex Fridman. I host a podcast and I've previously interviewed Guido van Rossum (4 years ago). I'm talking to him again soon and would like to hear if you have questions/topic suggestions, including technical and philosophical ones, on Python or programming in general.
/r/Python
https://redd.it/y7q4gv
Youtube
- YouTube
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
django creating new record when update existing record
this is a strange issue, and cant trace it.whenver i am updating a field in my existing record django creats another new record with updated value. what could be the reason?below is my edit view
@cachecontrol(nocache=True, mustrevalidate=True,nostore=True)
@loginrequired(loginurl="login")
def edittonerdetailssave(request):
if request.method == "POST":
tonerdetailsid = request.POST.get("tonerdetailsid")
employeename = request.POST.get("employeename")
employeedesignation = request.POST.get("employeedesignation")
status = request.POST.get("status")
# issuedtoid = request.POST.get("issuedto")
# issuedto = Prosecutions.objects.get(id=issuedtoid)
tonermodelid = request.POST.get("tonermodel")
tonermodel = Toners.objects.get(id=tonermodelid)
/r/django
https://redd.it/y86jjd
this is a strange issue, and cant trace it.whenver i am updating a field in my existing record django creats another new record with updated value. what could be the reason?below is my edit view
@cachecontrol(nocache=True, mustrevalidate=True,nostore=True)
@loginrequired(loginurl="login")
def edittonerdetailssave(request):
if request.method == "POST":
tonerdetailsid = request.POST.get("tonerdetailsid")
employeename = request.POST.get("employeename")
employeedesignation = request.POST.get("employeedesignation")
status = request.POST.get("status")
# issuedtoid = request.POST.get("issuedto")
# issuedto = Prosecutions.objects.get(id=issuedtoid)
tonermodelid = request.POST.get("tonermodel")
tonermodel = Toners.objects.get(id=tonermodelid)
/r/django
https://redd.it/y86jjd
reddit
django creating new record when update existing record
this is a strange issue, and cant trace it.whenver i am updating a field in my existing record django creats another new record with updated...
Choosing between options for presenting Plotly figures on a website (Python/Jupyter)
I'm looking to share some of my charts (Plotly) (on a Github webpage first and later on, on a personal website - not the notebooks, but the charts by themselves. I have spent a lot of time and found it surprisingly difficult to get started, and would very much like some input.
The options that I see would be the most relevant are:
1. Export from Jupyter Notebooks/labs to HTML - limited interactivity?
2. Dash
3. Panel/HvPlot
I have started out following a YouTube tutorial on option 3. This didn't present a way to actually show the plots on a website. For this option, the order of operations seems to be:
Python/Pandas -> Make plotly figures and interactive dataframes -> use HvPlot -> Use Panel (or similar) -> host this in Heroku/MyBinder/similar.
Am I on the right track here?
/r/JupyterNotebooks
https://redd.it/vlohr8
I'm looking to share some of my charts (Plotly) (on a Github webpage first and later on, on a personal website - not the notebooks, but the charts by themselves. I have spent a lot of time and found it surprisingly difficult to get started, and would very much like some input.
The options that I see would be the most relevant are:
1. Export from Jupyter Notebooks/labs to HTML - limited interactivity?
2. Dash
3. Panel/HvPlot
I have started out following a YouTube tutorial on option 3. This didn't present a way to actually show the plots on a website. For this option, the order of operations seems to be:
Python/Pandas -> Make plotly figures and interactive dataframes -> use HvPlot -> Use Panel (or similar) -> host this in Heroku/MyBinder/similar.
Am I on the right track here?
/r/JupyterNotebooks
https://redd.it/vlohr8
reddit
Choosing between options for presenting Plotly figures on a...
I'm looking to share some of my charts (Plotly) (on a Github webpage first and later on, on a personal website - not the notebooks, but the charts...
django creating new record when update existing record
this is a strange issue, and cant trace it.whenver i am updating a field in my existing record django creats another new record with updated value. what could be the reason?below is my edit view
@cachecontrol(nocache=True, mustrevalidate=True,nostore=True)
@loginrequired(loginurl="login")
def edittonerdetailssave(request):
if request.method == "POST":
tonerdetailsid = request.POST.get("tonerdetailsid")
employeename = request.POST.get("employeename")
employeedesignation = request.POST.get("employeedesignation")
status = request.POST.get("status")
# issuedtoid = request.POST.get("issuedto")
# issuedto = Prosecutions.objects.get(id=issuedtoid)
tonermodelid = request.POST.get("tonermodel")
tonermodel = Toners.objects.get(id=tonermodelid)
/r/djangolearning
https://redd.it/y86gkt
this is a strange issue, and cant trace it.whenver i am updating a field in my existing record django creats another new record with updated value. what could be the reason?below is my edit view
@cachecontrol(nocache=True, mustrevalidate=True,nostore=True)
@loginrequired(loginurl="login")
def edittonerdetailssave(request):
if request.method == "POST":
tonerdetailsid = request.POST.get("tonerdetailsid")
employeename = request.POST.get("employeename")
employeedesignation = request.POST.get("employeedesignation")
status = request.POST.get("status")
# issuedtoid = request.POST.get("issuedto")
# issuedto = Prosecutions.objects.get(id=issuedtoid)
tonermodelid = request.POST.get("tonermodel")
tonermodel = Toners.objects.get(id=tonermodelid)
/r/djangolearning
https://redd.it/y86gkt
reddit
django creating new record when update existing record
this is a strange issue, and cant trace it.whenver i am updating a field in my existing record django creats another new record with updated...