Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107665

Re: Howw to prevent the duplication of any value in a column within a CSV file (python)

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Howw to prevent the duplication of any value in a column within a CSV file (python)
Date Tue, 26 Apr 2016 10:13:38 -0600
Lines 10
Message-ID <mailman.113.1461687261.32212.python-list@python.org> (permalink)
References <75e5d8dc-e15b-4350-95e8-490abd4aa14f@googlegroups.com> <CALwzidm6yaZKzMLmwvKzFyQ7rvhASp3vPmDA-CYG=iS9YokFuA@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de IJDjUelyL3wWalvleXXwLwzyI5eltA/95OgovLR80Jsw==
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'value,': 0.03; 'column': 0.07; 'subject:file': 0.07; 'cc:addr:python-list': 0.09; 'csv': 0.09; 'subject:CSV': 0.09; 'python.': 0.11; 'subject:python': 0.14; 'subject: \n ': 0.15; 'value.': 0.15; '2016': 0.16; 'cc:name:python': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'assuming': 0.22; 'am,': 0.23; 'fit': 0.23; 'header:In-Reply- To:1': 0.24; 'wondering': 0.25; 'entered': 0.27; 'message- id:@mail.gmail.com': 0.27; 'have,': 0.27; 'function': 0.28; 'values': 0.28; 'code': 0.30; 'tue,': 0.34; 'file': 0.34; 'received:google.com': 0.35; 'set.': 0.35; 'created': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'names': 0.38; 'does': 0.39; 'subject:the': 0.39; 'enough': 0.39; '26,': 0.72; 'column.': 0.84; 'subject:any': 0.84; 'subject:value': 0.84; 'to:none': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc :content-transfer-encoding; bh=afM0VzvRokj48wcxUH2e1e/OsRBuY2mzP/QYU1k0V44=; b=xG7+piEQ/pvMhQC0KMnWUrIYkhMIF6DDJersJlP03Hmw5ib/eDDUW2tICjHouYj6Ha /uAlRA+O2aOPA8w+JXfbovziKCzP0R/P/F6g0p5fUrqw+VjPqckBCW28lel5PJKyUqqo s/7z3b+H/46ieVrwrPhOrrovRoR4TxtPiXaxuCXm23ZcTK3rJdlV8tTiV0Ez1nviReVR AWlxIuzP1x7aBVFTPDYVElMzsbgqqMjwvi8nNYEjtXp9/EIl3zj3ljc8tpvrQXvtSWqo Dsvkt4dNc71NyuU7DoJUE/fkCidNC/ZomhkCYsAHitzRsvBh/eEkjoRSZPJw6/LIm/Di PMvg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-transfer-encoding; bh=afM0VzvRokj48wcxUH2e1e/OsRBuY2mzP/QYU1k0V44=; b=F7XT5dqVA4zBjN2ujfQG4aGFjipY9KXNnZRR3ap6KdEutlorzN5kox8yi1hyEHFh1a n9fxtDuIvxbIaPyOyGcZKjY8ih3Il7HPsK5SAl3JzrbO6LKWwMXouZ3DSb9mDkPXGRSb Ajl9ee00pVCO1DvvFQLkTtSccq7zjanr3L+D9H2SZckgjNgzBf3Ne5wRxwKvHGDWF6H0 ADUXzn2xh3ea5UhaqOkraP9j5OhybMdB04z2AFfYnuEn4uLBM22OPzVp1hWtkw9ZeBr7 TPqCbXza2f41heEZNVXMOrHgYt67zfkBmIQOrVdbmK/Sf0+nU36BUEZ338TMZP3okjfd 3YlA==
X-Gm-Message-State AOPr4FXy/Q3emWj4WOJs4Nboyd+RDIGJOCj8Kzb+KEAviUxbeZ39Gh+gf2X2hLdnImwiA2gJUMs/1FZ5cmRT0A==
X-Received by 10.50.26.169 with SMTP id m9mr19948995igg.68.1461687258184; Tue, 26 Apr 2016 09:14:18 -0700 (PDT)
In-Reply-To <75e5d8dc-e15b-4350-95e8-490abd4aa14f@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <CALwzidm6yaZKzMLmwvKzFyQ7rvhASp3vPmDA-CYG=iS9YokFuA@mail.gmail.com>
X-Mailman-Original-References <75e5d8dc-e15b-4350-95e8-490abd4aa14f@googlegroups.com>
Xref csiph.com comp.lang.python:107665

Show key headers only | View raw


On Tue, Apr 26, 2016 at 10:01 AM,  <peakgraphicz@gmail.com> wrote:
> I am wondering how to make my code function so it does not allow any of the same values to be entered into a column in my CSV file created through python. So I need to read into the CSV file and check if any names have already been entered. If they have, the user must not be allowed to enter this value.

Assuming the file is reasonably small enough to fit into memory,
create a set and populate it with the values in the column. When the
user enters a new value, check whether it's already in the set.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Howw to prevent the duplication of any value in a column within a CSV file (python) peakgraphicz@gmail.com - 2016-04-26 09:01 -0700
  Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Joel Goldstick <joel.goldstick@gmail.com> - 2016-04-26 12:08 -0400
    Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 10:05 -0700
      Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-26 20:10 -0400
  Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-26 10:13 -0600
    Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 10:00 -0700
      Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-26 13:50 -0600
  Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 10:05 -0700
    RE: Howw to prevent the duplication of any value in a column within a CSV file (python) Joaquin Alzola <Joaquin.Alzola@lebara.com> - 2016-04-26 19:05 +0000
    Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-26 13:51 -0600
      Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 13:07 -0700
        Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-26 14:19 -0600
          Re: Private message regarding: Howw to prevent the duplication of any value in a column within a CSV file (python) Ian Kelly <ian.g.kelly@gmail.com> - 2016-05-02 07:47 -0600
        Re: Howw to prevent the duplication of any value in a column within a CSV file (python) MRAB <python@mrabarnett.plus.com> - 2016-04-26 21:23 +0100
          Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-26 23:26 -0700
            Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Chris Angelico <rosuav@gmail.com> - 2016-04-27 16:37 +1000
              Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Adam Davis <peakgraphicz@gmail.com> - 2016-04-27 05:23 -0700
                Re: Howw to prevent the duplication of any value in a column within a CSV file (python) Andrew Ongko <andrew.ongko@gmail.com> - 2016-04-27 19:57 +0700
                Re: Howw to prevent the duplication of any value in a column within a CSV file (python) darnold <darnold992000@yahoo.com> - 2016-04-27 08:49 -0700
  RE: Howw to prevent the duplication of any value in a column within a CSV file (python) Joaquin Alzola <Joaquin.Alzola@lebara.com> - 2016-04-26 16:07 +0000

csiph-web