Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Physician: One upon whom we set our hopes when ill and our dogs when well. -- Ambrose Bierce


devel / comp.lang.python / Re: Pandas: Multiple CSVs in one Zip file

SubjectAuthor
o Re: Pandas: Multiple CSVs in one Zip filePeter Otten

1
Re: Pandas: Multiple CSVs in one Zip file

<mailman.470.1629965051.4164.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=14751&group=comp.lang.python#14751

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: __pete...@web.de (Peter Otten)
Newsgroups: comp.lang.python
Subject: Re: Pandas: Multiple CSVs in one Zip file
Date: Thu, 26 Aug 2021 09:38:38 +0200
Lines: 20
Message-ID: <mailman.470.1629965051.4164.python-list@python.org>
References: <CADrxXXkz7PB-cbSOvHciS5Qmf7u=Dp=Xm4-TbtY2-3YG7PFdfw@mail.gmail.com>
<sg7htl$apj$1@ciao.gmane.io>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de efWOpLhz7y1/b4kzKA86yAxMj/chO/P2AtXm4kpiCANw==
Return-Path: <python-python-list@m.gmane-mx.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'containing': 0.05;
'message-id:@ciao.gmane.io': 0.09; 'pandas': 0.09;
'received:ciao.gmane.io': 0.09; 'received:gmane.io': 0.09;
'received:list': 0.09; 'url:discuss': 0.09; 'valueerror:': 0.09;
'from:addr:web.de': 0.16; 'janhangeer': 0.16; 'received:116.202':
0.16; 'received:116.202.254': 0.16; 'received:116.202.254.214':
0.16; 'subject:Pandas': 0.16; 'url-ip:151.101.1.69/32': 0.16;
'url-ip:151.101.129.69/32': 0.16; 'url-ip:151.101.193.69/32':
0.16; 'url-ip:151.101.65.69/32': 0.16; 'url:questions': 0.16;
'url:stackoverflow': 0.16; 'wrote:': 0.16; 'code.': 0.19; 'way.':
0.20; 'subject:file': 0.23; 'to:addr:python-list': 0.23; 'cannot':
0.24; 'zip': 0.27; 'wrong': 0.27; 'else': 0.27; 'single': 0.28;
'error': 0.28; 'header:User-Agent:1': 0.31; 'guess': 0.32; 'url-
ip:151.101.129/24': 0.32; 'url-ip:151.101.193/24': 0.32; 'unless':
0.33; 'header:In-Reply-To:1': 0.33; 'files': 0.33; 'contains':
0.35; 'case.': 0.35; 'hard': 0.38; 'file': 0.38; 'read': 0.38;
'use': 0.38; 'does': 0.38; 'example': 0.40; 'box': 0.61; 'url-
ip:172.67/16': 0.64; 'per': 0.64; 'your': 0.64; 'url-
ip:104.21/16': 0.65; 'url:net': 0.66; 'subject:one': 0.69;
'translated': 0.69; 'shows': 0.70; 'received:116': 0.71; 'deal':
0.74
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
In-Reply-To: <CADrxXXkz7PB-cbSOvHciS5Qmf7u=Dp=Xm4-TbtY2-3YG7PFdfw@mail.gmail.com>
Content-Language: en-US
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
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: <https://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: <sg7htl$apj$1@ciao.gmane.io>
X-Mailman-Original-References: <CADrxXXkz7PB-cbSOvHciS5Qmf7u=Dp=Xm4-TbtY2-3YG7PFdfw@mail.gmail.com>
 by: Peter Otten - Thu, 26 Aug 2021 07:38 UTC

On 26/08/2021 09:09, Abdur-Rahmaan Janhangeer wrote:

> Cannot read one file in a zip file if the zip file contains multiple files.
>
> This example does not work https://www.py4u.net/discuss/203494 as Pandas
> shows a ValueError: Multiple files found in ZIP file. Only one file per ZIP.
>
> If the Zip file has one file, fine else i cannot find a way. Thanks

You may have introduced an error when you translated the snippet to your
use case. What went wrong is hard to guess unless you provide the exact
failing code.

Pandas can read a single zipped file out of the box and the accepted
answer in your indirect link to

https://stackoverflow.com/questions/61971040/python-extract-csv-files-from-multiple-zip-files-and-combine-the-data

shows how to deal with zip files containing multiple files.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor