小编fx-*_*rin的帖子

熊猫最后一排

有没有办法获取和删除最后一行像poppython本机列表的方法?

我知道我可以在下面做.我只是想让它成为一条线.

df.ix[df.index[-1]]
df = df[:-1]
Run Code Online (Sandbox Code Playgroud)

python pandas

9
推荐指数
1
解决办法
4362
查看次数

如何通过fiddler2捕获python SSL(HTTPS)连接

我正在尝试通过Fiddler2本地代理捕获python SSL(HTTPS)连接.但我只有一个错误.

import requests
requests.get("https://www.python.org", proxies={"http": "http://127.0.0.1:8888", "https":"http:127.0.0.1:8888"},cert=r"FiddlerRoot.cer")
Run Code Online (Sandbox Code Playgroud)

错误

requests.exceptions.SSLError: [Errno 1] _ssl.c:510: error:14090086:SSL routines:
SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉我如何修复错误,除了使验证错误?我已经在Windows 7系统上接受了"FiddlerRoot.cer",但没有任何改变.

  • Python 2.7
  • Windows 7的

python ssl https fiddler python-requests

5
推荐指数
1
解决办法
4100
查看次数

从matplotlib AxesSubplot获取值

我想获取pandas.Series.hist方法matplotlib.axes.AxesSubplot返回的值.有没有办法这样做?我在列表中找不到该属性.

import pandas as pd
import matplotlib.pyplot as plt

serie = pd.Series([0.0,950.0,-70.0,812.0,0.0,-90.0,0.0,0.0,-90.0,0.0,-64.0,208.0,0.0,-90.0,0.0,-80.0,0.0,0.0,-80.0,-48.0,840.0,-100.0,190.0,130.0,-100.0,-100.0,0.0,-50.0,0.0,-100.0,-100.0,0.0,-90.0,0.0,-90.0,-90.0,63.0,-90.0,0.0,0.0,-90.0,-80.0,0.0,])
hist = serie.hist()
# I want to get values of hist variable.
Run Code Online (Sandbox Code Playgroud)

我知道我可以得到直方图值np.histogram,但我想使用pandas hist方法.

python matplotlib pandas

4
推荐指数
1
解决办法
2092
查看次数

Rust 中的字符串引用比较

我刚刚确认了Vec::contains工作原理。我在下面写了代码,看起来工作正常。

但我不知道它为什么有效,因为它比较&String类型。这是否意味着即使没有取消引用字符串比较也有效?

struct NewStruct {
    string_vec: Vec<Option<String>>,
}

fn main() {
    let mut mys = NewStruct {
        string_vec: Vec::<Option<String>>::new(),
    };
    mys.string_vec.push(Some("new array".to_string()));
    let ref_st = mys.string_vec.iter().filter(|o|o.is_some()).map(|o|o.as_ref().unwrap()).collect::<Vec<&String>>();
    println!("result:{:?}", ref_st.contains(&&("some string".to_string())));
    println!("result:{:?}", ref_st.contains(&&("new array".to_string())));
    println!("Hello, world!");
    f64::from(1234_u64 as i32);
}
Run Code Online (Sandbox Code Playgroud)

string comparison rust

3
推荐指数
1
解决办法
409
查看次数

标签 统计

python ×3

pandas ×2

comparison ×1

fiddler ×1

https ×1

matplotlib ×1

python-requests ×1

rust ×1

ssl ×1

string ×1