Skip to content

Instantly share code, notes, and snippets.

View GregBowyer's full-sized avatar
🧊
still glows in the dark

Greg Bowyer GregBowyer

🧊
still glows in the dark
View GitHub Profile
class LOL(object):
def __nonzero__(self):
import random
if random.gauss(mu=0.5, sigma=0.05) >= 0.5:
return 1
else:
return 0
_X = LOL()
True = _X
In [1]: import pandas as pd
In [2]: df = pd.read_csv("/home/greg/Downloads/slipknot_fans.csv")
In [3]: %edit
IPython will make a temporary file named: /tmp/ipython_edit_jgkmcag0/ipython_edit_d4b4hpdb.py
Editing... done. Executing edited code...
Out[3]: "def merge_columns(df, column_prefix, new_aggregate_prefix):\n temp = df[[x for x in df.columns if column_prefix in x]] == True\n # Breaking this down a little\n # Find all the column names that are likely to be the category I want\n # in this case `income_9_cat_xx`\n\n # As a list-comprehension this is\n income_cat_cols = [x for x in df.columns if column_prefix in x]\n\n # Now we want to select just these columns from the dataframe\n temp = df[income_cat_cols]\n\n # Next we observe that we have some NaN / NA in the dataframe\n # For boolean data I am going to _assume_ NaN is false\n # or ... moreover I only care about where the value is True, so I am\n # going to _project_ over only true values (True == True is ... True r
(set-logic QF_BV)
(set-info :smt-lib-version 2.0)
(declare-fun mixed_fruit () ( 16))
(declare-fun french_fries () (_ BitVec 16))
(declare-fun side_salad () (_ BitVec 16))
(declare-fun hot_wings () (_ BitVec 16))
(declare-fun mozzarella_sticks () (_ BitVec 16))
(assert (bvult mixed_fruit #x0010))
#!/usr/bin/python
import sys
import codecs
from openpyxl.reader.excel import load_workbook
def main():
wb = load_workbook(filename=sys.argv[1])
for sheet in wb.worksheets:
csv_file='%s.csv' % sheet.title
print 'Creating %s' % csv_file
extern crate core;
extern crate itertools;
use itertools::Itertools;
static RAD50_PAD: u8 = 0x00;
static RAD50_TBL: [char; 40] = [
' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',

Keybase proof

I hereby claim:

  • I am gregbowyer on github.
  • I am gbowyer (https://keybase.io/gbowyer) on keybase.
  • I have a public key ASDv-FIZPPbbT4OF0yZCD-w1rObo6MVsDTGDAc-qsXLpVwo

To claim this, I am signing this object:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
error[E0277]: the trait bound `RDD<'a, &'a str> + 'static: std::marker::Sized` is not satisfied
--> lib.rs:23:57
|
23 | fn textFile<'a>(path: str, minPartitions: usize) -> RDD<'a, &'a str> {
| ^^^^^^^^^^^^^^^^ the trait `std::marker::Sized` is not implemented for `RDD<'a, &'a str> + 'static`
|
= note: `RDD<'a, &'a str> + 'static` does not have a constant size known at compile-time
= note: the return type of a function must have a statically known size
error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
[package]
name = "tst"
version = "0.1.0"
authors = ["Greg Bowyer"]
[lib]
name = "tst"
crate-type = ["staticlib"]
[dependencies]