我正在尝试阅读此Excel工作表:https : //1drv.ms/x/s!AkiO0urKs8OwgSDHRD2IoE4LPBtt与pandas(python)
#!/usr/bin/python
# -*- coding: latin-1 -*-
import os, sys
import urllib2
from collections import Counter
import json
from pprint import pprint
import pandas as pd
from pandas import ExcelWriter
from pandas import ExcelFile
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
file_name = "test.xlsx"
df = pd.read_excel(file_name, sheetname='Resultados 1 fase')
print df
我正在尝试按索引获取匹配结果,例如:
1 - 1 x 0
2 - 2 x 2
3 - 0 x 2
4 - 4 x 0
...
但是,当我看到上面的代码结果很多列标题都是NaN时,我不知道如何从中提取所需信息。谁能帮我这个?
谢谢
这应该为您提供所需的输出:
df = pd.read_excel('test.xlsx', skiprows=3, header=None, parse_cols='F:H')
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句