Python Forum
Insert a new column for Key Value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Insert a new column for Key Value
#1
Lightbulb 
hello guys,

I'm using the following code to save my list in a TXT file.
import numpy as np 
a = [s.strip() for s in contents.splitlines()]

np.savetxt(r'C:\Users\bruno\Desktop\FII\LL.txt',  
           a, 
           delimiter ="\t",
           fmt ='% s')
How can I add a new column and fill with an automatic Key Number?

Something like this:
Key Number | Address | Lat | Long | Status
1 | Street 1 | -27.47 | -47.21 | OK
2 | Street 2 | -28.47 | -46.25 | OK
3 | Street 3 | -29.47 | -45.25 | NOK
4 | Street 4 | -25.47 | -44.27 | OK
5 | Street 5 | -24.47 | -43.28 | NOK
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sqllite column insert nickzsche 2 1,530 Jan-06-2022, 11:45 PM
Last Post: lucasbazan
  Insert list in particular column! Help! vndywarhol 0 2,481 Sep-17-2018, 11:14 PM
Last Post: vndywarhol
  Insert using psycopg giving syntax error near "INSERT INTO" olgethorpe 4 15,626 Jul-21-2017, 07:39 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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