我有两个列表,englishclub
和listofallclub
我已经检查了englishclub
中不是所有元素都在listofallclub
中,但是我想找出listofallclub
中缺少的元素
我希望列表很大。
listallclub = df.Club.tolist()
result = all(elem in englishclub for elem in listallclub)
if result:
print("Yes, englishclub contains all elements in listallclub")
else :
print("No, englishclub does not contains all elements in listallclub")
我希望我的输出成为englishclub
中而不是listofallclub
中的元素列表
答案 0 :(得分:0)
ERROR DETAILS
Following errors were detected during this operation.
* [3/25/2019 8:48:24 AM] System.ArgumentException
- Value does not fall within the expected range.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.NativeMethods.CorLaunchApplication(UInt32 hostType, String applicationFullName, Int32 manifestPathsCount, String[] manifestPaths, Int32 activationDataCount, String[] activationData, PROCESS_INFORMATION processInformation)
at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.SubscriptionStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.Activate(DefinitionAppId appId, AssemblyManifest appManifest, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, String& errorPageUrl, TempFile& deployFile)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
答案 1 :(得分:0)
您可以使用列表理解,
e = [ec for ec in englishclub if ec not in listallclub]
if e:
print("No, englishclub does not contains all elements in listallclub")
print("And they are")
print(e)
else :
print("Yes, englishclub contains all elements in listallclub")