coursenotes's Issues
Started new branch "A"
@morrowcj I started a new branch called A
.
Your turn!
Homework for 10/3 - Sed Exercise
Tasks
-
Eliminate commas and quotes from second column of csv file:
sed -E 's/"([0-9]+),([0-9]+),*([0-9]*)"/\1\2\3/' tableofSNPs.csv > out.csv
-
Check there are only three commas in each line:
sed -E 's/[^,]//g' out.csv | sort | uniq
The output should only contain one line consisting of 3 commas indicating a successful step 1.
Optional Tasks
-
Replace all
A
andT
withT
andA
respectively:
sed -E 'y/AT/TA/' tableofSNPs.csv > rev.csv
-
Check that the replacement was correct:
sed -E s/'[^AT]'//g rev.csv | sort | uniq -c | tail -n 2 > countRev
sed -E s/'[^AT]'//g out.csv | sort | uniq -c | tail -n 2 > countOut
diff countRev countOut
This is a three line solution. I don't know how to do a one-liner for this; please help.
Note: All commands were executed in macOS 10.14 (BSD)
@cecileane and @coraallencoleman
Homework for 10/1 - write something about Github
One really important thing I learned was how to undo changes in a repository. For example, if I have added something using git add <file>
, then I can un-stage it using git reset HEAD <file>
. I think this is a super useful feature to "undo" things.
@cecileane and @coraallencoleman
Completed_binomial.py_Shaurya-Chanana
This script was written for python3
and tested on macOS 10.14
- The first line of the script is
#! /usr/bin/env python3
which means it tries to usepython3
by default.python3
no longer supports typelong
. This means that
$ ./binomial.py -n 150 -k 40
4408904561911885789946649584764715008
however, when it is run with python2
it will show
$ python ./binomial.py -n 150 -k 40
4.40890456191e+36
- The
doctest
module has problems with returning integers vs floating point values if run withpython2
$ python ./binomial.py --test
testing the module...
**********************************************************************
File "./binomial.py", line 85, in __main__.choose
Failed example:
choose(5, 3)
Expected:
10
Got:
10.0
**********************************************************************
Even though the code says
logChoose = logfactorial(n, k) - logfactorial(n - k)
if log:
return logChoose
else:
return round(math.exp(logChoose)) # returns whole number
@cecileane and @coraallencoleman
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.