Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37618
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.005 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'output': 0.04; 'collections': 0.09; 'received:151': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'skip:p 40': 0.15; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.17; 'import': 0.21; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; 'file': 0.32; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'data': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'received:libero.it': 0.84; 'subject:Increase': 0.84; 'subject:value': 0.84 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Vito De Tullio <vito.detullio@gmail.com> |
| Subject | Re: Increase value in hash table |
| Date | Thu, 24 Jan 2013 19:30:17 +0100 |
| References | <32d316a1-8551-4cb2-871f-b0a653c7d2f6@u7g2000yqg.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="ISO-8859-1" |
| Content-Transfer-Encoding | 7Bit |
| X-Gmane-NNTP-Posting-Host | ppp-174-47.26-151.libero.it |
| User-Agent | KNode/4.9.4 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1006.1359052235.2939.python-list@python.org> (permalink) |
| Lines | 29 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1359052235 news.xs4all.nl 6919 [2001:888:2000:d::a6]:57513 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:37618 |
Show key headers only | View raw
moonhkt wrote:
> Data file
> V1
> V2
> V3
> V4
> V4
> V3
>
> How to using count number of data ?
>
> Output
> V1 = 1
> V2 = 1
> V3 =2
> V4 = 2
import collections
with open(data_file) as f:
print(collections.Counter(f.readlines()))
it's a start
--
ZeD
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Increase value in hash table moonhkt <moonhkt@gmail.com> - 2013-01-22 23:26 -0800
Re: Increase value in hash table Chris Rebert <clp2@rebertia.com> - 2013-01-22 23:34 -0800
Re: Increase value in hash table moonhkt <moonhkt@gmail.com> - 2013-01-23 01:23 -0800
Re: Increase value in hash table Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-01-23 10:12 +0000
Re: Increase value in hash table Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-23 10:47 +0000
Multiple postings [was Re: Increase value in hash table] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-23 21:54 +1100
Re: Multiple postings [was Re: Increase value in hash table] rusi <rustompmody@gmail.com> - 2013-01-23 06:00 -0800
Re: Increase value in hash table Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-23 10:46 +0000
Re: Increase value in hash table Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-23 10:46 +0000
Re: Increase value in hash table Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-23 10:47 +0000
Re: Increase value in hash table moonhk <moonhkt@gmail.com> - 2013-01-23 23:33 +0800
Re: Increase value in hash table moonhkt <moonhkt@gmail.com> - 2013-01-23 07:39 -0800
Re: Increase value in hash table Dave Angel <d@davea.name> - 2013-01-23 17:35 -0500
Re: Increase value in hash table Vito De Tullio <vito.detullio@gmail.com> - 2013-01-24 19:30 +0100
csiph-web