Open
Description
A bit non-trival (maybe coerce back after) if possible?
maybe just change this to an actual append?
In [1]: df = DataFrame({'a' : range(10)}, dtype='i4')
In [2]: df
Out[2]:
a
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
[10 rows x 1 columns]
In [3]: df.dtypes
Out[3]:
a int32
dtype: object
In [4]: df.loc[10] = 99
In [5]: df
Out[5]:
a
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 99
[11 rows x 1 columns]
In [6]: df.dtypes
Out[6]:
a float64
dtype: object
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
goretkin commentedon Sep 30, 2016
Is there a way to just assert the type on an enlargement?
I'm trying to avoid this...
jorisvandenbossche commentedon Sep 30, 2016
You can avoid this by not assigning with enlargement.
Options are populating the dataframe on construction, or using
concat
mroeschke commentedon Jul 6, 2018
Adding to a non-empty dataframe no longer enlarges (Jeff's example) but the empty case still does.
mroeschke commentedon Oct 22, 2019
The first example could use a regression test since it works on master.
10 remaining items