This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"ts":1376547924000,"level_0":1175,"index":1175,"Unnamed: 0":1175,"username":"kaizer1v","platform":"Windows 7 (6.1.7601; x64; SP1; S)","ms_played":264880,"conn_country":"IN","ip_addr_decrypted":"115.240.80.29","user_agent_decrypted":"unknown","master_metadata_track_name":"Standing On The Shore","master_metadata_album_artist_name":"Empire of the Sun","master_metadata_album_album_name":"Walking On A Dream","spotify_track_uri":"spotify:track:7wME8torEQ606m3fj2XERm","episode_name":null,"episode_show_name":null,"spotify_episode_uri":null,"reason_start":"popup","reason_end":"trackdone","shuffle":false,"skipped":0.0,"offline":0.0,"offline_timestamp":0.0,"incognito_mode":0.0,"city":null,"region":null,"metro_code":0.0,"longitude":0.0,"latitude":0.0,"year":2013,"month":8,"day":15,"hour":6,"minute":25,"seconds":24,"time":"06:25:24"},{"ts":1376548200000,"level_0":3643,"index":3643,"Unnamed: 0":3643,"username":"kaizer1v","platform":"Windows 7 (6.1.7601; x64; SP1; S)","ms_played":275906,"conn_country":"IN","ip_addr_decryp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Data Columns available are = ['track', 'year', 'minutes_streamed'] | |
# GOAL: Top 5 tracks for every year from 2010 to 2020 based on the number of minutes streamed | |
group_1 = df.groupby(['year', 'track']).agg({'minutes_streamed': sum}) | |
group_1['minutes_streamed'].groupby(['year'], group_keys=False).nlargest(5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* =============== | |
* This snippet shows you how to inherit from one object into another, | |
* without using the `new` keyword or using any functions. | |
* =============== | |
*/ | |
// create a class object which we will use to emulate inheritance | |
var Person = { | |
firstname: 'John', | |
lastname: 'Doe' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Import External HTML</title> | |
</head> | |
<body> | |
<h1>Importing External HTML Files</h1> | |
<p>View the code to see how to import another html</p> | |
<hr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>jQuery Templating</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
</head> | |
<body> | |
<h1 class="h"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// filters out all the falsey values and returns only valid ones | |
let arr = [7, "ate", "", false, 9]; | |
arr.filter(Boolean); // [7, 'ate', 9] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trimLeft(val) { | |
// Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill | |
return val.replace(/^[\s\uFEFF\xA0]+/g, ''); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let arr = [1, 2, 3]; | |
// cycle the `arr` by | |
arr.unshift(arr.pop()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
# will generate dates between the two dates, every 4 years | |
pd.date_range('01/01/1930', '01/01/2018', freq=pd.DateOffset(years=4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check versions of python installed | |
ls /usr/bin/python* | |
# Check your current python version | |
python --version | |
# Python 2.7.8 | |
# Change alias of Python | |
alias python='/usr/bin/python3.5' | |
# or whatever version you have installed and want to switch to |
NewerOlder