Skip to content

Instantly share code, notes, and snippets.

View Indrajitharidas's full-sized avatar

Indrajit Haridas Indrajitharidas

  • San Francisco, CA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am Indrajitharidas on github.
  • I am indrajitharidas (https://keybase.io/indrajitharidas) on keybase.
  • I have a public key whose fingerprint is 4334 057E A6DC A032 6544 09CB ADB0 F711 08C0 F028

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am indrajitharidas on github.
  • I am indrajitharidas (https://keybase.io/indrajitharidas) on keybase.
  • I have a public key whose fingerprint is 467E 7F87 C057 8886 DBC4 93F8 0DC0 2FD2 F485 5AC1

To claim this, I am signing this object:

# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!