我的代码中有这一行将数据转换为数字...
data["S1Q2I"] = data["S1Q2I"].convert_objects(convert_numeric=True)
Run Code Online (Sandbox Code Playgroud)
问题是现在新的pandas发布(0.17.0)说这个函数已被弃用..这是错误:
FutureWarning: convert_objects is deprecated.
Use the data-type specific converters pd.to_datetime,
pd.to_timedelta and pd.to_numeric.
data["S3BD5Q2A"] = data["S3BD5Q2A"].convert_objects(convert_numeric=True)
Run Code Online (Sandbox Code Playgroud)
所以,我去了新的文档,我找不到任何如何使用新函数转换我的数据的例子......
它只说这个:
"不推荐使用DataFrame.convert_objects,而选择类型特定的函数pd.to_datetime,pd.to_timestamp和pd.to_numeric(0.17.0中的新增功能)(GH11133)."
你能帮忙的话,我会很高兴!
如何更改下图中的字体大小stat_compare_means?即,更改“ Kruskal-Wallis,p = 1.5e-09”和其他p值字体大小?我想使用比默认字体小的字体大小...
按照数据示例...
library(ggpubr)
data("ToothGrowth")
compare_means(len ~ dose, data = ToothGrowth)
# Visualize: Specify the comparisons I want
my_comparisons <- list( c("0.5", "1"), c("1", "2"), c("0.5", "2") )
# Plotting
ggboxplot(ToothGrowth, x = "dose", y = "len",
color = "dose", palette = "jco")+
stat_compare_means(comparisons = my_comparisons)+ # Add pairwise comparisons p-value
stat_compare_means(label.y = 50) # Add global p-value
Run Code Online (Sandbox Code Playgroud)
情节: