FLOSS Project Planets

Talk Python to Me: #392: Data Science from the Command Line

Planet Python - Fri, 2022-12-02 03:00
When you think data science, Jupyter notebooks and associated tools probably come to mind. But I want to broaden your toolset a bit and encourage you to look around at other tools that are literally at your fingertips. The terminal and shell command line tools. <br/> <br/> On this episode, you'll meed Jeroen Janssens. He wrote the book Data Science on The Command Line Book and there are a bunch of fun and useful small utilities that will make your life simpler that you can run immediately in the terminal. For example, you can query a CSV file with SQL right from the command line.<br/> <br/> <strong>Links from the show</strong><br/> <br/> <div><b>Jeroen's Website</b>: <a href="https://jeroenjanssens.com" target="_blank" rel="noopener">jeroenjanssens.com</a><br/> <b>Jeroen on LinkedIn</b>: <a href="https://www.linkedin.com/in/jeroenjanssens" target="_blank" rel="noopener">linkedin.com</a><br/> <b>Jeroen cohort-based course, Embrace the Command Line. Listeners can use coupon code TALKPYTHON20 for a 20% discount</b>: <a href="https://maven.com/data-science-workshops/embrace-the-command-line" target="_blank" rel="noopener">maven.com</a><br/> <br/> <b>Data Science on The Command Line Book</b>: <a href="https://datascienceatthecommandline.com/2e/index.html" target="_blank" rel="noopener">datascienceatthecommandline.com</a><br/> <b>McFly Shell History Tool</b>: <a href="https://github.com/cantino/mcfly" target="_blank" rel="noopener">github.com</a><br/> <b>Explain Shell</b>: <a href="https://explainshell.com" target="_blank" rel="noopener">explainshell.com</a><br/> <b>CSVKit</b>: <a href="https://csvkit.readthedocs.io/en/latest/index.html" target="_blank" rel="noopener">csvkit.readthedocs.io</a><br/> <b>sql2csv</b>: <a href="https://csvkit.readthedocs.io/en/latest/scripts/sql2csv.html" target="_blank" rel="noopener">csvkit.readthedocs.io</a><br/> <b>pipx</b>: <a href="https://github.com/pypa/pipx" target="_blank" rel="noopener">github.com</a><br/> <b>PyProject.toml to add entry points</b>: <a href="https://github.com/mikeckennedy/twitter-archive-parser/blob/installable/pyproject.toml" target="_blank" rel="noopener">github.com</a><br/> <b>rich-cli</b>: <a href="https://github.com/Textualize/rich-cli" target="_blank" rel="noopener">github.com</a><br/> <b>Typer</b>: <a href="https://typer.tiangolo.com/typer-cli/" target="_blank" rel="noopener">typer.tiangolo.com</a><br/> <b>FasD</b>: <a href="https://github.com/clvv/fasd" target="_blank" rel="noopener">github.com</a><br/> <b>Nerd Fonts</b>: <a href="https://www.nerdfonts.com/font-downloads" target="_blank" rel="noopener">nerdfonts.com</a><br/> <b>Xonsh</b>: <a href="https://xon.sh" target="_blank" rel="noopener">xon.sh</a><br/> <b>iTerm</b>: <a href="https://iterm2.com" target="_blank" rel="noopener">iterm2.com</a><br/> <b>Windows Terminal</b>: <a href="https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-us&gl=us" target="_blank" rel="noopener">microsoft.com</a><br/> <b>ohmyposh</b>: <a href="https://ohmyposh.dev" target="_blank" rel="noopener">ohmyposh.dev</a><br/> <b>ohmyz</b>: <a href="https://ohmyz.sh" target="_blank" rel="noopener">ohmyz.sh</a><br/> <b>Watch this episode on YouTube</b>: <a href="https://www.youtube.com/watch?v=wNJ3tTPkuzY" target="_blank" rel="noopener">youtube.com</a><br/> <b>Episode transcripts</b>: <a href="https://talkpython.fm/episodes/transcript/392/data-science-from-the-command-line" target="_blank" rel="noopener">talkpython.fm</a><br/> <br/> <b>--- Stay in touch with us ---</b><br/> <b>Subscribe to us on YouTube</b>: <a href="https://talkpython.fm/youtube" target="_blank" rel="noopener">youtube.com</a><br/> <b>Follow Talk Python on Mastodon</b>: <a href="https://fosstodon.org/web/@talkpython" target="_blank" rel="noopener"><i class="fa-brands fa-mastodon"></i>talkpython</a><br/> <b>Follow Michael on Mastodon</b>: <a href="https://fosstodon.org/web/@mkennedy" target="_blank" rel="noopener"><i class="fa-brands fa-mastodon"></i>mkennedy</a><br/></div><br/> <strong>Sponsors</strong><br/> <a href='https://talkpython.fm/sentry'>Sentry Error Monitoring, Code TALKPYTHON</a><br> <a href='https://talkpython.fm/foundershub'>Microsoft</a><br> <a href='https://talkpython.fm/assemblyai'>AssemblyAI</a><br> <a href='https://talkpython.fm/training'>Talk Python Training</a>
Categories: FLOSS Project Planets

John Ludhi/nbshare.io: Understand Tensors With Numpy

Planet Python - Fri, 2022-12-02 02:39
Understand Tensors With Numpy

In this notebook, I will explain tensors with Python Numpy. For numpy refresher please checkout following resource...
https://www.nbshare.io/notebook/692176011/Numpy-Basics/

In [1]: import numpy as np

Before we delve in to tensors. We need to understand first what is Scalars, Vectors, Arrays and Matrices.

Scalar - Scalar is just a number. Example number 55 is a scalar. Scalar has no dimensions.
Vector - Vector is one dimensional array or scalar with orientation (i.e. horizontal or vertical). Vector can be 1,2 or n dimensional.
Array - Array is a computer language term used in data structures. Array is a collection of similar data elements.
Matrix - Matrix is a mathematical term. It is a 2D array of numbers represented in rows and columns.

What is Vector

Example of 3 dimensional Vector is shown below.

In [2]: threeDVector = np.array([1,2,3]) In [3]: threeDVector Out[3]: array([1, 2, 3]) In [4]: threeDVector.shape Out[4]: (3,) What is Matrix

Matrix is 2 dimensional array.

In [5]: np.array([[1,2,3],[4,5,6]]) Out[5]: array([[1, 2, 3], [4, 5, 6]]) What is Tensor

Tensor is a mathematical object with more than two dimensions. The number of dimensions of an array defines the order of a Tensor. For example a scalar is 0 order tensor. Similarly vector is a 1 order tensor. A 2D matrix is 2nd order Tensor so on and so forth.

Below is an example of vector which is 1 order tensor.

In [6]: np.array([1,2,3]) Out[6]: array([1, 2, 3])

Let us define a two dimensional tensor.

In [7]: twodTensor = np.arange(36).reshape(6,6) In [8]: twodTensor Out[8]: array([[ 0, 1, 2, 3, 4, 5], [ 6, 7, 8, 9, 10, 11], [12, 13, 14, 15, 16, 17], [18, 19, 20, 21, 22, 23], [24, 25, 26, 27, 28, 29], [30, 31, 32, 33, 34, 35]])

Let us access the ist row of above tensor

In [9]: twodTensor[0] Out[9]: array([0, 1, 2, 3, 4, 5]) In [10]: twodTensor.shape Out[10]: (6, 6)

Three dimensional Tensor example is shown below...

In [11]: threedTensor = np.arange(36).reshape(4,3,3) In [12]: threedTensor Out[12]: array([[[ 0, 1, 2], [ 3, 4, 5], [ 6, 7, 8]], [[ 9, 10, 11], [12, 13, 14], [15, 16, 17]], [[18, 19, 20], [21, 22, 23], [24, 25, 26]], [[27, 28, 29], [30, 31, 32], [33, 34, 35]]])

Note the 3 enclosing brackets - array[[[]]] which indicates it is 3 dimensional tensor.

Add new dimension or axis to a tensor. In [13]: t3t = np.arange(36).reshape(4,3,3)

Let us make our 3 dimension tensor to a 4 dimension tensor.

In [14]: t4t = t3t[np.newaxis,:,:]

Note the 4 enclosing brackets in the below array.

In [15]: t4t Out[15]: array([[[[ 0, 1, 2], [ 3, 4, 5], [ 6, 7, 8]], [[ 9, 10, 11], [12, 13, 14], [15, 16, 17]], [[18, 19, 20], [21, 22, 23], [24, 25, 26]], [[27, 28, 29], [30, 31, 32], [33, 34, 35]]]])

Note our 4th dimension has only 1 element (the 3x3 array). Let us see that using tensor.shape

In [16]: t4t.shape Out[16]: (1, 4, 3, 3) In [17]: t4t[0] #4th dimension Out[17]: array([[[ 0, 1, 2], [ 3, 4, 5], [ 6, 7, 8]], [[ 9, 10, 11], [12, 13, 14], [15, 16, 17]], [[18, 19, 20], [21, 22, 23], [24, 25, 26]], [[27, 28, 29], [30, 31, 32], [33, 34, 35]]]) Arithmetic with Tensors

Tensors Arithemetic is mathematical operations on vector and matrix.

Example - Find the dot product of two 3 dimensional vectors, we can use np.dot

In [18]: array1 = np.array([4,4,3]) array2 = np.array([2,2,3]) In [19]: array1.shape Out[19]: (3,) In [20]: array2.shape Out[20]: (3,) In [21]: np.dot(array1,array2) Out[21]: 25

Dot product two matrix is shown below.

In [22]: array1 = np.array([[1,2,3],[4,4,3]]) array2 = np.array([[2,2,3],[1,2,3]]) In [23]: print(array1) print("\n") print(array2) [[1 2 3] [4 4 3]] [[2 2 3] [1 2 3]] In [24]: np.dot(array1,array2) #this will throw error because row of first matrix is not equal to column of second matrix - Refer matrix multiplication fundamentals --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Input In [24], in <cell line: 1>() ----> 1 np.dot(array1,array2) File <__array_function__ internals>:180, in dot(*args, **kwargs) ValueError: shapes (2,3) and (2,3) not aligned: 3 (dim 1) != 2 (dim 0) In [25]: array1 = np.array([[1,2,3],[4,4,3],[1,1,1]]) array2 = np.array([[2,2,3],[1,2,3],[1,2,3]])

Dot product for above matrices will work because both the arrays are 3x3 matrices.

In [26]: np.dot(array1,array2) Out[26]: array([[ 7, 12, 18], [15, 22, 33], [ 4, 6, 9]])
Categories: FLOSS Project Planets

Help KDE hire more people!

Planet KDE - Thu, 2022-12-01 23:34

KDE’s 2022 year-end fundraiser is now live! Please go donate if you can.

It’s been several years since we did a fundraiser at the end of the year, and we’re going to be more on the ball about this going forward, given how much the KDE e.V. is expanding hiring. This year’s fundraiser sets the fairly modest goal of 20k €, which will help offset the cost of some of that hiring.

But of course… there’s no reason not to exceed the goal! The more money raised, the more contributors the KDE e.V. can hire directly, effecting the kind of professionalization needed to take KDE to the next level! We have big plans and we can’t do it without your help!

I know I’ve asked for a lot of donations recently, so if you’re feeling tapped out, this is a good time to go nudge your friends and family members who you’ve converted to KDE over the years! Help KDE challenge the big dogs and win!

Categories: FLOSS Project Planets

Paul Wise: FLOSS Activities November 2022

Planet Debian - Thu, 2022-12-01 21:13
Focus

This month I didn't have any particular focus. I just worked on issues in my info bubble.

Changes Issues Review Administration
  • Debian IRC: setup topic/entrymsg to redirect OFTC #debian-jp to the Debian Japan IRC server, cleaned up #debianppc ChanServ metadata
  • Debian wiki: unblock IP addresses, approve domains, approve accounts
Communication Sponsors

The libemail-outlook-message-perl, purple-discord, sptag, celery work was sponsored. All other work was done on a volunteer basis.

Categories: FLOSS Project Planets

Matt Layman: Learn Python By Example - Ghost Gobble Arcade Game

Planet Python - Thu, 2022-12-01 19:00
Learn Python By Example shows a simple Python exercise from Exercism. This problem illustrates booleans in Python.
Categories: FLOSS Project Planets

Oomph Insights: Oomph Earns Acquia Drupal Cloud Practice Certification

Planet Drupal - Thu, 2022-12-01 19:00
We are thrilled to share that Oomph has been recognized as an Acquia Certified Drupal Cloud Practice for completing Acquia’s rigorous evaluation program, which recognizes the highest standards of technical delivery on the platform. To earn Drupal Cloud Practice Certification, Acquia partners must meet a stringent set of technical criteria. These requirements include a core team of Acquia certified developers, significant hands-on experience delivering Acquia Drupal Cloud products to clients, and a meticulous company review with Acquia partner specialists.  “I am incredibly proud that our team…
Categories: FLOSS Project Planets

Reproducible Builds (diffoscope): diffoscope 228 released

Planet Debian - Thu, 2022-12-01 19:00

The diffoscope maintainers are pleased to announce the release of diffoscope version 228. This version includes the following changes:

[ FC Stegerman ] * As an optimisation, don't run apktool if no differences are detected before the signing block. (Closes: reproducible-builds/diffoscope!105) [ Chris Lamb ] * Support both the python3-progressbar and python3-progressbar2 Debian packages, two modules providing the "progressbar" Python module. (Closes: reproducible-builds/diffoscope#323) * Ensure we recommend apksigcopier. (Re: reproducible-builds/diffoscope!105) * Make the code clearer around generating the Debian substvars and tidy generation of os_list. * Update copyright years.

You find out more by visiting the project homepage.

Categories: FLOSS Project Planets

PyCharm: PyCharm 2022.3 Is Out!

Planet Python - Thu, 2022-12-01 15:04

PyCharm 2022.3 brings an improved experience for working with asynchronous code in the Python Console – to call coroutines you can now use the await keyword outside of functions. The Python Packages tool window can now help you find, install, and delete packages from the Anaconda package library (in addition to PyPI). For pandas DataFrames there are new options to hide columns, use pagination to quickly go through rows, and export DataFrames in various formats.

Download PyCharm 2022.3

Conda in the Python Packages tool window

You can now search, install, and delete Conda packages through the Python Packages tool window, just one click away from the editor.

New Settings Sync solution

The new Settings Sync plugin is capable of syncing most of the shareable settings from the platform, bundled plugins, and some third-party plugins.

Enhanced UX for pandas DataFrames [Professional Edition]

Customize the way you work with DataFrames! You can now hide columns, use pagination to look through rows, export DataFrames in various formats, and more!

Improvements to docstrings rendering in Quick Documentation

The Quick Documentation popup now helps you quickly see the class attributes, as it now displays the Attributes section of the class docstrings. This also works for inherited class attributes and attributes of data classes.

asyncio support for the Python Console

The built-in Python Console now supports using the await keyword outside the function to quickly run a coroutine. PyCharm 2022.3 also adds asyncio support for the debugger. While useful for debugging asynchronous code, this feature is experimental and might not be fully stable. To enable it, follow the steps described here.

Frontend Development [Professional Edition] Vitest support

PyCharm now supports Vitest, a Vite-native unit test framework! You can run, re-run, and debug your tests in all of the key ways you’d expect, including through gutter icons. Also, watch mode is enabled with the All Tests scenario by default. Snapshot testing and coverage are supported in watch mode, too, giving you near-instant feedback on coverage when coding.

New project templates for Next.js and Vite

The New Project wizard available on PyCharm’s Welcome screen now includes project templates for Vite and Next.js. We’ve also updated the project template for Vue to make sure it follows the latest standards.

Vue updates

PyCharm can now take care of unresolved imports and will offer suggestions for importing Vue components. We’ve also supported the props destructure syntax, improved the behavior of code completion and type checking for Vue library component props, and fixed several Nuxt 3 issues.

Redis support [Professional Edition]

With new Redis support, you can connect to Redis Single Instances, explore key values in the data viewer, write and execute Redis queries with the help of our smart coding assistance, and more.

Learn more

These are the most notable changes brought by the PyCharm 2022.3 release. You can find a more detailed list of updates on the What’s New page and in the release notes.

We’re always keen to receive your feedback about the new features and updates! Please share your thoughts and suggestions on Twitter, via our issue tracker, or in the comments section below.

Categories: FLOSS Project Planets

FSF Events: Free Software Directory meeting on IRC: Friday, December 30, starting at 12:00 EST (17:00 UTC)

GNU Planet! - Thu, 2022-12-01 12:39
Join the FSF and friends on Friday, December 30, from 12:00 to 15:00 EST (17:00 to 20:00 UTC) to help improve the Free Software Directory.
Categories: FLOSS Project Planets

FSF Events: Free Software Directory meeting on IRC: Friday, December 23, starting at 12:00 EST (17:00 UTC)

GNU Planet! - Thu, 2022-12-01 12:36
Join the FSF and friends on Friday, December 23, from 12:00 to 15:00 EST (17:00 to 20:00 UTC) to help improve the Free Software Directory.
Categories: FLOSS Project Planets

FSF Events: Free Software Directory meeting on IRC: Friday, December 16, starting at 12:00 EST (17:00 UTC)

GNU Planet! - Thu, 2022-12-01 12:32
Join the FSF and friends on Friday, December 16, from 12:00 to 15:00 EST (17:00 to 20:00 UTC) to help improve the Free Software Directory.
Categories: FLOSS Project Planets

FSF Events: Free Software Directory meeting on IRC: Friday, December 09, starting at 12:00 EST (17:00 UTC)

GNU Planet! - Thu, 2022-12-01 12:29
Join the FSF and friends on Friday, December 09, from 12:00 to 15:00 EST (17:00 to 20:00 UTC) to help improve the Free Software Directory.
Categories: FLOSS Project Planets

FSF Events: Free Software Directory meeting on IRC: Friday, December 02, starting at 12:00 EST (17:00 UTC)

GNU Planet! - Thu, 2022-12-01 12:26
Join the FSF and friends on Friday, December 02, from 12:00 to 15:00 EST (17:00 to 20:00 UTC) to help improve the Free Software Directory.
Categories: FLOSS Project Planets

Python Circle: Using git hooks to boost your productivity

Planet Python - Thu, 2022-12-01 11:39
Writing a proper git message is a good coding practice. A good commit message should clearly convey what has been changed and why it has been changed. Sometimes developers use an improper message in a hurry to commit and push the changes. Here is a working hook that enforces the developer to use a commit message of 30 characters. you may start including the branch name in the commit message using git hook.
Categories: FLOSS Project Planets

Drupal Association blog: Join us for 10 Days of Drupal 10!

Planet Drupal - Thu, 2022-12-01 10:58

Drupal 10 is almost here, and we cannot wait for the community to experience the latest version of Drupal! With an expected release date of 14 December, we have less than two weeks to go. The Drupal Association is hosting 10 Days of Drupal 10 giveaways in celebration of the release! 

From 5 December to 14 December, tag us daily on Twitter with a Drupal 10-themed meme or graphic for the chance to WIN an exclusive Drupal 10 hoodie. Your Drupal 10 meme or graphic can be highlighting one of your favorite Drupal 10 features, upgrades, or anything else related to Drupal 10.

Here are some examples for inspiration:

 

Then, on #Drupal10’s expected release day, 14 December, we’re giving two lucky winners a chance to win a ticket to DrupalCon Lille or DrupalCon Pittsburgh (your choice!). To win, all you have to do is tag us with a video of your Drupal 10 release party. After that, we’ll randomly choose two winners to receive one ticket each.

We want to see how you celebrate the release, so feel free to get creative and show us your celebration. We can’t wait to see all of your videos!

On Monday, 5 December, head to the Drupal Association Twitter account, @DrupalAssoc, for the kickoff of 10 Days of Drupal 10 and your chance to win! In the meantime, check out the new features on the Drupal 10 page. The Drupal 10 page also contains all the information you’ll need to ensure a smooth upgrade to Drupal 10.

Are you hosting a Drupal 10 party in celebration of the release? Share it with the community by adding it to the Community Events page on Drupal org!

Categories: FLOSS Project Planets

Five Jars: How to Get the Most Out of Google Analytics 4

Planet Drupal - Thu, 2022-12-01 06:22
The new property type, Google Analytics 4, is about to replace Google Analytics Universal, which will expire on the 1st of July in 2023. In the article, we will explain what changes to expect and how to set up GA4.
Categories: FLOSS Project Planets

The Drop Times: Each of Us Deserve Respect, Asserts Nikki Flores

Planet Drupal - Thu, 2022-12-01 04:35
Monica Flores has been declared the winner of the recently concluded election to the At-Large position of the Board of Directors of the Drupal Association (DA). She talks to the Drop times about her time with Drupal and her story in tech.
Categories: FLOSS Project Planets

Pages