I have a pythonList of strings:
pythonList= ['Pricing1', 'Expense_Inflation_Rate_Annual.fac', 'Vertical', 'MNT_INFL_PC']
When I try to access all the strings by index like pythonList[1] they work just fine.
I converted the array into a numpyArray so I could use the np.where function, but now when I try to access all the strings like numpyArray[1] the 'Expense_Inflation_Rate_Annual.fac' value now holds '<str_, len() = 33>' instead while the other 3 work as intended.
My code for the conversion is simply:
numpyArray = np.array(pythonList)
Edit:
For more context I am using Python 3.9.2 and have discovered with testing that numpy does not like strings longer than 30 characters and anything more than 30 gets the <str_, len() = ##> input.
Here is the code I used to read in pythonList:
with open (r'c:\\temp\{}'.format(resultFileName)) as lp:
fileData = lp.readlines()
pythonList= []
for row in fileData:
pythonList.append(row.split(','))
numpyArray= np.array(pythonList)
If anyone could provide more detail on this, it would be greatly appreciated.
Thanks.