Skip to content

Instantly share code, notes, and snippets.

View ineedme's full-sized avatar

Jose Eduardo Escobar ineedme

  • Financiera CrediQ
View GitHub Profile
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
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)

@mvaz
mvaz / cx_oracle_to_pandas.py
Created March 9, 2012 13:24
Example of executing and reading a query into a pandas dataframe
import cx_Oracle
import pandas
connection = cx_Oracle.connect('username/pwd@host:port/dbname')
def read_query(connection, query):
cursor = connection.cursor()
try:
cursor.execute( query )
names = [ x[0] for x in cursor.description]