Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Somehow, in a bigger dataframe (more rows), there are some rows left with a NaN. Do you know what might be a case? Commented Apr 16, 2017 at 18:37
  • Which method are you using, and can you provide the sample values for one of these rows? Commented Apr 16, 2017 at 18:38
  • Hmm now I reran the code and Im getting NaN values for the series I didn't input into dict. So the best way is just to replace all the NaN as 'Yes' or 'No', right? Commented Apr 16, 2017 at 18:49
  • 1
    So, with the dictionary code, you need to include in the dictionary all Series in the dataframe even if this is an empty array (i.e. for the case where you haven't watched any of the episodes for a certain series, otherwise you will be left with nan values in the final array. Does that make sense? i..e your dictionary might look like watchlist = {'Breaking Bad (2008)': [1.1, 4.7, 2.9], 'Suits (2011)': [4.7, 5.6],'House (2008)':[],'Seinfeld':[]} Commented Apr 16, 2017 at 19:11
  • So in case I have many differen series (like 20+), do I have to type all of their names manually when doing concatenating and dropping columns, or do you think there is a good way to automate that? Commented Apr 17, 2017 at 15:39