How to read a .xlsx with pd.read

I am trying to read a xlsx file but when i run the code I have the next issue. Can someone suggest me how to fix it!

import pandas as pd
import pickle
import numpy as np
import nltk
from nltk import word_tokenize
from nltk.corpus import stopwords
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = [18.0, 8.0]
import re
import string


leyes = pd.read_pickle('C:\\Users\\diese\\OneDrive\\Documentos\\GitHub\\MCPP_diego_ramirez\\Proyectof\\leyes.xlsx')



 A load persistent id instruction was encountered,but no persistent_load function was specified.

1 answer

  • answered 2018-05-16 04:56 hd1

    Try read_excel?

    frame = pd.read_excel('filen.xlsx', engine='xlrd')