python打印星图
Diamonds are a data scientist’s best friend. More specifically, the diamond dataset found on Kaggle. In this article, I will walk through a simple workflow to create a Star Chart (aka Spider Chart or Radar Charts). This tutorial was adapted from the wonderful workflow of Alex at Python Charts. All of the code in this article and the needed dataset are available on GitHub.
钻石是数据科学家的最好朋友。 更具体地说, 在Kaggle上找到的菱形数据集。 在本文中,我将通过一个简单的工作流程来创建星图(又名蜘蛛图或雷达图)。 本教程改编自Python Charts的Alex出色的工作流程。 GitHub上提供了本文中的所有代码和所需的数据集。
钻石是数据科学家的最好朋友 (Diamonds are a Data Scientist’s Best Friend)
To begin you will need a few libraries. I am running Python 3. I created this workflow using a Jupyter notebook, pandas, matplotlib, and numpy. These packages can be installed via pip or conda if they are not already on your system.
首先,您将需要一些库。 我正在运行Python3。我使用Jupyter笔记本,pandas,matplotlib和numpy创建了此工作流程。 如果这些软件包尚未安装在系统上,则可以通过pip或conda进行安装。
pip install jupyterlab
pip install pandas
pip install matplotlib
pip install numpy
The dataset can be downloaded from Kaggle and should be around 3.2 MB. I have included a copy of the dataset on the Github. I have the dataset in the data folder. Load the dataset with pandas, drop the extra index column, and we are off!
数据集可以从Kaggle下载,并且大约为3.2 MB。 我已经在Github上包含了数据集的副本。 我在数据文件夹中有数据集。 用大熊猫加载数据集,删除多余的索引列,我们关闭了!
df = pd.read_csv("data/diamonds.cs