TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hrasha
NA
103
6.3k
Please help how can I add (molecule_name) in dataframe
Apr 4 2021 10:23 AM
import glob import pandas as pd filenames = glob.glob(file_location) print(filenames) first_file = filenames[0] print(first_file) file_name = os.path.basename(first_file) print(file_name) for f in filenames: # Get the molecule name file_name = os.path.basename(f) split_filname = file_name.split('.') molecule_name = split_filename[0] # Read the data outfile = open(f,'r') data = outfile.readlines() outfile.close() print(molecule_name)
Reply
Answers (
2
)
Why am I getting AttributeError?
How can I implement this timeout?