通过 XLwings 在 Excel 上将数据帧显示为句柄
作者:Dave Lui 提问时间:11/11/2023
我正在尝试编写一个函数,通过以下方式按句柄返回数据帧:Xlwings @xw.func @xw.ret(index=False) def create_df(): # initialize dat...
数据帧 问答列表
作者:Dave Lui 提问时间:11/11/2023
我正在尝试编写一个函数,通过以下方式按句柄返回数据帧:Xlwings @xw.func @xw.ret(index=False) def create_df(): # initialize dat...
作者:Leo 提问时间:1/9/2022
我有一个带有 2 个分类列(col1、col2)的数据帧。 col1 col2 0 A DE 1 A B 2 B BA 3 A A 4 C C 我想将唯一的字符串值映射到整数,例如(A:0、...
作者:Harsh Saharan 提问时间:11/15/2023
我想使用 plotly.express 绘制交互式条形图 state_count = df['state'].value_counts().head(10) state_names = df['st...
作者:Leo 提问时间:8/25/2019
我想使用应用函数: - 接受 2 列作为输入 - 根据函数输出两列新列。 一个例子是这个add_multiply函数。 #function with 2 column inputs and 2 o...
作者:angeliquelinde 提问时间:2/25/2023
我想在 DataFrame 的文本列中映射以下值,如下所示: 对此: 我想我可以使用字典将文本片段映射到单个单词。这是我尝试过的代码: import pandas as pd data = {...
作者:saveenr 提问时间:4/30/2012
我有一个数据帧: City Name 0 Seattle Alice 1 Seattle Bob 2 Portland Mallory 3 Seattle Mallory 4 Seattle Bo...
作者:Roman 提问时间:10/15/2013
我有一个数据帧,我使用其中的几列来:dfgroupby df['col1','col2','col3','col4'].groupby(['col1','col2']).mean() 通过上述方...
作者:Owen 提问时间:5/3/2014
我觉得有比这更好的方法: import pandas as pd df = pd.DataFrame( columns=" index c1 c2 v1 ".split(), data= [ ...
作者:mbrb 提问时间:6/13/2020
对于日期时间如下的 Pandas 数据帧: DateTime 2020-6-12 2020-6-13 2020-6-14 2020-6-15 2020-6-16 2020-6-17 ... 我想...
作者:Kabomi 提问时间:8/28/2021
以下数据以 5 分钟的间隔 数据帧名称为 df: script_id date_time 打开 高 低 关闭 卷 0 201 2019-02-04 14:55:00 1408.05 1408.0...