将excel / csv文件视为仅考虑行而不是行和列的文件

时间:2018-04-02 15:47:16

标签: python excel pandas dataframe

我需要从excel文件中获取一个特定的行,并且这样做我在python中使用pandas库。以下是:

path = r"C:\Users\Utilizador\Desktop\vendas2017.xlsx"
dataframe = pd.read_excel(path)
print dataframe.ix[1]
### I'm getting this, in which the second row columns are the first row corresponding cells:
sales | meatMenu | fishMenu | vegetarianMenu ### very first row
323   |    1     |    0     |  0             ### second row


## I want to print something like (as a truly independent plain text, one row at a time), without any column concept associated:
sales | meatMenu | fishMenu | vegetarianMenu ### very first row
323   |    1     |    0     |  0             ### second row
friday| sunny    | Mild     | rainy          ### third row
1     |    0     |    1     |  0             ### fourth row

我只想将行作为纯文本而不是索引,作为相应的列,即第一行/行内容单元格。你知道任何解决方法吗?

非常感谢和复活节快乐!

0 个答案:

没有答案