[PYTHON] Every time I try to read a csv file using pandas, I get a numpy error.

When I tried to read the csv file using pandas, the following error message was displayed.

Traceback (most recent call last):
  File "C:\python\iris_pandas.py", line 1, in <module>
    import pandas as pd
  File "C:\python\pandas\__init__.py", line 22, in <module>
    from pandas.compat.numpy import (
  File "C:\python\pandas\compat\numpy\__init__.py", line 9, in <module>
    _np_version = np.__version__
AttributeError: module 'numpy' has no attribute '__version__'

The code is below.

import pandas as pd
df = pd.read_csv('IRIS.csv')
df

From the error message, I thought that there was something wrong with numpy, so when I rewrote pandas to numpy, the following error message was displayed.

Traceback (most recent call last):
  File "C:\python\iris_pandas.py", line 3, in <module>
    df = pd.read_csv('IRIS.csv')
AttributeError: module 'numpy' has no attribute 'read_csv'

I would like to know if there is any solution.

Recommended Posts

Every time I try to read a csv file using pandas, I get a numpy error.
How to paste a CSV file into an Excel file using Pandas
I tried to get a database of horse racing using Pandas
[Python] How to read a csv file (read_csv method of pandas module)
How to read a CSV file with Python 2/3
I tried reading a CSV file using Python
[Introduction to Pandas] Read a csv file without a column name and give it a column name
Try to get a web page and JSON file using Python's Requests library
Read CSV file: pandas
When I try to import pandas on macOS I get the error No module named'_bz2'
I get an error when I try to raise Python to 3 series using pyenv on Catalina
Try to operate an Excel file using Python (Pandas / XlsxWriter) ①
[Python] I want to get a common set between numpy
Try to operate an Excel file using Python (Pandas / XlsxWriter) ②
I tried to convert a Python file to EXE (Recursion error supported)
I tried to make a regular expression of "time" using Python
I tried to get a list of AMI Names using Boto3
Try to get statistics using e-Stat
How to create a CSV dummy file containing Japanese using Faker
[Python] Read a csv file with a large data size using a generator
Read and format a csv file mixed with comma tabs with Python pandas
I want to be cursed by a pretty girl every time I sudo! !!
When I try to go back using chainer, it fits a little
I get an error with import pandas.
Read a character data file with numpy
How to read CSV files in Pandas
Download Pandas DataFrame as a CSV file
Various ways to read the last line of a csv file in Python
I want to drop a file on tkinter and get its path [Tkinter DnD2]
I want to make a music player and file music at the same time
I want to write an element to a file with numpy and check it.
Save an array of numpy to a wav file using the wave module
When I get a chromedriver error in Selenium
Try using django-import-export to add csv data to django
I want to visualize csv files using Vega-Lite!
[Python] How to read excel file with pandas
I read "How to make a hacking lab"
I made a tool to get new articles
I want to write to a file with Python
How to read a file in a different directory
I tried to make a ○ ✕ game using TensorFlow
When I try to install mysqlclient with Django, I get error: command'gcc' failed with exit status 1.
After installing basemap, I got a numpy import error
Get the file name in a folder using glob
I want to give a group_id to a pandas data frame
Try creating a compressed file using Python and zlib
(Python) Try to develop a web application using Django
I tried to touch the CSV file with Python
I want to randomly sample a file in Python
How to convert JSON file to CSV file with Python Pandas
I tried to get an AMI using AWS Lambda
[Python] How to deal with pandas read_html read error
Try face detection in real time using a webcam
[Python] A memo to write CSV vertically with Pandas
I tried reading data from a file using Node.js.
Python script to create a JSON file from a CSV file
I want to restart CentOS 8 on time every day.
2 ways to read all csv files in a folder
I read the Chainer reference (updated from time to time)
Try to solve Sudoku at explosive speed using numpy
I tried to draw a configuration diagram using Diagrams