Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python arrays
#3
Sorry.

I tried array2 = np.array(data2)
and it eventually worked.
But now i am supposed to convert my data2, which is a list of strings to integers.
I tried
for i in range(len(data2)):
data2[i] = int(data2[i])

and its saying: int() argument must be a string or a number, not 'list'

I am not sure of another way to do this.
Reply


Messages In This Thread
Python arrays - by abdullahali - Oct-30-2018, 03:19 PM
RE: Python arrays - by Larz60+ - Oct-30-2018, 04:27 PM
RE: Python arrays - by abdullahali - Oct-30-2018, 04:56 PM
RE: Python arrays - by LeSchakal - Oct-31-2018, 12:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: only size-1 arrays can be converted to Python scalars RainbowTrish1 1 4,583 Oct-29-2020, 06:16 PM
Last Post: DeaD_EyE
  Fixing arrays output in Python WLST script pkbash 2 5,257 Feb-28-2019, 06:20 PM
Last Post: pkbash

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020