Thanks to antville.org
14 days ago

This is the python way of calculating the date that is 14 days ago.

import datetime
(datetime.datetime.now() - datetime.timedelta(days = 14)).date()

And this is pandas way of getting the same results:

import pandas as pd
(pd.datetime.today() - pd.offsets.Day(14)).floor('D')

... Link (3 comments) ... Comment


Install java within conda container

apt-get update && apt-get upgrade
mkdir -p /usr/share/man/man1
apt-get install default-jdk
apt install openjdk-11-jdk

... Link (12 comments) ... Comment


python itertools module

from itertools import groupby
s = 'abcccccbba'

for w, v in groupby(s):
print (''.join(w), ''.join(v))

a a
b b
c ccccc
b bb
a a

... Link (4 comments) ... Comment


google module

module for google search

!pip install google

from googlesearch import search
for url in search('"Breaking Code" WordPress blog', stop=10):
print(url)

... Link (6 comments) ... Comment


Extract words from Marathi wikipedia

1) Download the polyglot pickled marathi model
wget bit.ly
mv 12FI1xV polyglot-mt.pkl

2) Extract all the words from the embedding

from polyglot.mapping import Embedding
embeddings=Embedding.load("polyglot-mt.pkl")
with open('myfile.txt', 'w') as fx:
for i in embeddings.vocabulary:
fx.write(i.encode('utf-8')+'\n')

3) Download the wordlist:
s3.amazonaws.com

... Link (3 comments) ... Comment


Python objects and methods

Here are important python objects and their methods
int mul, add, eq, ge, mod, pow
float .isinteger()
string .upper(), .endswith(), .split()
bool .numerator .abs()
list .append, .pop, _len
() / slicing
tuple
dict .items(), .keys(), .values() / slicing
pd.Series .sum(), .stack(), .groupby(), .resample(), .sort_values(), .sort_index(), .iloc
pd.DataFrame

... Link (4 comments) ... Comment


managing servers using python

Fabric is a high level Python library designed to execute shell commands remotely over SSH, yielding useful Python objects in return:
"""
a#!/usr/bin/env python
from fabric.api import hosts, run, task
from fabric.tasks import execute

@task
@hosts(['shantanu@1.2.3.4:1224'])
def test():
run('hostname -f')

if name == 'main':
execute(test)
"""

... Link (8 comments) ... Comment


About python

1 everything is an object (class instances)
2 methods depends upon class of the instance
3 int,str and tuple are immutability, dict and list are mutable
4 dict keys are unique but series allows duplicate
5 list comprehension
6 slice of dict, str, list
7 dynamically typed
8 iterables are str, list, dict but int are not
9 functions are first class objects and can be applied just like built-in classes

... Link (6 comments) ... Comment


Installing python as a single file

wget downloads.egenix.com

chmod 700 install-pyrun

mkdir /mypython

./install-pyrun mypython/

/mypython/bin/pip install boto

/mypython/bin/python

... Link (0 comments) ... Comment


Online for 6364 days
Last modified: 1/26/20 2:24 PM
Status
Youre not logged in ... Login
Menu
... Home
... Tags

Search
Calendar
January 2020
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
262728293031
December
Recent updates
while loop This is
a sample shell script while loop while read mydb do echo...
by shantanuo (1/26/20 2:24 PM)
compare mysql schema And here
is poor man's schema compare using good old diff command......
by shantanuo (1/26/20 1:49 PM)
Selecting from error log grep
"error" error_log |awk -F[ {'print $4'} \ | sort |...
by shantanuo (1/26/20 12:40 PM)
Rank mysql records using variables
SET @rank = 0, @prev_val = NULL; SELECT rank, correct...
by shantanuo (1/26/20 11:45 AM)
Thanks for sharing this!!
commercial roofing huntsville al
by Mazikeen (1/24/20 6:37 PM)
Sophie Chciałbym więcej o tym
przeczytać. Szybka, jaka literatura ma studiować? texas colleges and universities
by panistefanin (1/24/20 3:45 PM)
Jack Lovely information thank you
very much decanters
by decanter2020 (1/24/20 1:20 PM)
I like it I like
that logic. interior painting
by LisaCook (1/23/20 10:11 PM)
Love it I like this!
Thanks for posting roll off canister
by LaurenHill (1/23/20 10:05 PM)
Thanks for the heads up!
Thank you for sharing this. Our website
by mozaic (1/23/20 2:32 PM)
Thank you for sharing
a really great piece of information. bubble shooter
by longjumper (1/21/20 11:05 AM)
Thanks Thanks for sharing these.
Sam H - Interior Painter Scaumburg Il
by Samh2019 (1/21/20 10:14 AM)
Fencing in Guildford thanks for
the information Fencing in Guildford Fencing in Surrey
by Dubs (1/20/20 9:26 PM)
satta matka matka boss satta
matka Visit our site for more information
by sattamatka3.net (1/20/20 7:52 PM)
Beebeetravvel Thanks for sharing your
valuable information. we are a tour & travel agency with...
by coolexusa (1/20/20 2:27 PM)
Access Control System Dubai Fingerprintdubai
Company is providing many types of Services like , card...
by coolexusa (1/20/20 12:19 PM)
Air Duct Cleaning This type
of Duct cleaning Miami is absolutely not a must have...
by coolexusa (1/20/20 11:26 AM)
Carpet Cleaning Oxford and Surrounding
Areas Interesting read. Carpet cleaning in Oxford and surrounding areas
by Murray Whelehan (1/19/20 8:18 PM)
Antares AutoTune Crack License
Key With Keygen ( MAC ) A Antares AutoTune Pro Crack...
by ijicrackgh (1/19/20 9:50 AM)
Waves Tune Real-Time Crack (Latest)
Free Download 2020! Visit my site and free crack full...
by ijicrackgh (1/19/20 9:45 AM)
Advanced SystemCare Registry Repair And
Cleaner If you are like many people, you have shut...
by GeraldRob (1/19/20 6:42 AM)
Shell Command One of the
best articles I have ever read. Thank you for sharing...
by Harrison William (1/19/20 1:11 AM)
Hola buenas thank
you for sharing information, i like your blog creditos rapidos con asnef
by polcelery (1/19/20 12:25 AM)
Is it Worth Investing in
an Asbestos Survey? If you suspect that asbestos is present...
by GeraldRob (1/18/20 6:52 PM)
Spyhunte 5 Full Version Spyhunter
is best antivirus pogrom software which enable to remove virus...
by zcracked (1/18/20 9:41 AM)

RSS feed

Made with Antville
Helma Object Publisher