腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(617)
视频
沙龙
2
回答
如何使一个简单的Python循环并行使用熊猫?
df["a"] = np.where(
pd.notnull
(df["a"]) == True, 6, 0)df["b"] = np.where(
pd.notnull
(df["b"]) == True, 1, 0) df["c"] = np.where(
pd.notnull
(df[
浏览 0
提问于2020-03-21
得票数 0
回答已采纳
2
回答
如何使用pandas过滤python中的数据?
、
、
、
lastname', 'email', 'phonenumber']import pandas as pd
pd.notnull
(df[email]) |
pd.notnull
(df[phonenumber])
浏览 28
提问于2018-07-05
得票数 0
1
回答
根据这些列创建一个列,该列可能包含熊猫中的南值。
、
、
、
这是我的代码:"Scaling and summing" return df['A']*0.5+df['B']*0.25+df['C']*0.25 elif (
浏览 0
提问于2018-09-25
得票数 1
回答已采纳
2
回答
Python -基于时间信息(瞬间、间隔)计算项目之间的相似性
、
、
、
、
# {instant, instant} => equal, not equal if st1 == st2: if(st2 <
浏览 2
提问于2017-01-04
得票数 1
回答已采纳
1
回答
pd.notnull
的奇怪的空检查行为
、
、
在使用解决
pd.notnull
时,我遇到了一些奇怪的行为。x = ('A4', nan)>>>
pd.notnull
(x)它将元组视为单个值(而不是可迭代的值)。此外,将其转换为列表,然后进行测试,也会给出不正确的答案。>>>
pd.notnull
(list(x))因为第二个值是nan,所以我要寻找的结果应该是[True, Fals
浏览 2
提问于2018-06-26
得票数 3
回答已采纳
2
回答
如何在Pandas中使用列号而不是名称来有条件地子集行
、
我想使用
pd.notnull
对熊猫DataFrame中不缺少value的行进行子集。但是,我不使用列名,而是使用列号。我该怎么做?pd.DataFrame({ 'value': [2, 6, np.nan, 8, np.nan]df[
pd.notnull
(df['value'])] df[
pd.notnull
(df.column
浏览 0
提问于2018-09-07
得票数 0
回答已采纳
0
回答
Pandas应用于每列的每个元素(&M)
、
、
、
假设我有一个10列的数据帧,如果是
pd.notnull
(x),我想对每个只有4列的元素应用一个lower()函数,否则只保留none作为值。change_to_lowercase(x), axis = 1) s['B'] = s['B'].map(lambda x: x.lo
浏览 0
提问于2017-06-15
得票数 4
回答已采纳
1
回答
如何使Python代码更有效地转换power BI中的数据,以减少刷新时间?
、
、
、
、
fd = dataset[pd.isnull(dataset['bID'])]["RepackaID"].dropna().tolist() return 'b Input' return'b
浏览 9
提问于2022-03-12
得票数 0
2
回答
我如何将这些包含字符串的熊猫列转换为浮动,同时保持它们的意义?
、
我希望将列--实际的、预测的、以前的--转换为浮点,这样我就可以对它们执行计算。csv还包含一些应该留在原地的NaNs、、。2018-01-04 04:30:00,GBP,Low Impact Expected,Mortgage Approvals,65K,64K,65K2018-01-04 05:01:00,EUR,Low Impact Expected,French 10-y Bond A
浏览 0
提问于2018-11-11
得票数 1
回答已采纳
1
回答
TypeError:描述符“”replace“”需要“”str“”对象,但收到了“”NoneType“”
、
、
、
我正在尝试用空格(“")替换元组列表中的值'\x1c‘,该元组列表使用python直接从远程oracle数据库查询。我得到了这个错误:下面是我使用的代码,错误出现的最后一行代码:cursor =
浏览 0
提问于2018-04-13
得票数 1
2
回答
熊猫:从多个列中删除空值,不那么冗长
、
、
used'],_ = plt.hist([ data['A1'][
pd.notnull
(data['A1'])], data['A4'][
pd.notnul
浏览 2
提问于2017-07-19
得票数 1
回答已采纳
2
回答
Python大熊猫/numpy用值填充1到单元格,将0填充到nan的单元格。
、
、
、
、
我有一个包含不同类型数据(String、float、Integer、.)的单元格的数组。[[18 '1/4/11' 73.0 'Male' 4.0] [18 '7/5/11' 73.0 'Male' 7.0]]预期成果: 1 0 1 1 0有了熊猫的fillna(0),我可以用0填充nan,但是如果数据是不同类型的,那
浏览 3
提问于2017-11-12
得票数 1
回答已采纳
2
回答
当依赖列中的值不为空时,如何编写函数以查找列中值为空的所有行
、
check_correlated_column_values(df,column,dependent_column_list): result = df.loc[(df[column].isnull()) & (
pd.notnull
(df[dependent_column_list[0]])) & (
pd.notnull
(df[dependent_column_list[1]])) & (
pd.notnull
(df[dependent_column_list
浏览 0
提问于2020-04-09
得票数 0
回答已采纳
1
回答
到最近边的多边形距离中的地理观测点
、
、
所以我有一个大约10,000行的geopandas数据帧,如下所示。每个点都在多边形内(我已经确定了)。POINT(-0.1618445 51.5103873) polygon1 1 POLYGON ((-0.1642799 51.5113756, -0.1639581 51.5089851, -0.1593661 51.5096729, -0.1606536 51.5115358, -0.1642799 51.5113756)) 我想添加一个名为
浏览 0
提问于2020-01-24
得票数 0
2
回答
基于Python中的其他列分配新列
、
、
model_degree'][i]): elif
pd.notnull
] = basicdataframe['section_degree'][i] elif pd.isnull(basicdataframe['section_degree'][i]) and
pd.notnull
model_degree
浏览 19
提问于2021-10-26
得票数 1
回答已采纳
1
回答
测试数据熊猫中的行空值
、
、
'X23', None], 'id2': ['Y10', "Y14", None], 'id3':[77,22,13]} df = df[df[
pd.notnull
(df['id1'])and df[
pd.notnull
(df['id2'])]]
浏览 1
提问于2019-06-04
得票数 2
回答已采纳
1
回答
熊猫:使用`df.loc`从datetime64到int的类型转换
、
、
、
import datetimeprint(d)print(d)这是我的dataframe(df.prior_ea_date),
浏览 2
提问于2016-08-19
得票数 6
回答已采纳
7
回答
如果列值为非空,Python熊猫将应用函数。
、
、
、
、
我的功能尽可能简单: print rowdf[['A','B']].apply(lambda x: my_func(x) if(
pd.notnull
如果我想检查列'B‘中的空值,那么
pd.notnull
()也能很好地工作。但是,如果我选择包含list对象的列'C‘: df[['A','C']].apply(lambda x: my_func(x) if(
pd.notnull
(x
浏览 6
提问于2014-10-28
得票数 47
回答已采纳
2
回答
如果另一列不是NaN w/ string连接,则填充NaN列
、
如果两列不是NaN,我希望将它们连接在一起,如下所示: df
pd.notnull
的行为不是我所期望的那样。
浏览 2
提问于2017-09-15
得票数 0
回答已采纳
1
回答
熊猫没有正确地将NaN转换成无
、
、
a":[1,np.nan],"b":[np.nan,"foo"]})Out[9]: 0 1.0 NaN Out[10]: 0 True False Out[11]: 0 1.0 None 1 NaN
浏览 3
提问于2021-07-30
得票数 1
回答已采纳
点击加载更多
相关
资讯
pandas的Series常用方法
python及numpy,pandas易混淆的点
Pandas基础入门(二)
Python数据分析之NumPy和Pandas
热门
标签
更多标签
云服务器
ICP备案
对象存储
云点播
实时音视频
活动推荐
运营活动
广告
关闭
领券