简体   繁体   中英

having problem in importing pandas in jupyter notebook

This is popping up after I run the code import pandas as pd

  NameError                                 Traceback (most recent call last)
    <ipython-input-3-7dd3504c366f> in <module>
    ----> 1 import pandas as pd


c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pandas\__init__.py in <module>
     49 import pandas.core.config_init
     50 
---> 51 from pandas.core.api import (
     52     # dtype
     53     Int8Dtype,

c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pandas\core\api.py in <module>
     13 

enter code here

     14 from pandas.core.algorithms import factorize, unique, value_counts
---> 15 from pandas.core.arrays import Categorical
     16 from pandas.core.arrays.boolean import BooleanDtype
     17 from pandas.core.arrays.floating import Float32Dtype, Float64Dtype

c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pandas\core\arrays\__init__.py in <module>
      5 )
      6 from pandas.core.arrays.boolean import BooleanArray
----> 7 from pandas.core.arrays.categorical import Categorical
      8 from pandas.core.arrays.datetimes import DatetimeArray
      9 from pandas.core.arrays.floating import FloatingArray

c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pandas\core\arrays\categorical.py in <module>
----> 1 from csv import QUOTE_NONNUMERIC
      2 from functools import partial
      3 import operator
      4 from shutil import get_terminal_size
      5 from typing import Dict, Hashable, List, Sequence, Type, TypeVar, Union, cast

~\OneDrive\Desktop\python\Ardent\csv.py in <module>
   1175   {
   1176    "cell_type": "code",
-> 1177    "execution_count": null,
   1178    "id": "authorized-neighbor",
   1179    "metadata": {},

NameError: name 'null' is not defined

**

It seems like you assigned a null value to a key in a dictionary inside csv.py.

Is null a variable?

If you want to assign an "empty"/"null" value in python , you should use None . null is not a type in python.

You can try like this:

import json
mydict = json.dumps(data)

Whatever data you are converting into dict make sure it should be json.dumps() before print or process otherwise the null will be treated as variable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM