Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

insert single value in dataframe using index

>>> df = pd.DataFrame([[0, 2, 3], [0, 4, 1], [10, 20, 30]],
               index=[4, 5, 6], columns=['A', 'B', 'C'])
>>> df.at[4,'B']
2
>>> df.at[4,'B'] = 10
>>> df.at[4,'B']
10
Source by pandas.pydata.org #
 
PREVIOUS NEXT
Tagged: #insert #single #dataframe #index
ADD COMMENT
Topic
Name
4+2 =