小编Jac*_*eau的帖子

如何在Google Cloud中请求GPU配额增加

我一直试图要求增加我的计算引擎的GPU配额,因为Google Cloud说当我尝试启动实例时我有0.我升级了我的帐户,但我似乎无法弄清楚我需要做些什么来增加我的配额.我看了很多教程,但自从这些教程发布以来,云平台一直在变化.

有谁知道如何做到这一点?谢谢!

google-compute-engine google-cloud-platform

26
推荐指数
4
解决办法
2万
查看次数

在Google Colab中使用pathlib:AttributeError:'PosixPath'对象没有属性'ls'

如果我运行以下代码:

\n\n
from pathlib import Path\npath = Path(\'data/mnist\')\npath.ls()\n
Run Code Online (Sandbox Code Playgroud)\n\n

我收到以下错误:

\n\n
AttributeError: \xe2\x80\x98PosixPath\xe2\x80\x99 object has no attribute \xe2\x80\x98ls\xe2\x80\x99\n
Run Code Online (Sandbox Code Playgroud)\n\n

查看pathlib中的Path类,我发现:

\n\n
def __new__(cls, *args, **kwargs):\n        if cls is Path:\n            cls = WindowsPath if os.name == \'nt\' else PosixPath\n        self = cls._from_parts(args, init=False)\n        if not self._flavour.is_supported:\n            raise NotImplementedError("cannot instantiate %r on your system"\n                                      % (cls.__name__,))\n        self._init()\n        return self\n
Run Code Online (Sandbox Code Playgroud)\n\n

我猜这意味着它将运行 PosixPath,即:

\n\n
class PosixPath(Path, PurePosixPath):\n    """Path subclass for non-Windows systems.\n\n    On a POSIX system, instantiating a Path should return this object.\n …
Run Code Online (Sandbox Code Playgroud)

python pathlib

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

Pandas 中的采样从 1 个月减少到几个月

我有一个跨度为 36 个月的数据集。我想对 3 个月的时间进行下采样。我用:

df = df.resample('3M').sum()
Run Code Online (Sandbox Code Playgroud)

但是,当我查看输出时,它似乎没有正确分隔月份。例如,以下是 36 个月的数据:

1901-01-01    266.0
1901-02-01    145.9
1901-03-01    183.1
1901-04-01    119.3
1901-05-01    180.3
1901-06-01    168.5
1901-07-01    231.8
1901-08-01    224.5
1901-09-01    192.8
1901-10-01    122.9
1901-11-01    336.5
1901-12-01    185.9
1902-01-01    194.3
1902-02-01    149.5
1902-03-01    210.1
1902-04-01    273.3
1902-05-01    191.4
1902-06-01    287.0
1902-07-01    226.0
1902-08-01    303.6
1902-09-01    289.9
1902-10-01    421.6
1902-11-01    264.5
1902-12-01    342.3
1903-01-01    339.7
1903-02-01    440.4
1903-03-01    315.9
1903-04-01    439.3
1903-05-01    401.3
1903-06-01    437.4
1903-07-01    575.5
1903-08-01    407.6
1903-09-01    682.0
1903-10-01    475.3
1903-11-01 …
Run Code Online (Sandbox Code Playgroud)

python time-series pandas

2
推荐指数
1
解决办法
1411
查看次数