‘DataFrame’ object has no attribute ‘sort’

sort() was deprecated for DataFrames in favor of either: sort_values() to sort by column(s) sort_index() to sort by the index sort() was deprecated (but still available) in Pandas with release 0.17 (2015-10-09) with the introduction of sort_values() and sort_index(). It was removed from Pandas with release 0.20 (2017-05-05).

How to create a new text file using Python

Looks like you forgot the mode parameter when calling open, try w: The default value is r and will fail if the file does not exist Other interesting options are See Doc for Python2.7 or Python3.6 — EDIT — As stated by chepner in the comment below, it is better practice to do it with a withstatement (it guarantees that the file will be closed)

why should I make a copy of a data frame in pandas

This expands on Paul’s answer. In Pandas, indexing a DataFrame returns a reference to the initial DataFrame. Thus, changing the subset will change the initial DataFrame. Thus, you’d want to use the copy if you want to make sure the initial DataFrame shouldn’t change. Consider the following code: You’ll get: In contrast, the following leaves … Read more

heroku: no default language could be detected for this app

I can’t remember how I fixed this but looking at the Date Modified in my files after I posted this question I created two files: runtime.txt (thanks rurp) which contains: Procfile which contains: This is a Django project and projectname.wsgi leads to a wsgi.py located at projectname/wsgi.py This contains: