python - df.to_html() 中的类方法
问题描述
如何在 df.to_html() 中使用类方法?
我努力了 :
css_class = {'border-width': 'thin'}
df.to_html(index=False,classes=css_class)
我收到一个错误:TypeError: sequence item 1: expected string, dict found
示例数据:
df = DataFrame({'A':[1,1,2,3,5],'B':[3,4,5,6,7]})
我必须把它写进电子邮件。现在输出看起来像:
如何减小边框宽度并使其成为单行边框/细边框。
df.to_html ()文档没有给出示例。
解决方案
推荐阅读
- r - Align kable headings differently, without altering table body in R
- javascript - React Native 中的 Axios - 无法发布 Blob 或文件
- machine-learning - 为什么微精度/召回更适合类别不平衡?
- apache-kafka - 将缓存值中的 JSON CDC 数据映射到 Ignite sqlline 瘦客户端表
- linux - 未在 Azure 日志分析中收集 Linux VM 自定义日志
- java - Java SecureRandom 声明应该是特定于静态类的,也可以是特定于实例的
- swift - 单击 Swift 中的底部标签栏时更改图标边框
- .net - 使用 .net sdk 的新 Azure 监视器警报
- javascript - ASP.NET MVC 在 jQuery 数据表中使用带有按钮 onclick 的模态弹出窗口
- python - 访问动态变量以执行操作