Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas set index integer not float

df["int"] = pd.Series([], dtype=object)
df["str"] = pd.Series([], dtype=str)
df.loc[0] = [0, "zero"]
print(df)
print()
df.loc[1] = [1, None]
print(df)

   int   str
0    0  zero
1  NaN   NaN

  int   str
0   0  zero
1   1  None
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #set #index #integer #float
ADD COMMENT
Topic
Name
1+8 =