Google-colab install fails on "Running setup.py install for pandas ... error"
I'm trying to install google-colab via pip, but it errors out here:
Running setup.py install for pandas ... error ERROR: Command errored out with exit status 1
I have pandas already installed, so I also tried to install google-colab with --ignore-installed but it still results with the same error. How do I fix this error? Thx
See also questions close to this topic
Convert all rows of a padas dataframe column to comma separated values with each value in single quote
I have a pandas dataframe similar to:
df = pd.DataFrame(['a', 'b', 'c', 'd'], columns=['Col']) df Col 0 a 1 b 2 c 3 d
I am trying to convert all rows of this column to a comma separated string with each value in single quotes, like below:
'a', 'b', 'c', 'd'
I have tried the following with several different combinations but below is the closest I got:
s = df['Col'].str.cat(sep="', '") s "a', 'b', 'c', 'd"
I think that the end result should be:
"'a', 'b', 'c', 'd'"
Any help is highly appreciated.
How to use .map using parts of dataframes
I am using .map to replace values that fall into interval into a dataframe. I am not sure if it is because I am using the .map function or because I am copying on a copy of the dataframe:
intervals = pd.DataFrame(columns = ['Hole','From','To','Value'], data = [['N',0,100,'A'],['N',100,200,'B'],['N',200,500,'C'],['Q',1,101,'A'],['Q',101,201,'B'],['Q',201,501,'C']]) print('intervals\n',intervals,'\n') points = pd.DataFrame(columns = ['Hole','Point', 'Value'], data = [['N',45,'X'],['N',125,'X'],['N',145,'X'],['N',345,'X'],['Q',45,'X'],['Q',125,'X'],['Q',145,'X'],['Q',345,'X']]) print('points\n',points,'\n') holelist = intervals['Hole'].unique() print(holelist) intervallist =  for hole in holelist: holeintervaldf = intervals[intervals['Hole'] == hole] print('holeintervaldf\n',holeintervaldf) holeintervaldf=holeintervaldf.set_index(keys = pd.IntervalIndex.from_arrays(left = holeintervaldf['From'], right = holeintervaldf['To']))['Value'] print('holeintervaldf with intervalsas index\n',holeintervaldf) points[points['Hole']==hole]['Value'] = points[points['Hole']==hole]['Point'].map(holeintervaldf) #this is where something is wrong for j in intervallist: print(j) print(points)
Thanks a bunch!
How to run Selenium python test simultaneously on single Instance of browser
Initially I was using new instance of browser for each test. But chrome process created a lot of orphan processes , which piled up over time and hogged the server on cpu cycles and memory so to avoid this, I have defined driver as global variable and was passing it to different tests. But the problem with code is if tests run sequentially it works fine, not able to run multiple tests simultaneously on single instance of browser.
driver = "" def getChromeDriver(): global driver options = Options() options.add_argument("--headless") options.add_argument("--no-sandbox") options.add_argument("window-size=1200,1100") driver = webdriver.Chrome(chrome_options=options, executable_path='my/path')
def testGoogle(): driver.get(www.google.com) def testyahoo(): driver.get(www.yahoo.com)
Install alongside windows not appearing ubuntu 18.04.5
am new to linux, I was trying to install linux 18.04.05 but the installation menu says: the computer currently has windows boot manager on. What would you like to do ? But there is no option of install alongside windows.
Windows is also not showing in the grub menu. I am working on a thinkpad x1 carbon gen 4, with hibernation, fastboot and secure boot disabled.
I previously install ubuntu 20.04 but uninstalled it because I realized I needed 18.04. Not sure if that can have an effect.
I ran bootrepair thne link is paste.ubuntu.com/p/dGc9vYGzGR/ It says additional repair win legacy basic fix but the bios is in uefi only
Thanks for the help
- after installing java JDK,in cmd java -version command is not showing anything.same result for other commands too javac, java
When installing a module, the names of modules in dependencies are automatically changed to uppercase
When installing a module(execute
yarn add myproject), the names of modules in dependencies are automatically changed to uppercase. Then, an error appears stating that the module could not be found, and the project installation fails. The same fails when trying to install the project with the npm command.
The following is the node, npm, yar version of my computer environment. : node v10.16.3 / npm v6.9.0 / yar v1.17.3 However, people using different versions are also getting the same error.
Where is the problem? How can I fix this problem?😭
How do write a python program that finds the average of 10 numbers using the while loop?
I'm a complete beginner, and my code looks like this:
a = input("Please enter any ten numbers: ") i = 0 sum = 0 while i <= n: n = 10 sum = sum + n i += 1 avg = sum/n print("The average of the numbers entered is", avg)
I can't seem to get it right. I'd really appreciate your help!
ResNet Feature Extraction Filling GPU
I'm using Resnet50 as a feature extractor using Pytorch in Google Colab. I've written the following wrapper for the Pytorch ResNet model.
class ResNet50(): def __init__(self): self.model = resnet50(pretrained=True) self.model = nn.Sequential(*(list(self.model.children())[:-1])) for param in self.model.parameters(): param.requires_grad = False self.model.eval() self.model.to(device) def get_visual_descriptor_size(self, image_shape=(3,224,224)): input = torch.rand(*image_shape) input = torch.unsqueeze(input, 0) input = input.to(device) out = self.model(input).cpu() out = torch.squeeze(out) out = out.data.numpy() return out.shape def get_res_image_descriptor(self, image): preprocess = transforms.Compose([ transforms.ToTensor(), transforms.Normalize( mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) ]) img_data = cv2.resize(image.copy(), (224, 224)) img_data = preprocess(img_data) img_data = torch.unsqueeze(img_data, 0) img_data = img_data.to(device) resnet50_feature = self.model(img_data).cpu() resnet50_feature = torch.squeeze(resnet50_feature).data.numpy() return resnet50_feature
I'm calling the
get_res_image_descriptorin a loop for several images. However, every time I call it the GPU consumption increases and eventually I get the following error:
RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 14.73 GiB total capacity; 13.21 GiB already allocated; 19.88 MiB free; 13.83 GiB reserved in total by PyTorch)
It was working before and I'm not sure if I accidentally changed something. What could be causing this?
How to copy folders from one Google team drive to another
So I'm pretty stuck with this. I've checked lots of tutorials and code for copying folders on Google Drive, but they do not have Shared Drives (Team Drives) capability. The closet I got was this code on Google Collab.
#path that contains folder you want to copy %cd /gdrive/My Drive/... %cp -av YOUR_FOLDER NEW_FOLDER_COPY
Note: this is Linux code so I'm pretty sure I need to translate it to python for use on Google Collaboratory. When I tried it in Google Colab, it only did 4 files in one hour so this isn't a good solution as it is.
Is there another way to copy Team Drive folders with all the files? I'd really like Google Colab code since I'm bad with rclone and most other applications. I'd appreciate some help! :)