I want to store the multiple urls into a single variable 'URLs'. Those URLs is made up from three parts,'urlp1' ,'n'and 'urlp2', which you can see in the code below.
urlp1 = "https://www.proteinatlas.org/"
URLs = []
for cancer in cancer_list:
urlp2 = "/pathology/tissue/" + cancer[1]
f = cancer[0]
try:
df1 = pd.read_csv(rootPath + f + ".csv", header=0);
except Exception as e:
print("File " + f + " doesn't exist")
print(str(e))
sys.exit()
gene_matrix = df1.as_matrix()
number_matrix = gene_matrix[:,0]
gene_cancer = number_matrix.tolist()
# print(gene_cancer)
np_clean = [x for x in gene_cancer if str(x) != 'nan']
for n in np_clean:
URL = urlp1 + n + urlp2
URLs.append(URL)
#print(URLs)
So how can I store all the output into URLs = ["URL1", "URL2", "URL3", ...] ?
Thanks for help.