import file_name as fn
or
from file_name import *
%in%
Use re
(regular expression) to split text
re.split('\W+|_',x)
We use |
to seperate symbols that we want to use as spliter. Here \W+
means words. An example is following,
>>>text = 'I:\\Textual Analysis Data\\19950131_10-K_edgar_data_69970_0000950152-95-000069_1.txt'
>>>re.split('\W+',text)
['I',
$ cmd.exe # to change to windows cmd
$ wsl.exe # to change to wsl ubuntu terminal
*args pass a list of values or variables
**kwarg(key words arguments) pass a dictionary
def test_args_kwargs(arg1, arg2, arg3):
print("arg1:", arg1)
print("arg2:", arg2)
print("arg3:", arg3)
# test *args
<object data="http://yoursite.com/the.pdf" type="application/pdf" width="700px" height="700px">
<embed src="http://yoursite.com/the.pdf">
<p>This browser does not support PDFs. Please download the PDF to view it: <a href="http://yoursite.com/the.pdf">Download PDF</a>.</p>
</embed>
file_name = 'file_name.csv'
tickers_info = pd.read_csv(file_name,
sep = ",", # ',' for csv file and '\t' for text file
header = 0, # row number used as head
usecols=[1, 2], # column index to be included
index_col = [0], # column index which apdated above
engine='c') # c engine is faster than python