腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
to_datetime
()
方法
中
的
序列
类型
(
Pandas
)
pandas
、
datetime
、
types
、
series
我有一个包含一个日期列
的
数据框。使用dt=pd.to_datetime(df' Date ')将其转换为日期时间格式:结果:名称:日期,长度: 198900,数据
类型
: datetime64ns。当我想要使用datetime.datetime.strptime(‘%B%d,%y',dt)更改格式时,我得到以下错误: TypeError: datetime64ns ()参数2必须是字符串,而不是
序列
我想知道
浏览 8
提问于2019-02-11
得票数 1
回答已采纳
2
回答
“‘Series”对象没有属性“
to_datetime
”
python
、
pandas
、
dataframe
我正在尝试将一个列字符串
类型
转换为datetime
类型
。但是当我写代码
的
时候:它只是告诉我但当我尝试
的
时候它起作用了。我是python
的
新手,希望有人能解释为什么会发生这种情况。 感谢
浏览 4
提问于2019-01-23
得票数 12
回答已采纳
2
回答
Python- TypeError:无法将
序列
转换为
python
、
pandas
、
csv
、
error-handling
、
time-series
我编写这段代码是为了转换特定csv文件
中
的
列,然后将其转换为人类可读
的
时间。但是,只有当我指定一个数据值,并且当我尝试转换整个列时,它才能正常工作,并显示以下错误: TypeError: cannot convert the series to import
pandas
as
浏览 28
提问于2021-07-15
得票数 0
回答已采纳
2
回答
如何使用sqlalchemy插入datetime?
sqlite
、
sqlalchemy
我使用炼金术将以下代码插入到SQLITE
中
: list1 = df.to_dict(orient
浏览 2
提问于2016-11-21
得票数 1
1
回答
是否有一个函数可以将unix时间戳转换为数据帧
中
的
小时变量?
python
、
pandas
、
dataframe
、
unix-timestamp
我是python
的
新手,所以这似乎很明显,但我正在尝试用特定unix_timestamp
的
小时数替换名为unix_timestamp
的
数据帧
中
的
一列。例如: 1326429793会变成4 我尝试使用panda
方法
to_datetime
,但它不能满足我
的
要求。我目前在网上看到
的
几个示例中使用.hour - datetime.utcfromtimestamp(1326429793).hour,但是当将它应用于数据帧时,它会输出一个错误 f
浏览 10
提问于2019-06-10
得票数 0
回答已采纳
1
回答
Pandas
数据帧多个数据库表
python
、
python-3.x
、
database
、
pandas
、
postgresql
我有一个API包装器,可以从特定
的
产品中提取数据。我面临着如何将json数据映射到数据库(postgresql)
的
问题。我已经阅读了
Pandas
dataframe,但我不确定这是不是正确
的
方法
。2)数据帧内
的
每一行都需要插入到两个不同
的
数据库表
中
。我需要在TableA
中
插入10列,获得新插入行
的
id,然后在TableB
中
插入5列,包括返回
的
id。我该怎么做呢?3)是否可以为数据帧
浏览 14
提问于2020-05-15
得票数 1
回答已采纳
1
回答
将字符串转换为DateTime (python)最快
的
是什么?
python
、
datetime
、
strptime
我有一个带有id和 date 列
的
数据,date是一个字符串它能像我所需要
的
那样工作,但是如果df是大
的
,它会慢得令人无法接受。有什么建议吗?
浏览 1
提问于2021-03-19
得票数 1
回答已采纳
1
回答
如何在
pandas
中
按日期分组。我有48个条目对应于一个日期,即30分钟间隔
pandas
、
data-science
、
pandas-groupby
在代码
中
输入,在图像
中
输出。
浏览 1
提问于2018-07-20
得票数 0
2
回答
将日期时间字符串转换为numpy
中
的
日期时间(python)
datetime
、
python-3.x
、
numpy
、
pandas
、
python-datetime
但是,下面的代码可以按我
的
预期工作如何将数组转换为符合Numpy datetime64函数要求
的
格式?我使用
的
是Numpy版本1.7.0。在python 3.4
中
浏览 4
提问于2014-11-24
得票数 14
回答已采纳
1
回答
如何将两列
中
的
日期和时间放入
pandas
to_datetime
并设置为索引
python
、
pandas
将两个单独列
中
的
日期和时间放入
Pandas
to_datetime
中
(格式正确)并将其设置为索引,最简单
的
方法
是什么?178.06 178.06 178.06 178.06 300.0下面是供参考
的
数据
类型
浏览 2
提问于2018-03-27
得票数 0
1
回答
如何有效地将
pandas
.Timestamp函数应用于完整
的
数据/列?
python
、
pandas
、
dataframe
、
datetime
熊猫是完成许多数据任务
的
一个很好
的
工具。许多功能已经简化,以便有效地应用于列,而不是单个单元格/行。其中一个函数是
to_datetime
()函数,我在后面的问题中使用它作为示例。我感兴趣
的
特定函数是函数,但在
pandas
.Timestamp类(可能还有其他熊猫类)中有大量符合这种描述
的
函数,而且文档很少。是否有一种有效地将这些函数广播到一整列数据
中
的
方法
?注意:我知道我可以使用apply()函数,但这显然比我所想
的<
浏览 3
提问于2020-12-17
得票数 2
回答已采纳
4
回答
计算今天日期和
pandas
日期系列之间
的
日期差异
python
、
pandas
想要计算熊猫日期
序列
之间
的
天数差-1 2013-01-293 2013-02-225 2013-03-147 2013-03-21 还有今天
的
日期。我试过了,但想不出合理
的
解决方案。请帮我弄一下代码。实际上,我是python
的
新手,在应用任何函数时都会出现很多语法错误。
浏览 3
提问于2018-12-31
得票数 2
1
回答
将日期时间
序列
转换为不循环
的
熊猫字符串
python
、
string
、
datetime
、
pandas
我在
Pandas
dataframe - df'timeStamp'.中有一个日期时间
序列
作为一列。我希望将列
中
的
每个datetime对象转换为一个字符串。datetime对象转换为字符串,如下所示:datetime.format(datetime) 但是要得到我想要
的
,这是我想要避免
的
。我想知道是否有任何
Pandas
/Python函
浏览 1
提问于2015-08-19
得票数 3
1
回答
python
pandas
to_datetime
运行不稳定
python
、
pandas
、
datetime
我通常调用一些csv文件
中
的
数据,并使用
pandas
.to_datetime函数将日期列更改为datetime格式,以便进行进一步
的
数据处理。然而,
to_datetime
函数有时工作得很好,有时又不好。它工作不稳定,我通常会花很多时间来调整datatime格式。 我尝试了很多
方法
,但都不稳定。有人能帮我解决这个问题吗?"descriptor 'date‘需要一个'datetime.datetime’对象,但收到了一个'int'“我想把df
浏览 7
提问于2017-06-22
得票数 0
回答已采纳
1
回答
Pandas
0.10
中
的
时间戳到日期
的
转换
python
、
pandas
、
timestamp
我有一个旧版本
的
Pandas
(0.10...)获得新版本将需要时间,因为这是一个企业范围
的
更改。我希望在
Pandas
0.10
中
将时间戳转换为mm/dd/yyyy格式,但我不知所措,因为
to_datetime
()
方法
似乎没有格式参数。 您能建议一种解决
方法
吗?
浏览 4
提问于2017-02-03
得票数 0
回答已采纳
2
回答
从SPSS到Python日期
的
整数日期
python
、
pandas
、
date
、
spss
当我尝试
的
时候Traceback (most recent call last): result = convert_listlike(np.array([arg]), box, in _convert_listlike_datetimes e
浏览 1
提问于2019-06-07
得票数 3
1
回答
用熊猫计算两个日期之间
的
差异?
python
、
datetime
、
pandas
、
time
我正在尝试用熊猫来计算两个日期之间
的
时间差,但遇到了一些麻烦。日期
的
格式如下:使用
pandas
.to_datetime,我可以将这些
类型
转换为datetime64
类型
,但是却找不到一种
方法
来区分这些
类型
。以下是我
的
代码
的
基础:df2.Start =
to_datetime
(d
浏览 3
提问于2016-07-11
得票数 1
2
回答
熊猫系列:字符串日期到时代
的
unix秒
python
、
pandas
September 20 2016 3 September 19 2016 用什么简洁
的
方法
来代替时间进入划时代
的
浏览 1
提问于2016-12-05
得票数 1
回答已采纳
1
回答
pandas
.to_datetime ValueError:无法组合datetimes
python
、
pandas
、
time
我正在尝试使用3个
pandas
列创建一个
pandas
datetime系列。当我调用
to_datetime
()
方法
时,它抛出一个错误,即使我以正确
的
年、月、日格式输入int64数据
类型
的
一系列输入。pd.to_datetime(df[['year', 'month', 'day']]) 错误堆栈
的
最后一行是最奇怪
的
,因为它似乎显示我
的
值是%Y%m%d格式,但
浏览 1
提问于2018-03-17
得票数 1
2
回答
"AttributeError:'DataFrame‘对象没有属性'dtype'“,使用
to_datetime
python
、
string
、
pandas
、
datetime
我一直在windows机器上使用Python2.7.13编写我
的
代码。但是,我现在正尝试使用Python 2.7.12-goolf-2015a.在Unix集群上运行我
的
代码。当我用2.7.12在集群上运行我
的
代码时,我在熊猫函数
to_datetime
中
遇到一个错误,这个错误不会使用2.7.13发生。当我试图将dataframe
中
的
日期条目转换为datetime时,会发生此错误。/
pandas
/tseries/tools.p
浏览 2
提问于2017-09-15
得票数 0
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
对象存储
即时通信 IM
云直播
活动推荐
运营活动
广告
关闭
领券