在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ Python問答
夏夕 回答

var reg = new RegExp('[1-9][0-9]|[5-9]')

等待更簡潔的解法

涼汐 回答

樓主的意思是單個字符串是" O",而不是"你 O"嗎?但是" O" 也不滿足您開頭說的最短3個字符哇
又或者您說的是"你??O",想要得到['你',' O'] 這種嗎?

囍槑 回答
import pandas as pd
df = pd.DataFrame([['2018-3-8', 10],
    ['2018-3-9', 20],
    ['2018-3-10', 30],
    ['2018-3-11', 40],
    ['2018-3-12', 250],
    ['2018-3-13', 260],
    ['2018-3-14', 270],
    ['2018-3-15', 280]], columns=['日期', '數(shù)據(jù)1'])


def f(df):
    return (df[2] - df[1] < 100) and df[2] > df[1] and (df[1] - df[0] < 100) and df[1] > df[0] #增長大于0小于100

df[pd.rolling_apply(df, window=3, func=f)['數(shù)據(jù)1'] == True] # 滿足條件的日期(展示的是連續(xù)三天的最后一天)

判斷每個ID是否有連續(xù)3天【數(shù)據(jù)1】增長都大于0小于100的日期吧。

病癮 回答

經(jīng)過摸索,發(fā)現(xiàn)只能build之后才能實現(xiàn)。

我以為 回答

感覺是自己的設計思路出現(xiàn)了問題。應該先從客戶端發(fā)起通信申請,然后服務端進行返回,其實這項功能除了 websocket 能夠實現(xiàn), ajax 也能夠實現(xiàn)。

空白格 回答

這其實是一個linux問題。

創(chuàng)建用戶組,給用戶組添加權限 -- 具體怎么做我也不是特別清楚。

另外,
試試 virtualenv呢?

清夢 回答

抓包工具:fiddler,charles;
1.如果是https請求,需要設置代理,在手機上安裝相關軟件的證書,以中間人攻擊的方式,能夠看到http傳輸?shù)臄?shù)據(jù);
2.抓包開始,請清除緩存,不少app為了節(jié)約加載時間,一些數(shù)據(jù)會緩存。
3.盡量避免其他軟件在抓包時的干擾,后臺清理掉,或者在抓包軟件中設置只針對某一個域名抓??;

傲寒 回答

先笛卡爾積s1['product_name']和s2['brand_name'],設為結果為df則:

df[df['brand_name'].isin('product_name')]

為結果。這樣子可能會調用內部優(yōu)化快一點,可以試試。

具體如何在pandas里做笛卡爾積可以參考這個答案

若相惜 回答

可以在按鈕的click事件處理函數(shù)里獲取到表單

this.props.form.validateFields((err, values) => {})

當然也可以用


this.props.form.getFieldsValues

來獲取指定表單 的值

扯不斷 回答

你要注意后面括號里面的內容while DevTools is open,只有要調試工具開啟下才有效。

心沉 回答

我覺得,你沒有搞明白,什么叫“數(shù)”,什么叫“字節(jié)”吧。
0xfffe7b89 這個數(shù),就是 4294867849 ,負的是 -0xfffe7b89 。
事實上,它就不是負數(shù),只是你自己“覺得”它是負數(shù)。

柒喵 回答

yum install python-paramiko -y

凝雅 回答

nums = soup.select('.pc_temp_songlist > ul:nth-of-type(1) > li > span:nth-of-type(3) > strong:nth-of-type(1)')
titles = soup.select('.pc_temp_songlist > ul:nth-of-type(1) > li > a:nth-of-type(4)')
times = soup.select('.pc_temp_songlist > ul:nth-of-type(1) > li > span:nth-of-type(5) > span:nth-of-type(4)')

這個數(shù)據(jù)解析有問題啊,所以當然沒有打印輸出了
你覺得卡住,每次循環(huán)要sleep 7秒,而且輸出為空造成的假象吧
以下代碼供參考:
import requests
from bs4 import BeautifulSoup

url='http://www.kugou.com/yy/rank/...{}-8888.html?from=rank'

def get_info(url):

res=requests.get(url)
soup=BeautifulSoup(res.text,'lxml')
infoes=soup.select('div.pc_temp_songlist ul li ')
for info in infoes:
    nums=info.select('span.pc_temp_num')[0].text.strip()
    singer,name=info['title'].split('-',1)
    times=info.select('span.pc_temp_tips_r span.pc_temp_time')[0].text.strip()
    print({'名次':nums,'歌手':singer,'歌名':name,'時長':times})

if __name__=='__main__':

urls = [url.format(i) for i in range(1, 24)]
for url in urls:
    get_info(url)

入她眼 回答

你應該看下print看下i的內容是不是已經(jīng)不對了

尕筱澄 回答

試試下面這段代碼,應該是可行的。

from bs4 import BeautifulSoup

with open("縣(中國縣級行政區(qū))_百度百科.html") as f:
    soup = BeautifulSoup(f, 'html.parser')
    a_s = soup.find_all('a')
    for a in a_s:
        if a.parent.name=="td":
            print(a.get_text())
墻頭草 回答

不是很好判斷,首先Python中就沒有規(guī)定函數(shù)要聲明自己的返回值類型,同時一個函數(shù)可以返回不同的類型。

def func(n):
    if n < 100:
        return n
    else:
        return "Too big"

其次我不是很懂你的需求,直接調用函數(shù)判斷函數(shù)返回值的類型不行嗎

if isinstance(func(1), int):
    do_int()
else:
    do_other()
喵小咪 回答

修改你的less配置

 {
                test: /\.less$/,
                use: ExtractTextPlugin.extract({
                    fallback: 'style-loader',
                    use: ['css-loader', 'less-loader']
                })
            },
new ExtractTextPlugin({
        //生成css文件名
        filename: 'static/css/[name].css',
        disable: false,
        allChunks: true
    }),
刮刮樂 回答

測試服務器上接口是正常的么?

mounted:function(){
  http.get('user/detail').then(function(res) {
     if (res.email == "") {
        this.emailDis = false;
     }
  });
}

本地正常 ,測試環(huán)境有問題。說明是這里的沒有走通 ,接口報錯了,
你console.log(res)看一下,res.email 有么

data{
 return {
     emailDis:true,
     sideForm:{
       email:''
     }
   }
}

初始值的時候最好是 key:value 的形式,沒有value就用 ""