Created
February 13, 2019 08:05
-
-
Save tanveer-sayyed/22f10a41346817ae582290a25ae6a72c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [59]: | |
print('Data types:\n', new_df.dtypes) | |
# (Although such an assignment is not correct, but the purpose here is to | |
# demonstrate use of mean/median/mode academically so let's continue with it) | |
new_df.loc['i2', 'c3'] = 10 | |
new_df['c3'] = new_df['c3'].astype('float64') # if skipped a warning would be thrown | |
# as '#$%' was a string. | |
print('\n Data types(after):\n', new_df.dtypes) | |
Out [59]: | |
Data types: | |
c0 float64 | |
c1 float64 | |
c2 float64 | |
c3 object | |
dtype: object | |
Data types(after): | |
c0 float64 | |
c1 float64 | |
c2 float64 | |
c3 float64 | |
dtype: object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment