Issue
I am trying to figure out how to make a identify the strings in an array without hard coding the strings into a list.
So, I have an array that is 10000 rows x 8 columns big (which I imported from a .csv file, and it's stored in a DataFrame type variable) which I imported. The eight column has 4 unique string names that appear differently throughout.
I am attempting to create a code that will make a list of those 4 unique string names, without knowing the string names within the list.
So the size of the DataFrame variable is (10000, 8), and the 8th column is where the string values of interest are for me.
Solution
You could make a set from the column. Assuming the columns are named 0 through 7,
unique_names = set(dataframe[7])
Answered By - tdelaney
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.