Home > front end >  How do I identify if a specific string name appears in an array?
How do I identify if a specific string name appears in an array?

Time:10-17

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.

CodePudding user response:

You could make a set from the column. Assuming the columns are named 0 through 7,

unique_names = set(dataframe[7])
  • Related