1 Star 0 Fork 0

fanyangchu/PythonCode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ReadFromCSV.py 751 Bytes
一键复制 编辑 原始数据 按行查看 历史
Prince Gangurde 提交于 2020-04-04 01:40 . Update ReadFromCSV.py
__author__ = 'vamsi'
import pandas as pd #pandas library to read csv file
from matplotlib import pyplot as plt #matplotlib library to visualise the data
from matplotlib import style
style.use("ggplot")
"""reading data from SalesData.csv file
and passing data to dataframe"""
df = pd.read_csv("..\SalesData.csv") #Reading the csv file
x = df["SalesID"].as_matrix() # casting SalesID to list #extracting the column with name SalesID
y = df["ProductPrice"].as_matrix() # casting ProductPrice to list
plt.xlabel("SalesID") # assigning X-axis label
plt.ylabel("ProductPrice") # assigning Y-axis label
plt.title("Sales Analysis") # assigning Title to the graph
plt.plot(x, y) # Plot X and Y axis
plt.show() # Show the graph
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fanych/pythoncode.git
git@gitee.com:fanych/pythoncode.git
fanych
pythoncode
PythonCode
master

搜索帮助