小编the*_*etz的帖子

尝试安装时出现“获取构建轮子的要求...错误”--editable

我在跑步:

pip install --editable .
Run Code Online (Sandbox Code Playgroud)

并得到以下内容:

Obtaining file:///content/nlp_tokenization_project
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpkhbslig1 Check the logs for full command output.
Run Code Online (Sandbox Code Playgroud)

我确保我有轮子包:

Requirement already satisfied: wheel in /usr/local/lib/python3.6/dist-packages (0.35.1)
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

python pip python-wheel

11
推荐指数
1
解决办法
7万
查看次数

如何清理此数据类型对象并将其转换为保持 Null 和 NaN 的 float 类型

我有以下数据框列:

                           Hight
0                       
1               1,82 m (6 ft 0 in)
2        1,74 m (5 ft 9 in) metres
3               1,88 m (6 ft 2 in)
4                              NaN
5       1,80 m (5 ft 11 in) metres
Run Code Online (Sandbox Code Playgroud)

如何将列 Hight 转换为数据类型 float 并保留 NaN 值?

期望的输出:

Hight
0                              NaN
1                             1.82 
2                             1.74
3                             1.88
4                              NaN
5                             1.80
Run Code Online (Sandbox Code Playgroud)

非常感谢提前

python pandas

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

如何找到哪些值属于一个 pandas 系列而不是另一个系列?

给定两个 pandas 系列,我如何找到哪些元素在 1 中而不在另一个中?每个系列中的所有元素都是独一无二的。

例如,考虑以下代码:

a = pd.Series([1,2,3,4])
b = pd.Series([3,2,4])
Run Code Online (Sandbox Code Playgroud)

我如何才能确定哪些元素在系列“a”中但不在系列“b”中?在此示例中,输出将为 [1]。

python pandas

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

消除元组python中的重复项

我有一个包含重复项目和每个项目不同值的元组。我想创建一个包含此列表的新元组,其中包含唯一项和总值对。想知道是否有一种有效的方法来做到这一点。我对 python 真的很陌生,不知道如何解决这个问题。伪代码会有很大帮助。

tuple1 = [(3, 4), (2, 4), (3, 7), (2, 1), (3, 8)]
Run Code Online (Sandbox Code Playgroud)

想要创建 tuple2

tuple2 = [(3, 19), (2, 5)]
Run Code Online (Sandbox Code Playgroud)

python

-1
推荐指数
1
解决办法
70
查看次数

标签 统计

python ×4

pandas ×2

pip ×1

python-wheel ×1