【发布时间】:2022-01-15 05:56:18
【问题描述】:
我被分配了一项任务,我应该根据另一个列元素绘制一个元素。
代码如下:
# TODO: Plot the Male employee first name on 'Y' axis while Male salary is on 'X' axis
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_excel("C:\\users\\HP\\Documents\\Datascience task\\Employee.xlsx")
print(data.head(5))
输出:
First Name Last Name Gender Age Experience (Years) Salary
0 Arnold Carter Male 21 10 8344
1 Arthur Farrell Male 20 7 6437
2 Richard Perry Male 28 3 8338
3 Ellia Thomas Female 26 4 8870
4 Jacob Kelly Male 21 4 548
如何绘制“性别”为男性的前 5 行的“名字”列与“工资”列。
【问题讨论】:
标签: python pandas matplotlib