question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Several functions using DataFrame.ix which has been removed from Pandas 1.0.0

See original GitHub issue

Pandas 1.0.0 has removed the DataFrame.ix indexer. This indexer was being used in several core functions including rebase() and calc_cagr(). In all, there are 11 instances of this indexer being used in the core module. Pandas also seems to have become aggressive in their policy of requiring users to update. It would be good to update the indexer to the suggested .iloc or .loc, as appropriate.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

3reactions
amoriellocommented, Mar 22, 2020

Hey folks,

❯ python
Python 3.8.2 (default, Mar 11 2020, 00:29:50)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ffn
>>> ffn.__version__
(0, 3, 4)

But if I look in my python3.8/site-packages/ffn/core.py

      def display_monthly_returns(self):
          """
          Display a table containing monthly returns and ytd returns
          for every year in range.
          """
          data = [['Year', 'Jan', 'Feb', 'Mar', 'Apr', 'May',
                   'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'YTD']]
          for k in self.return_table.index:
              r = self.return_table.ix[k].values.             <<<<<<< uses "ix"
              data.append([k] + [fmtpn(x) for x in r])
          print(tabulate(data, headers='firstrow'))

But in master

I see

    def display_monthly_returns(self):
        """
        Display a table containing monthly returns and ytd returns
        for every year in range.
        """
        data = [['Year', 'Jan', 'Feb', 'Mar', 'Apr', 'May',
                 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'YTD']]
        for k in self.return_table.index:
            r = self.return_table.loc[k].values             <<< uses loc: OK
            data.append([k] + [fmtpn(x) for x in r])
        print(tabulate(data, headers='firstrow'))

This code changed happened in August 4 2018 with this commit

But the Pypi package never got updated: https://pypi.org/project/ffn/#history

@JordanPlatts or @pmorissette or any maintainer, can you guys please bump up the version and upload latest ffn to Pypi?

Thanks a lot!

1reaction
JordanPlattscommented, Feb 20, 2020

I am busy with work and can’t spend time of bt or ffn. Feel free to fix the issues and I can merge them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's new in 1.0.0 (January 29, 2020) - Pandas
The pandas 1.0 release removed a lot of functionality that was deprecated in previous releases (see below for an overview).
Read more >
AttributeError: 'DataFrame' object has no attribute 'ix'
I receive "Location based indexing can only have [integer, integer slice (START point is INCLUDED, END point is EXCLUDED), listlike of integers, ...
Read more >
The Pandas DataFrame: Make Working With Data Delightful
In this tutorial, you'll get started with Pandas DataFrames, which are powerful and widely used two-dimensional data structures. You'll learn how to perform ......
Read more >
Changelog - dplyr
It has the same interface as group_by() , but returns a rowwise data frame of grouping keys, supplemental with a list-column of data...
Read more >
Pandas apply() Function to Single & Multiple Column(s)
For example, let's say we have three columns and would like to apply a function ... Below are quick examples # Using Dataframe.apply()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found