Dataframe Sorting problems

Source: Internet
Author: User

1  from Import DataFrame 2 df = DataFrame (dictlist)3 df = df.sort_values (by= ' Internalreturn ', ascending=false)

A 122-symbol real-time risk analysis program is now being written to extract the best trading symbols and their position cycle information. Because the indicator is more, so decided to use dataframe structure.

When I use the following code to generate a new DF structure

1 df = df.sort_values (by='internalreturn', Ascending=false, Inplace=true)

The result is empty.

Alternative methods:

Df2=df.nlargest (columns='internalreturn')

You can also use

Df2=df.head (10)

Accordingly, there are also:

1 df2=df.tail (ten)2 df2=df.nsmallest (10,columns=internalreturn)

Because the main symbol is not changed frequently in practice, the short-term position change does not affect the symbol.

Spreads is actually sunk cost. There are only two kinds of varieties with low volatility spreads: almost no fluctuations or too large spreads.

Give two examples:

THB 15 minutes is 20 points, not low volatility in forex, but the Thai baht spread is 11 points, in other words even if the direction is consistent, 15 minutes yield is still more than 50% of the probability is negative.

Platinum has a 15-minute yield of over 100% and is ranked number one in metal, but spreads account for 16.5%

In the long run, the volatility spread ratio is a stable value. Some contingencies may significantly change the volatility of the spreads, such as the Turkish lira of the Turkish coup this year, the UK's Brexit pound Sterling, but after a prolonged period of time, a stable value can be obtained.

The significance of monitoring fluctuation spread ratio is to filter the short-term symbol and adjust the variety pool.

Dataframe Sorting problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.