首页 > 解决方案 > 如何'AttributeError:模块'pandas.core.common'没有属性'_dict_keys_to_ordered_list''

问题描述

错误:模块“pandas.core.common”没有属性“_dict_keys_to_ordered_list”

嗨,我认为我的熊猫有一些问题,这是以前从未发生过的。我重新安装了它,但没有修复它......有谁知道如何解决它?Thx!我在下面附上了我的所有代码,并认为这可能是我的 Python(3.0 版本)中的环境问题

import numpy as np
import pandas as pd
#import statsmodels.api as sm #Method1
import statsmodels.formula.api as smf #Method2
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import requests        #get requests
from bs4 import BeautifulSoup

def get_onepage(url):
    strhtml=requests.get(url)
    soup=BeautifulSoup(strhtml.text,'lxml')
    #data = soup.select('#main>div>div.mtop.firstMod.clearfix>div.centerBox>ul.newsList>li>a')
    journal = soup.select('div.sc_content > div.sc_info > span:nth-of-type(2) > a')
    citecount = soup.select('div.sc_content > div.sc_info > span:nth-of-type(3) > a')
    titlename = soup.select(' div.sc_content > h3 > a')
authorname = soup.select('div.sc_content > div.sc_info > span:nth-of-type(1)')
    yearpublish = soup.select('div.sc_content > div.sc_info > span.sc_time')

标签: pythonpython-3.x

解决方案


推荐阅读