python数据可视化

问题遇到的现象和发生背景

import seaborn as sns
import matplotlib.pyplot as plt
import ssl

car_crashes = sns.load_dataset('car_crashes')
print(car_crashes.head(3))

成对关系

sns.pairplot(car_crashes)
plt.show()

二元变量分布

sns.jointplot(x="total",
y="alcohol",
data=car_crashes,
kind='scatter')
sns.jointplot(x="total",
y="alcohol",
data=car_crashes,
kind='kde')
sns.jointplot(x="total",
y="alcohol",
data=car_crashes,
kind='hex')

问题相关代码,请勿粘贴截图

Traceback (most recent call last):
File "G:\python39\lib\site-packages\numpy\core_init_.py", line 23, in
from . import multiarray
File "G:\python39\lib\site-packages\numpy\core\multiarray.py", line 10, in
from . import overrides
File "G:\python39\lib\site-packages\numpy\core\overrides.py", line 6, in
from numpy.core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath: 找不到指定的程序。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "G:/zz.py", line 2, in
import seaborn as sns
File "G:\python39\lib\site-packages\seaborn_init.py", line 2, in
from .rcmod import * # noqa: F401,F403
File "G:\python39\lib\site-packages\seaborn\rcmod.py", line 5, in
import matplotlib as mpl
File "G:\python39\lib\site-packages\matplotlib_init
.py", line 104, in
import numpy
File "G:\python39\lib\site-packages\numpy_init.py", line 140, in
from . import core
File "G:\python39\lib\site-packages\numpy\core_init
.py", line 49, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.9 from "G:\python39\pythonw.exe"
  • The NumPy version is: "1.23.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: DLL load failed while importing _multiarray_umath: 找不到指定的程序。

建议你看下这篇博客python点云可视化