googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.21k stars 727 forks source link

Unable to save the test variables in Google Colab #429

Closed fasilColab closed 1 year ago

fasilColab commented 5 years ago

I am running a code on Google colaboratory. But getting error while trying to fit the model. I am referring to youtube Video Tutorial. please help to fix the issue.

import tensorflow as tf import pandas as pd from google.colab import files files.upload() x_train = pd.read_csv("xtrain.csv", header="None") y_train = pd.read_csv("ytrain.csv", header="None") x_test = pd.read_csv("xtest.csv", header="None") y_test = pd.read_csv("ytest.csv", header="None")

Error

`

    ValueError                               
     Traceback (most recent call last)
     <ipython-input-14-7764090ccac4> in <module>()
      1 files.upload()
            ----> 2 x_train = pd.read_csv("xtrain.csv", header="None")
      3 y_train = pd.read_csv("ytrain.csv", header="None")
      4 x_test = pd.read_csv("xtest.csv", header="None")
      5 y_test = pd.read_csv("ytest.csv", header="None")
     /usr/local/lib/python3.6/dist-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, skip_footer, doublequote, delim_whitespace, as_recarray, compact_ints, use_unsigned, low_memory, buffer_lines, memory_map, float_precision)
    707                     skip_blank_lines=skip_blank_lines)
    708 
--> 709         return _read(filepath_or_buffer, kwds)
    710 
    711     parser_f.__name__ = name

/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py in _read(filepath_or_buffer, kwds)
    447 
    448     # Create the parser.
--> 449     parser = TextFileReader(filepath_or_buffer, **kwds)
    450 
    451     if chunksize or iterator:

/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py in __init__(self, f, engine, **kwds)
    816             self.options['has_index_names'] = kwds['has_index_names']
    817 
--> 818         self._make_engine(self.engine)
    819 
    820     def close(self):

/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py in _make_engine(self, engine)
   1047     def _make_engine(self, engine='c'):
   1048         if engine == 'c':
-> 1049             self._engine = CParserWrapper(self.f, **self.options)
   1050         else:
   1051             if engine == 'python':

/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py in __init__(self, src, **kwds)
   1679         kwds = kwds.copy()
   1680 
-> 1681         ParserBase.__init__(self, kwds)
   1682 
   1683         if (kwds.get('compression') is None and

/usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py in __init__(self, kwds)
   1278         # GH 16338
   1279         elif self.header is not None and not is_integer(self.header):
-> 1280             raise ValueError("header must be integer or list of integers")
   1281 
   1282         self._name_processed = False
ValueError: header must be integer or list of integers

`

metrizable commented 1 year ago

Since this issue was filed a while ago, and there have been a number of upgrades to our ecosystem including TensorFlow and Pandas since then, if you are still experiencing the issue, please open a new issue and provide a minimal reproducible notebook.