Hi, everyone.
Is there a way to store the number of element values that match a specific value in a specific column of DataFrame as variables?
You are trying to save Row numbers as variables and then try to store elements corresponding to the row values in different columns as different variables. I'd appreciate your help.
python
city = [Seoul, Busan, Daegu, Daejeon, Gwangju, Daejeon]
df = pd.DataFrame (columns = ['city'], index = range (len(city)))))
df['City'] = city
print(df)
print('-' * 10)
city in [Busan, Daejeon]:
cityIndex = df.index[df['city'] == city.tolist() #LISTTYPE
print(city, cityIndex)
587 Uncaught (inpromise) Error on Electron: An object could not be cloned
589 GDB gets version error when attempting to debug with the Presense SDK (IDE)
563 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
861 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.