0

Trying to use drive link to load a dataset in a variable named url and it's running but when i run data.head(10) its showing error

import pandas as pd

url = 'https://drive.google.com/file/d/16M5AvCjoJKDVsqoBI2Wbgqxt-JPBEN9a/view?usp=sharing'
names = ['Class', 'id', 'Sequence']
data = pd.read_csv(url, names = names)
data.head(10)

error:

/usr/local/lib/python3.10/dist-packages/google/colab/data_table.py:175: PerformanceWarning:   DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
    dataframe = dataframe.reset_index()
    /usr/local/lib/python3.10/dist-packages/google/colab/data_table.py:205: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
    df.insert(df.shape[1], _FAKE_DATAFRAME_COLUMN, [None] * df.shape[0])
    
 Error: Runtime no longer has a reference to this dataframe, please re-run this cell and try again.
StephanT
  • 649
  • 5
  • 12
  • Check; https://stackoverflow.com/a/66991145/8658598 . Also please use code blocks. – doneforaiur Jul 04 '23 at 12:03
  • @doneforaiur I'm pretty sure that the reference is about reloading modules/packages, not files. – StephanT Jul 04 '23 at 14:25
  • Question not very well formatted. – William Jul 05 '23 at 00:32
  • Alternatively, if there's no restriction, you can mount your google drive and directly access the `.csv` file from colab. This thread would guide you to do that: https://stackoverflow.com/a/52300696/12317368 – Ro.oT Jul 07 '23 at 17:06

0 Answers0