stragu

1

votes
0

answer
25

views

Why doesn't pandas update a variable's dtype when populating a dataframe?

I noticed a difference between two pandas version, and was wondering why that was the case / if it was an expected behaviour: import pandas as pd df = pd.DataFrame(columns = ("Name", "Age")) df.loc[1] = "Jane", 5 df.loc[2] = "Riley", 24 df.dtypes In my test: with Python 3.5 and Pandas 0.18.1, popula...
stragu
2

votes
1

answer
30

views

Why does seq() create both int and num vectors whereas c() never creates int vectors?

I can't figure out why seq() can output different classes depending on if decimal points are present in the elements, whereas c() always creates a num vector regardless of presence or absence of decimals. For example: seqDec
stragu