Python Forum
kindly support with this dropna function not working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
kindly support with this dropna function not working
#2
file_name = "C:/Users/Gheevar/Documents/PYTHON CLASS/home study/PRACTICE WORK BOOK.xlsx"
sheet = "Sheet1"  ###Sheet name

import pandas as pd   ##pandas
df = pd.read_excel(io=file_name, sheet_name=sheet)

df['SPECIALITY'] = df['SPECIALITY'].str.lower()   ##convering specality to lower case
pd.set_option('display.max_columns', None)        ##to display all columns below
pd.set_option('display.max_rows', None)

df.replace({"SPECIALITY":["pediatric trauma","trauma surgery","ortho_trauma"]}, "trauma")

df.dropna(subset = ['DOCUMENTED'], inplace=True)

df.pivot(index= 'DOCUMENTED', columns='SPECIALITY', values="PT URN")

Attached Files

.xlsx   PRACTICE WORK BOOK.xlsx (Size: 9.65 KB / Downloads: 44)
Reply


Messages In This Thread
RE: kindly support with this dropna function not working - by gheevarpaulosejobs - Jul-24-2023, 03:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Excel isnt working properly after python function is started IchNar 2 403 May-01-2024, 06:43 PM
Last Post: IchNar
Exclamation Function Not Working Alivegamer 7 1,996 Jul-19-2022, 01:03 PM
Last Post: deanhystad
  try function working on PC but not raspberry pi AnotherSam 1 1,613 Oct-11-2021, 04:51 AM
Last Post: bowlofred
  Dropna not working WiPi 3 9,845 May-15-2020, 01:26 PM
Last Post: WiPi
  Kindly asking for help with Pywinauto louloulou 0 2,075 Mar-05-2020, 06:55 PM
Last Post: louloulou
  Input() function not working in VS Code darpInd 7 13,667 Feb-17-2020, 03:28 PM
Last Post: snippsat
  Unrelated new function causing existing working function to fail Nick_G 2 2,334 Jan-27-2020, 07:21 PM
Last Post: Nick_G
  User Defined function not working Raj_Kumar 4 3,104 Dec-17-2019, 12:44 PM
Last Post: buran
  Function not working eglaud 0 1,688 Oct-24-2019, 03:30 PM
Last Post: eglaud
  Kindly explain this error BlackList96 4 4,369 Jul-16-2019, 12:46 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020