'how can i insert text file values in a dataframe column
def read_text_file(file_path):
with open(file_path, 'r') as f:
stop_words(f.read())
# iterate through all file
for file in sorted:
# Check whether file is in text format or not
if file.endswith(".txt"):
file_path = f"{path}/{file}"
print(file_path)
with open(file_path, 'r') as f:
output=stop_words(f.read())
df['title']=output
df2.head()
0 1.0 https://insights.blackcoffer.com/how-is-login-... ['Impacts COVID 19 Food products - Blackcoffer...
1 2.0 https://insights.blackcoffer.com/how-does-ai-h... ['Impacts COVID 19 Food products - Blackcoffer...
2 3.0 https://insights.blackcoffer.com/ai-and-its-im... ['Impacts COVID 19 Food products - Blackcoffer...
3 4.0 https://insights.blackcoffer.com/how-do-deep-l... ['Impacts COVID 19 Food products - Blackcoffer...
4 5.0 https://insights.blackcoffer.com/how-artificia... ['Impacts COVID 19 Food products - Blackcoffer...
for all values in column i am getting only one result but i want to get result like this
/content/data files/1.txt
['How Login Logout Time Tracking Employees Office done AI? - Blackcoffer Insights', '\nWhen people hear AI often think sentient robots magic boxes. AI today much mundane simple—but doesn’t mean it’s powerful. Another misconception high-profile research projects applied directly business situation. AI done right create extreme return investments (ROIs)—for instance automation precise prediction. take thought, time, proper implementation. seen success value generated AI projects increased grounded understanding expectation technology deliver C-suite down.\n“Artificial Intelligence (AI) science set computational technologies inspired by—but typically operate quite differently from—the ways people use nervous systems bodies sense, learn, reason take action.”3 Lately big rise day-to-day use machines powered AI. machines wired using cross-disciplinary approaches based mathematics, computer science, statistics, psychology, more.4 Virtual assistants becoming common, web shops predict purchases, many companies make use chatbots customer service many companies use algorithms detect fraud.\nAI Deep Learning technology employed office entry systems bring proper time tracking employee. system tries learn person image processing technology whose data feed forwarded deep learning model Deep learning isn’t algorithm per se, rather family algorithms implements deep networks (many layers). networks deep new methods computation, graphics processing units (GPUs), required train them, addition clusters compute nodes. using deep learning take detect employee using face person recognition scan login, logout timing recorded. Using AI system even identify employee’s entry time, working hours, non-working hours tracking movement employee office system predict report HR salary employee based working hours. system take feed CCTV track movements employees system capable recognizing person even he/she masked pandemic situation taking iris scan. system installed inside office, following benefits:\n1)Compliance/litigation needs\nFor several countries, regulations insist employer must keep documents available demonstrate working hours performed employee. event control labor inspectorate dispute employee, employer must able explain justify working hours company. made easy system tracking employee movements\n2)Information security needs\nThis monitoring user connection times detect suspicious access times. event compromised credentials used log 3 a.m. Saturday, notification access could alert team attack possibly underway.\n3)Employee login logout software\nTo manage react employees’ attendance, overtime thresholds, productivity, suspicious access times, system records stores detailed interactive reporting users’ connection times. records allow better manage users’ connection times provide accurate, detailed data required management.\n4)If want avoid paying overtime, make sure employees respect certain working time quotas even avoid suspicious access. system alert HR officer employee’s office time accordingly take action.\n5)Last least reduces human resource needs keep track records sending report HR HR officials check report system reduce times human resource needs\nWith use AI Deep Learning technologies, automate routines stuff functionality humans need resources keep track thereby reducing time spent manual data entry works rather companies think making position high competitive world.\nBlackcoffer Insights 33: Suriya E, Vellore Institute Technology\n']
how can i write values from text into column which is corresponding to it correctly THANK YOU for help
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|