Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
R:使用字典/列表转换数据框列?
我有一个包含大量文本值 级别 的数据框列 我需要将这些值映射到预定义的类似对象的结构 以减少级别数 我可以在 Python 中使用字典轻松实现此目的 但无法使用 R 中的列表实现同样的目的 例如 我的数据框列类似于 df lt data f
r
DataFrame
transformation
Pandas 将值与前一行与过滤条件进行比较
我有一个包含员工工资信息的数据框 大约有 900000 多行 Sample table num name salary 0 001234 John Johnson 1200 1 001234 John Johnson 1000 2 0012
python
pandas
DataFrame
Compare
rows
为什么pivot_wider要么将单个值读取为重复项,要么创建一个宽而长的小标题(不合并行)?
我浏览了此处发布的大部分相关问题 但似乎没有一个问题与我面临的问题相同 根据我的阅读 此处已经发布的问题与长格式数据中的重复值 缺乏唯一标识符 有关 这会导致带有列表列的宽格式数据 这通常可以通过创建虚拟变量列来解决这是一串唯一的数字 我已
r
DataFrame
dplyr
duplicates
tidyverse
使用 ddply 进行汇总统计
我喜欢使用编写一个函数ddply根据两列的名称输出汇总统计信息data frame mat mat是一个大data frame与列的名称 metric length species tree index index是具有 2 个水平的因子
r
DataFrame
plyr
pandas 相当于 R dcast
我有一些这样的数据 import pandas as pd df pd DataFrame index range 1 13 columns school year metric values df school id1 6 id2 6 d
python
r
pandas
DataFrame
pivottable
Python Dask - 2 个 DataFrame 的垂直串联
我正在尝试垂直连接两个 Dask DataFrame 我有以下 Dask DataFrame d A B C D E F 1 4 8 1 3 5 6 6 2 2 0 0 9 4 5 0 6 35 0 1 7 10 9 4 0 7 2 6 1
python27
DataFrame
concatenation
Dask
如何使用元组列表中的索引创建 pandas DataFrame
使用记录索引创建 pandas DataFrame 的最佳方法是什么 这是我的样本 sales Jones LLC 150 200 50 Alpha Co 200 210 90 Blue Inc 140 215 95 labels acco
python27
pandas
DataFrame
如何通过 Python 将 csv 数据帧上传到 azure?
我正在使用 Python 和 Pyspark 并且想要将 CSV 文件上传到 azure blob 存储 我已经有一个由代码生成的数据框 df 我想做的是接下来的事情 Dataframe generated by code df Creat
python
Azure
DataFrame
PySpark
blob
R:循环数据框,根据日期提取数据子集
我有一个大型数据框 其中包含如下所示的数据 date w x y z region 1 2012 01 21 43 12 3 NORTH 2 2012 02 32 54 21 16 NORTH 3 2012 03 14 32 65 32 N
r
forloop
DataFrame
subset
转换为“日期时间”类型时出现问题:“小时必须为 0..23”
这些是我的 csv 文件中的一些示例行 10 10 1949 20 30 san marcos tx us cylinder 2700 45 minutes This event took place in early fall aroun
python
pandas
datetime
DataFrame
将特定选定的列提取到新的 DataFrame 作为副本
我有一个包含 4 列的 pandas DataFrame 我想创建一个new数据框only有三列 这个问题类似于 从数据框中提取特定列 https stackoverflow com questions 10085806 extractin
python
pandas
DataFrame
chainedassignment
按键列合并两个 data.frames
我有两个数据框 在第一个中 我有一个 KEY ID 列和两个变量 KEY V1 V2 1 10 2 2 20 4 3 30 6 4 40 8 5 50 10 在第二个数据框中 我有一个 KEY ID 列和第三个变量 KEY V3 1 5 2
r
DataFrame
subset
删除 DataFrame 列中仅出现一次的值
我有一个列中具有不同值的数据框x 我想删除列中仅出现一次的值 So this x 1 10 2 30 3 30 4 40 5 40 6 50 应该变成这样 x 2 30 3 30 4 40 5 40 我想知道是否有办法做到这一点 您可以通过
python
pandas
Filtering
DataFrame
如何快速将 pandas 数据框行转换为ordereddict
寻找一种快速方法将 pandas 数据框中的行放入有序字典中 而不使用列表 列表很好 但对于大数据集将花费很长时间 我正在使用 fiona GIS 阅读器 行是有序字典 其模式给出数据类型 我使用 pandas 来连接数据 在很多情况下 行
python
pandas
DataFrame
ordereddictionary
使用 python-pandas 索引数据帧时无法获得非唯一标签的正确切片绑定
我有这样一个数据框df a b 10 2 3 1 0 0 0 4 about 50 000 rows 我希望选择df 5 a 但是当我打电话时df loc 5 a 我得到一个错误 KeyError Cannot get right slic
python
pandas
DataFrame
Python 显示指向数据框的 HTML 箭头
我创建了一个数据框 df Value Change Direction Date 2015 03 02 2117 38 NaN 0 2015 03 03 2107 79 9 609864 0 2015 03 04 2098 59 9 250
python
html
pandas
DataFrame
replace
在 Spark 中读取 XML
我正在尝试使用spark xml jar 读取pyspark 中的xml 嵌套xml df sqlContext read format com databricks spark xml option rowTag hierachy loa
xml
apachespark
DataFrame
PySpark
apachesparkxml
使用平均值填充 pandas 数据框中的缺失值
datetime 2012 01 01 125 5010 2012 01 02 NaN 2012 01 03 125 5010 2013 01 04 NaN 2013 01 05 125 5010 2013 02 28 125 5010 2
python
pandas
DataFrame
mean
missingdata
PySpark 中按降序排序
我正在使用 PySpark Python 2 7 9 Spark 1 3 1 并有一个数据框 GroupObject 我需要按降序过滤和排序 试图通过这段代码来实现它 group by dataframe count filter coun
python
apachespark
DataFrame
PySpark
apachesparksql
如何在pandas中的多个数据框列中“选择不同的”?
我正在寻找一种与 SQL 等效的方法 SELECT DISTINCT col1 col2 FROM dataframe table pandas sql 比较没有任何内容distinct unique 只适用于单个列 所以我想我可以连接这些
python
pandas
DataFrame
duplicates
Distinct
«
1 ...
6
7
8
9
10
11
12
...100
»