# how to randomize a matrix keeping the rows fixed in python

I’m trying to randomize all the rows of my DataFrame but with no success. What I want to do is from this matrix A= [ 1 2 3 4 5 6 7 8 9 ] to this A_random=[ 4 5 6 7 8 9 1 2 3 ] I’ve tried with np. random.shuffle but it… Read More how to randomize a matrix keeping the rows fixed in python

# Google colab : ModuleNotFoundError: No module named 'pymorphy2'

Im doing my project in university using Morphological Analyzer of text(russian language).Google Colab cant find the module named pymorphy2. from pymorphy2 import MorphAnalyzer Maybe there are sollutions for such problems? >Solution : Did you try to pip install it? Write this and execute the cell: !pip install pymorphy2

# Convert a value as a result of google colab which has e to a real value?

I have something like 3.34985746e-06 as a result of a calculation in colab. How can I convert this to a more readable value? >Solution : If you’re just confused why it’s represented as a string you can get it back to a float using float(). In [11]: val = ‘{:e}’.format(12312312312123) In [12]: val Out[12]: ‘1.231231e+13’… Read More Convert a value as a result of google colab which has e to a real value?

# Display multiple values in col on barplot

So I have a column of my dataframe that looks like this: 10 first rows of the column expeditions[‘first_ascent_country’] 0 New Zealand, USA, UK 1 UK 2 France 3 UK, Nepal 4 India 5 W Germany 6 Spain 7 W Germany 8 Japan, Nepal 9 Japan, Nepal It gives information on which country climbed a… Read More Display multiple values in col on barplot

# Colab Notebook: Cannot import name 'container_abcs' from 'torch._six'

I’m trying to run the deit colab notebook found here: https://colab.research.google.com/github/facebookresearch/deit/blob/colab/notebooks/deit_inference.ipynb but I’m running into an issue in the second cell, specifically the import timm line, which returns this: ImportError: cannot import name ‘container_abcs’ from ‘torch._six’ >Solution :  This problem has been previously raised here: you need to have the last version of timm library,… Read More Colab Notebook: Cannot import name 'container_abcs' from 'torch._six'

# Numpy: Get help on the add function

I am trying to write a simple NumPy program to get help on the add function using google colab notebook. The solution is: print(np.info(np.add)) It should return: add(x1, x2[, out]) Add arguments element-wise. Parameters ———- x1, x2 : array_like The arrays to be added. If “x1.shape != x2.shape“, they must be broadcastable to a common… Read More Numpy: Get help on the add function

# Tensorflow Value for attr 'TI' of float is not in the list of allowed values when One Hot Encoding

I have this code that takes a tensor with a shape of (3, 3) and reshapes it to (9,). After that it applies a one_hot function but it throws an error. This is the code: import tensorflow as tf t1 = tf.constant([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=tf.float32) t2 = tf.constant([[1], [-1],… Read More Tensorflow Value for attr 'TI' of float is not in the list of allowed values when One Hot Encoding

# Files and Folders in Google Colab

I just started using Google colab for my projects and I tried to create and parse text files. But I don’t quite understand how the file directory works here. Below are my questions: On the left navigation pane (in the picture) that show the list of folders and files. Are they in my drive, if… Read More Files and Folders in Google Colab