Monday, December 16, 2019

Display all dataframe lines in ipython / jupyter notebook

Sometimes when you want to see all lines in ipython, either in IDE or in notebook, it wont show you because of in-build options. Here are those options, in case you want to change that :

import pandas as pd
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 1000)

Wednesday, December 4, 2019

Vertica creating a temporary list of numbers

I just wanted to quickly check what is the behavior of NULL in analytics functions like median.
So rather than creating a table, I  wanted to pass a list of numbers and see what happens. This is how I achieved it :

SELECT median(val) over() FROM (
SELECT * from (SELECT 1 as val, 1 as row
UNION SELECT 2, 2
UNION SELECT NULL,3
UNION SELECT NULL,4
UNION SELECT 4,5)temp
)temp2;