Skip to content

Tag: python

Verify that a column name is a unique identifier

I have a dataset called df_authors and in that dataset I have a column called author. I have to verify that df_authors.author is a unique identifier. What I tried, len(df_authors) == len(df_authors[‘author’].unique()), and this returns True. My question is have I done this right. I found this line…

How to format very small numbers in python?

How to format 1.3435434533e-8 into 1.34e-8 in python? Keep only two digits. The round() method will round this number to zero. Answer The “g” formatting suffix on string mini-format language, used both by f-strings, and the .format method will do that:

How to add aliases to an input dictionary?

Recently I started a project. My goal was it to have a script, which, once launched, could be able to control actions on the hosts computer if an instruction was send via email. (I wanted this so I could start tasks which take a long time to complete while I’m away from home) I started programming and n…