小编Nat*_*Tew的帖子

Pandas .at 抛出 ValueError:基于整数索引的索引只能有整数索引器

所以我有一个 df,我在其中提取一个值以将其存储在另一个 df 中:

import pandas as pd

# Create data set
d = {'foo':[100, 111, 222], 
     'bar':[333, 444, 555]}
df = pd.DataFrame(d)

# Full dataframe:
print(df)

# Shows:
#    bar   foo 
# 0  333   100
# 1  444   111
# 2  555   222

df2=pd.DataFrame()
df2.loc[1,'Name'] = df[df.foo == 222]['foo']

#error: 
ValueError: Incompatible indexer with Series
Run Code Online (Sandbox Code Playgroud)

我假设最后一行抛出该错误,因为df[df.foo == 222]['foo']是一个Series

2    222
Name: foo, dtype: int64
Run Code Online (Sandbox Code Playgroud)

所以我试图获得价值本身。我使用.at并得到了这个:

print(df[df.foo == 222].loc[:,'bar'].at['bar'])

#ValueError: At based indexing on …
Run Code Online (Sandbox Code Playgroud)

python dataframe python-3.x pandas

6
推荐指数
1
解决办法
2万
查看次数

为什么 flutterfire 配置不替换我的旧 GoogleService-Info.plist 文件?

当我第一次运行flutterfire configure我的 flutter 应用程序时,生成了 4 个文件。firebase_options.dartgoogle-services.jsonfirebase_app_id_file.jsonGoogleServices-Info.plist

\n

当我尝试flutterfire configure再次使用将我的应用程序链接到我的应用程序的开发版本(遵循此线程)时,系统仅提示我更改其中的 3 个文件,如下所示:

\n
\n

google-services.json 文件已存在,但用于不同的 Firebase 项目 (betacentre-dev)。您想将其替换为 Firebase 项目 Thinking-digit-343408 吗?\xc2\xb7 是

\n
\n

选择yes所有这些后,只有 GoogleService-Info.plist 没有更改,但这对于 firebase 的工作显然至关重要(因为flutterfire configure首先添加了它,并且在本指南本指南中都引用了它,并且它包含标识符对于我的 firebase 项目,并且我的应用程序仍然与原始项目通信)。

\n

这是一个错误吗?为什么会这样?

\n

plist ios firebase flutter

5
推荐指数
1
解决办法
781
查看次数

博览会开始:不变违规:“main”尚未注册,没有其他错误

npx expo start我正在尝试与我的“纯”react-native 项目一起使用(即我使用 React Native 的 CLI 创建了该项目)

当我运行时npx expo start,我收到此错误:

iOS Bundling complete 36518ms
 ERROR  Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes
Run Code Online (Sandbox Code Playgroud)

在这个stackoverflow 线程之后,我确保我的应用程序名称是和中的“sotravelapp” package.json,它从 …

react-native expo expo-go

5
推荐指数
0
解决办法
803
查看次数

标签 统计

dataframe ×1

expo ×1

expo-go ×1

firebase ×1

flutter ×1

ios ×1

pandas ×1

plist ×1

python ×1

python-3.x ×1

react-native ×1