I'm pretty new to python. My goal is to change a float into an int. The float is a series. There are no Nans. I've checked out quite a few posts, including: Pandas: change data type of Series to String.
i've tried a few different types of syntax:
```comp.month.apply(int)```
Here's the error that followed that.
```TypeError Traceback (most recent call last) <ipython-input-190-690a8228abec> in <module>()
----> 1 comp.month.apply(int)
/Users/halliebregman/anaconda/lib/python2.7/site-packages/pandas/core/series.pyc in apply(self, func, convert_dtype, args, **kwds)
2058 values = lib.map_infer(values, lib.Timestamp)
----> 2060 mapped = lib.map_infer(values, f, convert=convert_dtype)
2061 if len(mapped) and isinstance(mapped[0], Series):
2062 from pandas.core.frame import DataFrame
pandas/src/inference.pyx in pandas.lib.map_infer (pandas/lib.c:58435)()
TypeError: 'file' object is not callable```
and also:
```with open ("ints.csv", "w") as ints:
for i in range(len(comp)):
months = int(comp['month'][i])
days = int(comp['day'][i])
print months, days
ints.write('{} {} \n'.format(months, days))```
Followed by this error:
```TypeError Traceback (most recent call last) <ipython-input-191-0d6fe0a99830> in <module>()
1 with open ("ints.csv", "w") as ints:
2 for i in range(len(comp)):
----> 3 months = int(comp['month'][i])
4 days = int(comp['day'][i])
5 print months, days
TypeError: 'file' object is not callable```
What am I missing here? It seems like this should be simple :/
Thanks!