Posts

Showing posts from January 12, 2019

Willie du Plessis (rugby player born 1990)

Image
Willie du Plessis (rugby player born 1990) From Wikipedia, the free encyclopedia Jump to navigation Jump to search Willie du Plessis Full name Willem Nicolaas Frederik du Plessis Date of birth ( 1990-06-05 ) 5 June 1990 (age 28) Place of birth Pretoria, South Africa Height 1.85 m (6 ft 1 in) Weight 93 kg (14 st 9 lb; 205 lb) School Afrikaanse Hoër Seunskool University University of Pretoria Rugby union career Position(s) Fly-half Current team Montpellier Youth Career 2008 Blue Bulls 2009–2011 Sharks 2011 Blue Bulls Amateur team(s) Years Team Apps (Points) 2012–2013 UP Tuks 12 (46) Senior career Years Team Apps (Points) 2012 Blue Bulls 7 (86) 2013 Free State Cheetahs 9 (6) 2014 Golden Lions 10 (93) 2014–2015 Free State Cheetahs 12 (111) 2015 Cheetahs 8 (7) 2015 → Toulon 7 (20) 2015–present Bayonne 36 (205) Correct as of 5 March 2017 Willem Nicolaas Frederik du Plessis (born 5 June 1990 in Pretoria) is a South African rugby union player,

Pandas Dataframe interpreting columns as float instead of String

Image
4 I want to import a csv file into a pandas dataframe. There is a column with IDs, which consist of only numbers, but not every row has an ID. ID xyz 0 12345 4.56 1 45.60 2 54231 987.00 I want to read this column as String, but even if I specifiy it with df=pd.read_csv(filename,dtype='ID': str) I get ID xyz 0 '12345.0' 4.56 1 NaN 45.60 2 '54231.0' 987.00 Is there an easy way get the ID as a string without decimal like '12345' without having to edit the Strings after importing the table? python python-3.x pandas dataframe types share | improve this question edited Nov 13 '18 at 13:16 Malik Asad 283 1 10 asked Nov 13 '18 at 12:03 Georg B Georg B 26 4 Is possible empty values in numeric columns? – jezrael Nov 13 '18 at 12:34 If your concern is output format, then fix this when you export the data (e.g. to_csv , to_string ), not by changing your underlying data