简体   繁体   English

我如何克服 Python pandas 和 matplotlib 中给定数据框的列名问题

[英]How can i overcome issue on column name of the given data frame in Python pandas and matplotlib

I have been trying to extract some data from a dataframe, where i am came with this issue.我一直在尝试从数据框中提取一些数据,我遇到了这个问题。 while i am trying to plot a line plot using matplotlib.plot(column_name) The dataframe had the column name " Ladder score" But this cannot excuted in the matplotlib plot function, we can't use space between words.当我尝试使用 matplotlib.plot(column_name) 绘制线图时,数据框的列名称为“Ladder score”但这不能在 matplotlib 绘图函数中执行,我们不能在单词之间使用空格。 But the given column in dataframe put column name like that.但是数据框中的给定列将列名放在这样的位置。 How can i overcome this issue.我怎样才能克服这个问题。

image of error: https://drive.google.com/file/d/1LhKnZ9THGBDLryT3rwOxnnKixr4knDIE/view?usp=sharing错误图片: https : //drive.google.com/file/d/1LhKnZ9THGBDLryT3rwOxnnKixr4knDIE/view?usp=sharing

只需使用

plt.plot(b[" Ladder score"])

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将数据框中的列与 Pandas 中第二个数据框中具有相同名称/位置的列中的值进行比较? - How can I compare a column in a data frame by a value in a column with the same name/place in a second dataframe in Pandas? 在给定某些约束的情况下,如何使用 Python 遍历目录中的文件和 output 和 pandas 数据框? - How can I use Python to walk through files in directories and output a pandas data frame given certain constraints? Python-如何在列数据框名称pandas中重置数字顺序? - Python - how to reset the order of number in the column data frame name pandas? 我需要基于列名从一个数据框到另一个数据框的值在 python pandas 中 - I need values from one data frame to another data frame in python pandas based on column name Pandas Python-如何将数组(与数据框的长度不同)转换为数据框,并保留行名和列名? - pandas python - how to convert array (different length with data frame) to data frame and keep the row and column name? 如何将列的一部分添加到新的 Pandas 数据框中? - How can I add parts of a column to a new pandas data frame? Python Pandas:将具有列名的数据框列合并为一列 - Python Pandas: Merge Columns of Data Frame with column name into one column 如何在pandas数据框列上打印给定字符串的出现? - How to print occurence of given string on pandas data frame column? 熊猫:如何按列名排序数据框并添加空列 - pandas: how could I order data frame by column name and add empty column Python Pandas:如何将DataFrame groupby的结果放入具有新列名的数据框中? - Python Pandas: How to put result of DataFrame groupby in a data frame with new column name?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM