Skip to content

Instantly share code, notes, and snippets.

@WindyNova
Created September 18, 2024 07:14
Show Gist options
  • Select an option

  • Save WindyNova/2b974b1a8d0973fd6dfa587c5c16e201 to your computer and use it in GitHub Desktop.

Select an option

Save WindyNova/2b974b1a8d0973fd6dfa587c5c16e201 to your computer and use it in GitHub Desktop.
Find Followings Who Didnt Followed You Back
import pandas as pd
# 读取Excel文件
df = pd.read_excel('ok.xlsx')
# 打印数据框的基本信息
print(df.info())
print("\n前几行数据:")
print(df.head())
# 获取关注你的人和你的关注列表
followers = df["follower"].tolist()
following = df["following"].tolist()
# 找出没有回关你的人
not_following_back = []
for follow in following:
if follow not in followers:
not_following_back.append(follow)
# 打印没有回关你的人的列表
print("没有回关你的人:")
for user in not_following_back:
print(user)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment