Skip to content

Instantly share code, notes, and snippets.

@bsweger
bsweger / useful_pandas_snippets.md
Last active April 9, 2024 10:22
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

<?php
$host = 'localhost'; // MYSQL database host adress
$db = ''; // MYSQL database name
$user = ''; // Mysql Datbase user
$pass = ''; // Mysql Datbase password
// Connect to the database
$link = mysql_connect($host, $user, $pass);
mysql_select_db($db);