Python Forum
Adding Columns to CSV using iterator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding Columns to CSV using iterator
#6
I can't be much help since my python isn't great, but I can offer a few snippets of code that may be useful..

df.insert(12, 'Column Name:', "")                                 # insert new blank column
df.insert(13, 'Column Name:', "")                                 # insert new blank column

df.iloc[1, 12] = 'Data here'                           # write to cell
Not sure if it would work, but I'd try something like:

counter = 2
list_total = len(get total of items in column)

df.iloc[1, 12] = '98383'

while counter <= list_total:
    increment = counter
    df.iloc[counter, 12] = '98383' + increment 
    counter = counter + 1
Reply


Messages In This Thread
Adding Columns to CSV using iterator - by pstarrett - Jan-09-2018, 05:00 AM
RE: Adding Columns to CSV using iterator - by buran - Jan-09-2018, 08:19 AM
RE: Adding Columns to CSV using iterator - by buran - Jan-16-2018, 07:10 AM
RE: Adding Columns to CSV using iterator - by digitalmatic7 - Jan-16-2018, 08:35 AM
RE: Adding Columns to CSV using iterator - by buran - Jan-19-2018, 07:17 AM
RE: Adding Columns to CSV using iterator - by buran - Jan-21-2018, 07:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Merging rows and adding columns based on matching index pythonnewbie78 3 748 Dec-24-2023, 11:51 AM
Last Post: Pedroski55
  numpy adding columns rwahdan 4 2,283 Sep-21-2021, 08:25 PM
Last Post: deanhystad
  Tesseract-ocr ->iterator.WordFontAttributes() does not work Maia07 0 3,373 Sep-01-2018, 02:43 PM
Last Post: Maia07

Forum Jump:

User Panel Messages

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