Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7916583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:51:42+00:00 2026-06-03T14:51:42+00:00

I am a beginner in Python. My data table (Table1) has 21 columns and

  • 0

I am a beginner in Python. My data table (Table1) has 21 columns and thousands of rows. It is so huge I cannot open it on my laptop. It looks somewhat like this:

ABCDEFG, HIJKLMNO, PQRSTUVW, TEYHDSJD ……..

TRGFHFJ, GDGSANTO, JDKNVWWR, URNWHJX ……..

…….

However, I need to reproduce a subset of this table that only consists of columns 10-21. I have tried the following:

import sys
import csv

with open(sys.argv[1], "r") as input:
   readinput = csv.reader(input, delimiter=',')
   with open("output.csv", 'wt') as output:
      writer=csv.writer(output, delimiter="\t")
      for row in input:
         values =  [row[10],row[11],row[12],row[13],row[14],row[15],row[16],row[17],row[18],row[19],row[20],row[21]]
         writer.writerow([values])
         print (row[10])

But it turns out the cvs.reader’s expression “row[10]” is not interpreting this as the 10th element of the row (=the 10th column). Instead, it gives me the 10th letter. So the output is not the 10th to 21st columns of Table1, but it is the 10th to 21st letters, somewhat like this:

K, L, M, N, O, “”, P, Q, R, S, T, U

S, A, N, T, O, “”, J, D, K, N, V, W

What am I doing wrong? Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:51:44+00:00Added an answer on June 3, 2026 at 2:51 pm

    You’re using for row in input, I guess you wanted for row in readinput.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Python beginner here, so I apologize if this question has a simple answer. (I
I'm a beginner in Python and have a file i've read in that has
As part of the last assignment in a beginner python programing class, I have
I've got a question related to a beginner Python snippet I've written to introduce
I am beginner in python, and I need to use some thirdparty function which
A python/django beginner's question: I have a datetime object (drive_date), a time object (start_time)
I'm a beginner with both Python and RegEx, and I would like to know
I am a beginner programmer, using python on Mac. I created a function as
I'm a beginner, with programming and Python. What I want to do is read
I am learning Python, following a book (Python Programming for the Absolute Beginner, 3rd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.