Urgent.News

What's breaking now, across thousands of outlets.

Tech

pandas read_csv: Your First DataFrame, and What It Guessed

By Michael Nocito , data analyst · Published August 8, 2026 By the end of this page you can load a CSV into pandas, find out in twenty seconds what type every column became, stop the identifier columns losing their leading zeros, get dates read the way they were written, and turn a money column that arrived as text into numbers. It is about twenty-five minutes, and every output below was produced…

This brief provides a step-by-step guide on how to load a CSV file into a pandas DataFrame and understand what type each column becomes. The first step is to import the pandas library and load the CSV file using the read_csv() function. After loading the file, it is important to examine the data types of each column using the dtypes attribute, as opposed to df.head(), which shows the values but not the data types.

This step is crucial because columns that should be numeric identifiers or monetary values may have been incorrectly guessed as object or string types, losing their leading zeros or becoming text, respectively. The brief emphasizes the importance of running df.dtypes and df.isna().sum() to identify any issues with the loaded data and provides a small sample CSV file to demonstrate the process.

Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How to Set Up DuckDB (Run SQL on a CSV With No Import Step)

By Michael Nocito , data analyst · Published August 8, 2026 By the end of this page you will be running SQL directly against a CSV file on your machine, with no import step, no CREATE TABLE , and no…

  • DuckDB runs SQL on CSV files without import steps
  • Automatically detects column types in CSV files
  • Interfaces with pandas for seamless data workflow

I built a zero-dependency CLI that crawls your site and lints its JSON-LD

Structured data breaks silently: the page renders fine while your Product schema has "$19.99" as a price, your LocalBusiness lost its address in a redesign, and your breadcrumbs go 1, 3.

  • schema-audit is a single-file Node.js CLI tool
  • Crawls entire site to check JSON-LD issues
  • Zero npm dependencies for lightweight solution

More from Saturday 29 August →