小编Jia*_*Zou的帖子

pandas Series to Dataframe,使用Series的索引作为列

我有一个系列,像这样:

series = pd.Series({'a': 1, 'b': 2, 'c': 3})
Run Code Online (Sandbox Code Playgroud)

我想将它转换为这样的数据帧:

    a   b   c
0   1   2   3
Run Code Online (Sandbox Code Playgroud)

pd.Series.to_frame 不起作用,结果像,

    0
a   1
b   2
c   3
Run Code Online (Sandbox Code Playgroud)

如何从Series构建DataFrame,其中Series的索引为列?

python pandas

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

如何内联禁用 Jupyter 笔记本 matplotlib 绘图?

好吧,我知道我可以%matplotlib inline用来绘制内联。

但是,如何禁用它?

有时我只想放大我绘制的图形。这是我不能在内联图上做的。

python matplotlib ipython jupyter

6
推荐指数
1
解决办法
7452
查看次数

标签 统计

python ×2

ipython ×1

jupyter ×1

matplotlib ×1

pandas ×1