SShortSingh.
Back to feed

A Practical Guide to Lists and Tuples in Python for Data Science

0
·65 views

Python offers several built-in data structures that play a foundational role in data science workflows, including lists and tuples. Lists are mutable, ordered collections defined with square brackets that support mixed data types and can be modified using methods like append(), insert(), extend(), remove(), and pop(). Elements in a list can be accessed via positive or negative indexing, and slicing allows retrieval of multiple elements using a start, stop, and optional step value. Tuples function similarly to lists but are immutable, meaning their contents cannot be changed after creation, and are defined using parentheses. Both structures support indexing and slicing, making them versatile tools for organizing and accessing data in Python.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Glimpse Developer Adds Live Note-Taking to Meeting App After Using It in Lectures

A developer spent a year building Glimpse, a dictation and meeting app, largely on their own. After matching the features users expect from dictation tools, they focused on meeting mode, drawing inspiration from MacWhisper. When MacWhisper launched live transcripts, the developer added a similar feature to Glimpse. Using it during lectures revealed shortcomings, such as the app listening for too long or too short a time and not indicating which model was processing the live notes. The developer's takeaways are to copy what users expect, scrutinize what you dislike even in copied features, and use your own product constantly to catch problems before others do.

0
ProgrammingDEV Community ·

OAB Sets Guardrails Requiring Human Lawyer Oversight of AI in Legal Services

A DEV Community article outlines technical and ethical guardrails meant to limit how artificial intelligence is used in Brazilian legal work. It says the Brazilian Bar Association (OAB) requires that any AI-assisted legal output be directly supervised and signed off by a registered lawyer, and that responsibility for AI-driven errors rests with the lawyer rather than the technology provider. The piece cites the Estatuto da Advocacia, OAB opinions and resolutions, and reported court practice, noting courts tend to reject filings whose authorship cannot be clearly attributed to a qualified professional. Suggested safeguards include blocking unsigned AI outputs, mandatory warnings on sensitive topics, immutable logs of AI interactions, and disabling automated drafting of complex documents. The article presents these as current expectations in the profession rather than a new regulatory announcement.

0
ProgrammingDEV Community ·

Setting Up External DNS with Cloudflare on a Local Kubernetes Cluster

This installment of a Kubernetes series explains how to deploy External DNS to automate DNS record management on a local cluster. The author uses Cloudflare as the DNS provider and follows declarative GitOps practices with Flux. The process starts by generating a zone-scoped Cloudflare API token and storing its credentials in a Kubernetes secret, which is encrypted with SOPS before being committed to Git. The External DNS deployment is then defined through a ServiceAccount, a read-only ClusterRole and binding, and a Deployment that watches ingresses and syncs records to Cloudflare. The article notes that the setup builds on earlier steps for routing external traffic to the cluster so it can be reached via a public IP.

0
ProgrammingDEV Community ·

DEV community asks which single fix users would make to the platform

A DEV Community post invites readers to name the one thing they would fix on the platform if given a magic wand. The author asks for a single answer, which can be a feature, rule, bug, or aspect of how the feed works. The author gives an example: a way to understand why a post received few views, which would especially help new writers who get no initial readers. The post notes that, without such insight, writers can only guess at the reason. The author states they will read every reply.