Python Forum
importing zip file on kaggle??
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
importing zip file on kaggle??
#1
Hi everyone,
I am trying to import a zip file on kaggle. But I couldn't do it i tried some solutions but it didn't help. Can you help me about this issue? Thanks.
Reply
#2
(Mar-07-2019, 07:35 AM)GuJu Wrote: But I couldn't do it i tried some solutions but it didn't help. Can you help me about this issue?

You really need to start sharing more info with your questions, like code, errors/problem with it, what exactly you have tried to resolve the issue and how/why it doesnt't work, etc.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
Hi, the code i used is
df = pd.read_csv('../input/PollenDataset.zip', compression='zip', header=0, sep=',', quotechar='"')
and the error i always get
Error:
FileNotFoundError Traceback (most recent call last) <ipython-input-10-5aa172058c5d> in <module>() ----> 1 df = pd.read_csv('../input/PollenDataset.zip', compression='zip', header=0, sep=',', quotechar='"') /opt/conda/lib/python3.6/site-packages/pandas/io/parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, doublequote, delim_whitespace, low_memory, memory_map, float_precision) 676 skip_blank_lines=skip_blank_lines) 677 --> 678 return _read(filepath_or_buffer, kwds) 679 680 parser_f.__name__ = name /opt/conda/lib/python3.6/site-packages/pandas/io/parsers.py in _read(filepath_or_buffer, kwds) 438 439 # Create the parser. --> 440 parser = TextFileReader(filepath_or_buffer, **kwds) 441 442 if chunksize or iterator: /opt/conda/lib/python3.6/site-packages/pandas/io/parsers.py in __init__(self, f, engine, **kwds) 785 self.options['has_index_names'] = kwds['has_index_names'] 786 --> 787 self._make_engine(self.engine) 788 789 def close(self): /opt/conda/lib/python3.6/site-packages/pandas/io/parsers.py in _make_engine(self, engine) 1012 def _make_engine(self, engine='c'): 1013 if engine == 'c': -> 1014 self._engine = CParserWrapper(self.f, **self.options) 1015 else: 1016 if engine == 'python': /opt/conda/lib/python3.6/site-packages/pandas/io/parsers.py in __init__(self, src, **kwds) 1706 kwds['usecols'] = self.usecols 1707 -> 1708 self._reader = parsers.TextReader(src, **kwds) 1709 1710 passed_names = self.names is None pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader.__cinit__() pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._setup_parser_source() /opt/conda/lib/python3.6/zipfile.py in __init__(self, file, mode, compression, allowZip64) 1088 while True: 1089 try: -> 1090 self.fp = io.open(file, filemode) 1091 except OSError: 1092 if filemode in modeDict: FileNotFoundError: [Errno 2] No such file or directory: '../input/PollenDataset.zip'
Reply
#4
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import os
print(os.listdir("../input"))
['honey-bee-pollen', 'flower']


And i add the same dataset(zip) again maybe something wrong. This is the code to look all the zip files.
import zipfile

def main():
    print(zipfile.is_zipfile('../input/flower/flowers.zip')) # it returns True

if __name__ == '__main__': main()
False

And when i use this code
import glob
glob.glob('./*.zip')


[]
Reply
#5
(Mar-10-2019, 11:45 AM)GuJu Wrote: FileNotFoundError: [Errno 2] No such file or directory: '../input/PollenDataset.zip'
(Mar-10-2019, 01:07 PM)GuJu Wrote: ['honey-bee-pollen', 'flower']
Well, as the error clearly states and your tests confirm - the file is not there...
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  New2Python: Help with Importing/Mapping Image Src to Image Code in File CluelessITguy 0 718 Nov-17-2022, 04:46 PM
Last Post: CluelessITguy
  Problem with importing Python file in Visual Studio Code DXav 7 5,061 Jun-15-2022, 12:54 PM
Last Post: snippsat
  importing functions from a separate python file in a separate directory Scordomaniac 3 1,363 May-17-2022, 07:49 AM
Last Post: Pedroski55
  Importing a function from another file runs the old lines also dedesssse 6 2,540 Jul-06-2021, 07:04 PM
Last Post: deanhystad
  Importing text file into excel spreadsheet with formatting david_dsmn 1 3,604 Apr-05-2021, 10:21 PM
Last Post: david_dsmn
  importing a CSV file into Python russoj5 1 2,945 Aug-02-2020, 12:03 AM
Last Post: scidam
  Importing data from a text file into an SQLite database with Python macieju1974 7 4,092 Jun-29-2020, 08:51 PM
Last Post: buran
  importing CSV file into a OOP Class table using Python faruk61 1 2,946 Apr-15-2020, 12:00 PM
Last Post: faruk61
  importing CSV file into a HTML table using Python trybakov 1 2,275 Feb-22-2020, 09:47 PM
Last Post: scidam
  Importing variables from another file IILawrenceII 7 9,992 Jan-18-2020, 12:31 PM
Last Post: IILawrenceII

Forum Jump:

User Panel Messages

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