我有一个像这样的pandas数据框:
class men woman children
0 first 0.91468 0.667971 0.660562
1 second 0.30012 0.329380 0.882608
2 third 0.11899 0.189747 0.121259
Run Code Online (Sandbox Code Playgroud)
如何使用看起来像这样的seaborn创建一个情节?我是否必须以某种方式重新安排我的数据?

我有一个pyspark.sql.dataframe,其中每一行都是一篇新闻文章.然后我有一个RDD代表每篇文章中包含的单词.我想将单词的RDD添加为名为"words"的列到我的新文章的数据框中.我试过了
df.withColumn('words', words_rdd )
Run Code Online (Sandbox Code Playgroud)
但我得到了错误
AssertionError: col should be Column
Run Code Online (Sandbox Code Playgroud)
DataFrame看起来像这样
Articles
the cat and dog ran
we went to the park
today it will rain
Run Code Online (Sandbox Code Playgroud)
但我有3k新闻文章.
我应用了一个函数来清理文本,例如删除停用词,我有一个如下所示的RDD:
[[cat, dog, ran],[we, went, park],[today, will, rain]]
Run Code Online (Sandbox Code Playgroud)
我试图让我的Dataframe看起来像这样:
Articles Words
the cat and dog ran [cat, dog, ran]
we went to the park [we, went, park]
today it will rain [today, will, rain]
Run Code Online (Sandbox Code Playgroud) 我有一个pandas DataFrame.我试图根据Section栏中相应级别的平均价格填写价格列的nans.这样做有效而优雅的方法是什么?我的数据看起来像这样
Name Sex Section Price
Joe M 1 2
Bob M 1 nan
Nancy F 2 5
Grace F 1 6
Jen F 2 3
Paul M 2 nan
Run Code Online (Sandbox Code Playgroud)