I am trying to import json file for the first time on google colab. This file is getting imported on my jupyter notebook without causing any problem.
This is my code:-
df=pd.read_json("E:/Data Science/FlipRobo/Assignments/NLP Sept project/Cell_Phones_and_Accessories.json", orient='records',dtype='dict')
df.head()
It is giving error as below:-
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-16-bb0b9f3e9bb6> in <module>()
----> 1 df=pd.read_json("E:/Data Science/FlipRobo/Assignments/NLP Sept project/Cell_Phones_and_Accessories.json", orient='records',dtype='dict')
2 df.head()
5 frames
/usr/local/lib/python3.6/dist-packages/pandas/io/json/_json.py in _parse_no_numpy(self)
1106 else:
1107 self.obj = DataFrame(
-> 1108 loads(json, precise_float=self.precise_float), dtype=None
1109 )
1110
ValueError: Expected object or value
Could someone help me with this?
You are trying to access a local file from a cloud service. First you have to upload you file to the colab environment.