import pandas as pd
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 java.util.Scanner; | |
import java.util.Arrays; | |
public class RockPaperScissors | |
{ | |
public static void RockPaperScissors() | |
{ | |
String[] possibleChoices = {"rock", "paper", "scissors"}; | |
Scanner userInput = new Scanner(System.in); // create a Scanner for getting user input | |
String playerChoice = ""; // declare an empty variable that we'll fill with the user input |
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
from pythonosc import udp_client | |
from time import sleep | |
client = udp_client.SimpleUDPClient('192.168.1.126', 10023) | |
for x in range(5): | |
for i in range(9): | |
client.send_message('/ch/0'+str(i)+'/mix/on', 0) | |
client.send_message('/ch/0'+str(i)+'/mix/fader', 0.1) | |
sleep(0.5) | |
for c in range(16): | |
client.send_message('/ch/0'+str(i)+'/config/color', c) |
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
javascript:(function(){var url=location.href;var res=url.split("/");var site=res[2];var user=res[3];var repo=res[4];var treeBlob=res[5];var branch=res[6];var nbgitputllerUrl="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=";if(site=="github.com"){if(treeBlob){var subPath=url.substring(url.indexOf(branch)+branch.length+1);nbgitputllerUrl+=encodeURIComponent("https://github.com/"+user+"/")+repo+"&branch="+branch+"&subPath="+subPath+"&depth=1";}else{nbgitputllerUrl+=url;}}window.prompt("Callysto nbgitpuller link",nbgitputllerUrl);})(); |
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
%%html | |
<script> | |
requirejs.config({ | |
paths: { | |
'phidget22': ['https://unpkg.com/phidget22@^3.10/browser/phidget22'], | |
}, // strip .js ^, require adds it back | |
}); | |
var usbconn; | |
require(['phidget22'], function(phidget22) { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
class_code = '5L' | |
value = 12 | |
from datetime import datetime | |
import requests | |
import pandas as pd | |
ethercalc_id = 'callysto' # can be the same as class_code, or randomly generated | |
base_url = 'https://ethercalc.net/' | |
post_url = base_url+'_/'+ethercalc_id |
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 | |
import plotly.express as px | |
url = 'http://ets.aeso.ca/ets_web/ip/Market/Reports/CSDReportServlet' | |
df = pd.read_html(url, header=0) | |
updated = df[1].columns[-1].split(': ')[1] | |
legend = df[1]['Legend'].values.tolist() | |
notes = df[1]['Legend.1'].dropna().values.tolist() |
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
# download csv files from https://climateknowledgeportal.worldbank.org/download-data | |
import pandas as pd | |
import os | |
df = pd.DataFrame() | |
for root, dirs, files in os.walk('.'): | |
for name in files: | |
if name.endswith('.csv'): | |
df2 = pd.read_csv(os.path.join(root, name), skiprows=1) |
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
countries = sorted(['Canada','United States','Mexico','Costa Rica','China']) | |
year = '2013' | |
import pandas as pd | |
co2 = pd.read_csv('https://docs.google.com/spreadsheets/d/1VxxG9XJNG5oFXBo_0TTCP_sQ9wEv3Oy5SEOlR_0du5c/export?gid=1415343215&format=csv') | |
electricity = pd.read_csv('https://docs.google.com/spreadsheets/d/1L9CAwtcOoG3WfGkrFOYjAByaznce-DGE1dPK-1-23PU/export?gid=1944428591&format=csv') | |
y1 = co2[co2['country'].isin(countries)][year] | |
y2 = electricity[electricity['country'].isin(countries)][year]/1000 | |
y1_name = 'Carbon Dioxide Emissions per Person' |