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 | |
from pandas import Series, DataFrame |
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 plotly | |
plotly.__version__ |
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
CONSUMER_KEY = "**************" | |
CONSUMER_SECRET = "**************" | |
ACCESS_TOKEN = "**************" | |
ACCESS_TOKEN_SECRET = "**************" |
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
$ python rpn.py 37+621-*+ | |
RPN: 37+621-*+ | |
[3] | |
[3, 7] | |
3 + 7 = | |
[10] | |
[10, 6] | |
[10, 6, 2] | |
[10, 6, 2, 1] | |
2 - 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
>>> i=1 | |
>>> i++ | |
SyntaxError: invalid syntax |
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
abb = ("NY","TX","MA","WA","CT") | |
state = ("New York", "Texas", "Massachusetts", "Washington", "Connecticut") | |
comprehension_dict = {i:j for i,j in zip(abb,state)} | |
# {'WA': 'Washington','TX': 'Texas','NY': 'New York','MA': 'Massachusetts','CT': 'Connecticut'} |
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
$ pip install ghp-import | |
$ ghp-import output | |
$ git commit -m "first post" | |
$ git push -f origin gh-pages:master |
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 random | |
def typoglycemia(target): | |
res = [] | |
for s in target.split(): | |
if len(s) < 5: | |
res.append(s) | |
else: | |
head = s[0] | |
tail = s[-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
$ cpanm Switch | |
--> Working on Switch | |
Fetching http://www.cpan.org/authors/id/C/CH/CHORNY/Switch-2.17.tar.gz ... OK | |
Configuring Switch-2.17 ... OK | |
Building and testing Switch-2.17 ... OK | |
Successfully installed Switch-2.17 | |
1 distribution installed |
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
use Data::Page; | |
my $total_entries = 18; | |
my $entries_per_page = 3; | |
my $current_page = 4; | |
my $page = Data::Page->new($total_entries, $entries_per_page, $current_page); | |
print " First page: ", $page->first_page, "\n"; | |
print " Last page: ", $page->last_page, "\n"; |
OlderNewer