I am converting a Stata dataset to a dataframe, then multiply two columns to create a third one. The chosen datatype for the two columns is int8 and for some reason the new column blindly follows that.
For instance, this code
df = pd.read_stata(file) df['w_age_educ'] = df['w_age'] * df['weduc'] print(df[['w_age', 'weduc', 'w_age_educ']].dtypes) print(df[['w_age', 'weduc', 'w_age_educ']][:3])
would give me
w_age int8 weduc int8 w_age_educ int8 dtype: object w_age weduc w_age_educ 0 44 14 104 1 34 13 -70 2 33 18 82
Is this a bug or intended behavior? If the latter, how can I get my desired product column?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4