Skip to content

Instantly share code, notes, and snippets.

View craigslist_rent_summarizer
function JSONToCSVConvertor(JSONData, ReportTitle, ShowLabel, appendString) {
//If JSONData is not an object then JSON.parse will parse the JSON string in an Object
var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData;
var CSV = '';
//This condition will generate the Label/Header
if (ShowLabel) {
var row = "";
//This loop will extract the label from 1st index of on array
View qlik_dual_number_limit.qvs
// https://community.qlik.com/t5/QlikView-App-Development/number-of-17-digits/m-p/511285
/*
Henric_Cronström
Employee
Henric_Cronström
Employee 2013-09-12 01:44 PM
Re: number of 17 digits
As Gysbert says, such a large number cannot be displayed as an integer. The 64-bit IEEE float can only show 14 digits. Instead, you should try
*/
View summarizing a series.py
fake_data_index = pd.MultiIndex.from_product([
[
'nate',
'jess'
], pd.date_range('2019-01-01', '2019-12-31')
], names=('who', 'date'))
fake_df = pd.DataFrame({
'increasing': np.arange(len(fake_data)),
'random': np.random.rand(len(fake_data))
}, index=fake_data_index)
View pivoting to a series of 3 line charts.py
#Create a new field 'datetime', which converts strings to a datetime object
# datetime object will make our x-axis look good, showing appropriate labels like "Feb 2018" etc...
pyber_data_df['datetime'] = pd.to_datetime(pyber_data_df['date'])
# a datetime object *also* allows us to access the date part (2019-01-04) , ignoring the time-of-date part (05:39:20)
#Create another new field 'datedate' to store it
pyber_data_df['datedate'] = pyber_data_df['datetime'].dt.floor('d')
avg_fare_by_type_date = (pyber_data_df
#group by multiple fields by passing a list of those fields ;
View UCB Fall MatPlotLib Work.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View UCB Fall MatPlotLib Work.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View 20191023__live_session__ufo_filter_neo_challenge.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View DU_fall_analytics_baseball_player_most_frequent_position.sql
Nate, I am working on finding the primary position as we talked about. I have queried the db and summed each of the positions for a given player, but have hit a roadblock with finding the max and making that the primary position. I thought of using a CASE statement, but I would have to have a variable for the current max that updates as it looks at each position. I can do that in python, but I am not sure how to do that in sql. Thanks. I will paste my code below.
SELECT
playerID,
sum(G_all) Total_Games,
sum(GS) as Games_Started,
sum(G_p) as Games_Pitched,
sum(G_c) as Games_Catcher,
sum(G_1b) as Games_First_Base,
sum(G_2b) as Games_Second_Base,
sum(G_3b) as Games_Third_Base,
View Qlik Nov 2018 Patch 4 BaseBNFString
(******************************************************************************)
(* QlikView Expression Syntax *)
(******************************************************************************)
(* An extended subset of the script syntax file *)
(* *)
(* Things like function, field, macro and bookmark names are added at runtime *)
(* *)
(******************************************************************************)
View dollar_sign_expansion_with_let_and_set.qvs
SET l1 = SUM(1);
SET l2 = COUNT($(l1));
SET l3 = AVG($(l2));
TRACE $(l3); // traces "AVG(COUNT(SUM(1))", ok...
LET ll1 = 'SUM(1)';