how to get just the filename in python
import os
>>> base=os.path.basename('/root/dir/sub/file.ext')
>>> base
'file.ext'
>>> os.path.splitext(base)
('file', '.ext')
>>> os.path.splitext(base)[0]
'file'
how to get just the filename in python
import os
>>> base=os.path.basename('/root/dir/sub/file.ext')
>>> base
'file.ext'
>>> os.path.splitext(base)
('file', '.ext')
>>> os.path.splitext(base)[0]
'file'
how to find rows with missing data in pandas
null_data = df[df.isnull().any(axis=1)]
r remove all string before : in r data frame
> x <- 'aabb.ccdd'
> sub('.*', '', x)
[1] ""
> sub('bb.*', '', x)
[1] "aa"
> sub('.*bb', '', x)
[1] ".ccdd"
> sub('\..*', '', x)
[1] "aabb"
> sub('.*\.', '', x)
[1] "ccdd"
how to print 2 list in python as table
a = ['a', 'b', 'c']
b = ['1', '0', '0']
res = "n".join("{} {}".format(x, y) for x, y in zip(a, b))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us