med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

415
active users

#python

210 posts168 participants23 posts today
datatofu<p>Functions are the primary and most important method of code organization and reuse in Python. As a rule of thumb, if you anticipate needing to repeat the same or very similar code more than once, it may be worth writing a reusable function. Functions can also help make your code more readable by giving a name to a group of Python statements.</p><p>Functions are declared with the def keyword and returned from with the return keyword. (Image 1)</p><p>Tags: <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/datascience" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>datascience</span></a></p>
Rohit Farmer, Ph.D.<p><a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> programmers, what <a href="https://fosstodon.org/tags/tariffs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>tariffs</span></a> are you paying when <a href="https://fosstodon.org/tags/importing" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>importing</span></a> a library? <a href="https://fosstodon.org/tags/Pandas" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Pandas</span></a> should face the highest. 😂</p>
Talk Python Podcast<p>The latest <span class="h-card" translate="no"><a href="https://fosstodon.org/@talkpython" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>talkpython</span></a></span> is out with Akshay Agrawal and <span class="h-card" translate="no"><a href="https://fosstodon.org/@mkennedy" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>mkennedy</span></a></span>. We're diving into reactive data science notebooks with Marimo. <a href="https://fosstodon.org/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> </p><p><a href="https://talkpython.fm/episodes/show/501/marimo-reactive-notebooks-for-python" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">talkpython.fm/episodes/show/50</span><span class="invisible">1/marimo-reactive-notebooks-for-python</span></a></p>
Python Weekly 🐍<p>Tariff: A Python package that imposes tariffs on Python imports</p><p><a href="https://pypi.org/project/tariff/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">pypi.org/project/tariff/</span><span class="invisible"></span></a></p><p>Discussions: <a href="https://discu.eu/q/https://pypi.org/project/tariff/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">discu.eu/q/https://pypi.org/pr</span><span class="invisible">oject/tariff/</span></a></p><p><a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a></p>
Python Software Foundation<p>The April edition of the PSF Grants Program Office Hour is kicking off shortly 🐍📋 9 AM EST, 1 PM UTC. Join us if you have any PSF Grant related questions! <a href="https://fosstodon.org/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a><br><a href="https://pyfound.blogspot.com/2024/02/introducing-psf-grants-office-hours.html" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">pyfound.blogspot.com/2024/02/i</span><span class="invisible">ntroducing-psf-grants-office-hours.html</span></a></p>
Yann Büchau :nixos:<p>I am really looking forward to a time when scientific data analysis is less of a constant fuckaround and fight with technical bullshit. I'd *really* like</p><p>- <a href="https://fosstodon.org/tags/netCDF" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>netCDF</span></a> natively supporting complex numbers<br>- <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> <a href="https://fosstodon.org/tags/xarray" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>xarray</span></a> and <a href="https://fosstodon.org/tags/pandas" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>pandas</span></a> to natively support physical units (<a href="https://fosstodon.org/tags/pint" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>pint</span></a> is great on its own but the integrations leave a LOT to be desired)<br>- <a href="https://fosstodon.org/tags/Jupyter" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Jupyter</span></a> notebooks to suck less (crashes, glitches, widget plots not saved statically, an effing BUILTIN formatter, etc.)<br>- proper data pipeline systems<br>...</p>
Rémi Ferrand<p>"Because foreign packages have been STEALING our CPU cycles for TOO LONG! It's time to put AMERICA FIRST and make importing FAIR and BALANCED again!" <a href="https://pypi.org/project/tariff/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">pypi.org/project/tariff/</span><span class="invisible"></span></a> 🤣 <a href="https://mastodon.gougere.fr/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a></p>
Nicola Rennie<p>The recording of my PyData Global talk about data visualisation with Plotnine in <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> is now available! 🐍</p><p>Give it a watch if you're interested in:</p><p>📊 customising plotnine plots<br>📈 combining with matplotlib functions<br>✍️ adding custom annotations with HighlightText</p><p>(or if you're an <a href="https://fosstodon.org/tags/RStats" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RStats</span></a> user wondering about Plotnine vs <a href="https://fosstodon.org/tags/ggplot2" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ggplot2</span></a>)</p><p>Link: <a href="https://www.youtube.com/watch?v=NBGJuaBF2rc" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">youtube.com/watch?v=NBGJuaBF2r</span><span class="invisible">c</span></a></p><p><a href="https://fosstodon.org/tags/DataViz" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DataViz</span></a> <a href="https://fosstodon.org/tags/Plotnine" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Plotnine</span></a></p>
Jonathan Peacher<p><a href="https://fosstodon.org/tags/PyTexas2025" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PyTexas2025</span></a> notes 📝🐍 <a href="https://fosstodon.org/tags/PyTexas" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PyTexas</span></a> <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a></p><p><a href="https://www.djpeacher.com/posts/pytexas-2025/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">djpeacher.com/posts/pytexas-20</span><span class="invisible">25/</span></a></p>
DeployHQ<p>Automate web scraping &amp; deployment! Python, ScraperAPI &amp; DeployHQ tutorial: extract data &amp; streamline workflows. No more manual entry! 🚀 </p><p><a href="https://www.deployhq.com/blog/scrape-applications-using-scraperapi-and-deployhq" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">deployhq.com/blog/scrape-appli</span><span class="invisible">cations-using-scraperapi-and-deployhq</span></a></p><p><a href="https://mastodon.social/tags/webscraping" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>webscraping</span></a> <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/automation" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>automation</span></a> <a href="https://mastodon.social/tags/scraperapi" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>scraperapi</span></a> <a href="https://mastodon.social/tags/deployhq" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>deployhq</span></a></p>
Khaled Gaiji<p>⚠️ ANNONCE ⚠️ J'ai une opportunité de fou mais incertaine. Je cherche un-e/des développeur-ses web qui pourrait améliorer le code de <span class="h-card" translate="no"><a href="https://mastodon.online/@pytition" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>pytition</span></a></span> basé sur <a href="https://framapiaf.org/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> avec un cahier des charges pour une ONG écologiste. Ça sera financé ! Et possible de le mettre dans le gitlab commun. + d'information : <a href="https://pytition.org/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">pytition.org/</span><span class="invisible"></span></a></p><p>Si quelqu'un-e est motivé-e, contactez moi en mp!</p><p>Le repouet aide à combattre Change et le capitalisme des pétitions ! ❤️✊</p><p> <a href="https://framapiaf.org/tags/petition" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>petition</span></a> <a href="https://framapiaf.org/tags/developpementweb" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>developpementweb</span></a> <a href="https://framapiaf.org/tags/informatique" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>informatique</span></a> <a href="https://framapiaf.org/tags/pytition" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>pytition</span></a></p>
stfn :raspberrypi: :python:<p><a href="https://fosstodon.org/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a></p>
Dave Pearson<p>Finally getting around to writing some actual documentation for textual-canvas: <a href="https://textual-canvas.davep.dev/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">textual-canvas.davep.dev/</span><span class="invisible"></span></a></p><p>(and also tweaking the library and tidying some things up)</p><p><a href="https://fosstodon.org/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://fosstodon.org/tags/textual" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>textual</span></a> <a href="https://fosstodon.org/tags/Terminal" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Terminal</span></a> <a href="https://fosstodon.org/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a></p>
Mike Driscoll<p><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> Pop Quiz 🐍❓</p><p>Find the top 3 letter counts in the following string using Python:</p><p>Use any Python module you want to, but extra points for using the standard library!</p>
ax6761<p><span class="h-card" translate="no"><a href="https://anticapitalist.party/@thezerobit" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>thezerobit</span></a></span> I find myself sometimes in similar situation with "map" &amp; "generator" objects …</p><p>mapped = map( lambda x:x, [] )<br>if mapped:<br> print( 'map value is ok')<br>else:<br> print( 'map value is bad')</p><p>def make(): yield None</p><p>print( 'iter value is',<br> 'ok' if make() else 'bad'<br> )</p><p># Printed …<br># map value is ok<br># iter value is ok</p><p>… need to materialize them to have the intended test to work.</p><p>Ought to break the <a href="https://freeradical.zone/tags/badHabit" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>badHabit</span></a> of testing plainer objects ("list", "set", "dict") as is.</p><p><a href="https://freeradical.zone/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a></p>
Python Weekly 🐍<p>Python is an interpreted language with a compiler</p><p><a href="https://ntietz.com/blog/python-is-an-interpreted-language-with-a-compiler/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">ntietz.com/blog/python-is-an-i</span><span class="invisible">nterpreted-language-with-a-compiler/</span></a></p><p>Discussions: <a href="https://discu.eu/q/https://ntietz.com/blog/python-is-an-interpreted-language-with-a-compiler/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">discu.eu/q/https://ntietz.com/</span><span class="invisible">blog/python-is-an-interpreted-language-with-a-compiler/</span></a></p><p><a href="https://mastodon.social/tags/compsci" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>compsci</span></a> <a href="https://mastodon.social/tags/plt" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>plt</span></a> <a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a></p>
CX-7<p>when Python isn’t just a programming language anymore</p><p><a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a> <a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://mastodon.social/tags/meme" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>meme</span></a> <a href="https://mastodon.social/tags/funny" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>funny</span></a></p>
António Domingues<p>Mastodon hivemind, does anyone know of a good example/dataset with Design of Experiments (<a href="https://genomic.social/tags/DOE" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DOE</span></a>) for systems /experimental biology? </p><p>I want to get into DoE but most examples I see come from chemistry and I would prefer examples closer to my domain expertise :)</p><p><a href="https://genomic.social/tags/RStats" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RStats</span></a> <a href="https://genomic.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://genomic.social/tags/datascience" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>datascience</span></a> <a href="https://genomic.social/tags/systemsbiology" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>systemsbiology</span></a></p>
Python Weekly 🐍<p>Just built a tiny web browser with Python</p><p><a href="https://github.com/Nicolasf1109-GitHub/CompactBrowser" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/Nicolasf1109-GitHub</span><span class="invisible">/CompactBrowser</span></a></p><p>Discussions: <a href="https://discu.eu/q/https://github.com/Nicolasf1109-GitHub/CompactBrowser" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">discu.eu/q/https://github.com/</span><span class="invisible">Nicolasf1109-GitHub/CompactBrowser</span></a></p><p><a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/software" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>software</span></a></p>
thezerobit<p>A quick <a href="https://anticapitalist.party/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> example of why you should only evaluate boolean expressions in a boolean context: </p><p>Since an empty list evaluates to `False`, people like to write code like this:</p><p>async def get_things() -&gt; list[Thing]:<br> ...</p><p>things = get_things()<br>if things:<br> ...</p><p>The above code will happily type check even though it is severely bugged. If you are properly explicit about the condition, the type checker will alert you to the error:</p><p>things = get_things()<br>if len(things) &gt; 0:<br> ...</p>