I have a code that might have been developed for Python 3, but my Centos is running Python 2.7:
def generateWeights(self, name_list):
n = len(name_list)
weights = np.flip(np.arange(1, n), axis=0)
return weights / np.sum(weights)
I get for this part of the code:
AttributeError: 'module' object has no attribute 'flip'
Is there anything I should install/update, or an alternative code that will work?
Import part:
import requests
import urllib
import logging
import argparse
from lxml import objectify
import time
import pandas as pd
import numpy as np
import re
sudo yum install python34u python34u-wheel