You’re looking for the index method get_loc
:
In [11]: df.index.get_loc(ds)
Out[11]: 1
More Related Contents:
- Count the frequency that a value occurs in a dataframe column
- SettingWithCopyWarning even when using .loc[row_indexer,col_indexer] = value
- Replacing few values in a pandas dataframe column with another value
- Pretty Printing a pandas dataframe
- Check if a string in a Pandas DataFrame column is in a list of strings
- Pandas: Multiple columns into one column
- How to display a Pandas data frame with PyQt5/PySide2
- FailedPreconditionError: Attempting to use uninitialized in Tensorflow
- Pandas: Subindexing dataframes: Copies vs views
- Get column index from column name in python pandas
- AttributeError: Can only use .dt accessor with datetimelike values
- Plot bar graph from Pandas DataFrame
- pandas DataFrame output end of csv
- Pass percentiles to pandas agg function
- How to calculate time difference by group using pandas?
- Capitalize first letter of each word in a dataframe column
- Compute the running (cumulative) maximum for a series in pandas
- Get total of Pandas column
- Sorting columns and selecting top n rows in each group pandas dataframe
- Python Pandas replace NaN in one column with value from corresponding row of second column
- Get first and second highest values in pandas columns
- ImportError: No module named ‘pandas.indexes’
- python dask DataFrame, support for (trivially parallelizable) row apply?
- Enumerate each row for each group in a DataFrame
- Python How to use ExcelWriter to write into an existing worksheet
- replace value by using regex to np.nan
- Custom ImageDataGenerator() for half a million images where labels and pixels are in 2 separate DataFrames using Keras (or any other library) [closed]
- Pandas: IndexingError: Unalignable boolean Series provided as indexer
- How does one insert statistical annotations (stars or p-values)
- What’s the alternative to pandas chain indexing?