Posts

Showing posts from February 1, 2019

Load fetch_lfw_people using Proxy

Image
0 I want to use this toy dataset for education. But when I try to load it using builtin sklearn loader I got the error. from sklearn import datasets lfw_people = datasets.fetch_lfw_people(min_faces_per_person=50, resize=0.4, data_home='.', ) Error: urlopen error [WinError 10061] I know it is about the proxy - usually to install new packages I use --proxy option. But how to do it now? There is no such option in datasets.fetch_lfw_people I thought about manual downloading it from the official website: http://vis-www.cs.umass.edu/lfw/#download But I don't know which one to choose and how to open after that in python. python-3.x proxy scikit-learn dataset jupyter-notebook ...

Selecting elements from lists based on string pattern

Image
1 $begingroup$ I have a list: lis = {{"abc", 1, 2}, {"cde", 3, 4}, {"fgbc", 5, 6}} I would like to select list items that have first elements that end in the string "bc" to give: res = {{1,2},{5,6}} This is a variant on this question which has to do with strings only. Thank you as always for suggestions. list-manipulation string-manipulation share | improve this question asked 3 hours ago Suite401 Suite401 988 3 12 $endgroup$ ...