It wasn’t a big problem but when I started this project, it did become a pain as I didn’t know that in python 2 we had to convert number to float to get a decimal number where quotient would be 0. I have just started the next section, which is on pandas (Course Link) and right now can’t say what is coming next.
P.S. with different versions of python the syntax used in libraries is also different. Where in python 3 we can use
and inside function calls.
import pandas as pd
df = pd.DataFrame([
['January', 100, 100, 23, 100],
['February', 51, 45, 145, 45],
['March', 81, 96, 65, 96],
['April', 80, 80, 54, 180],
['May', 51, 54, 54, 154],
['June', 112, 109, 79, 129]],
march_april = df[(df.month == 'March') | (df.month == 'April')]
Here in the second last line, inside the getter attribute of
df we use | only for python 2, (& also available). Whereas, in python 3 we can use
and. This is not only the case with pandas but also with matplotlib and numpy