Sorry, you do not have permission to ask a question.

Sorry, you do not have permission to add post.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Aurora Telekom Logo Aurora Telekom Logo

Aurora Telekom

Aurora Telekom Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • About Us
  • Blog
  • Contact Us
Home/ Questions/Q 192
Next

Aurora Telekom Latest Questions

Questioner
  • 0
  • 0
Questioner
Asked: December 3, 20242024-12-03T13:45:54+00:00 2024-12-03T13:45:54+00:00In: Language

Help Refining DataFrame

  • 0
  • 0

I have a DataFrame that I wish to refine in a way that only the relevant data stays on top. The only way I figured out how to do it was by separating the data frame as I will also need to scatter plot it later and transforming it into two lists, passing them through a loop. This is not working out as PyCharm console always get stuck, not running the code untill the end or not returning the k as it was intended to. Please help me improve this code and make it work.
Here is the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pandas as pd
from matplotlib import pyplot as plt
df = pd.read_csv("C:/Users/thech/OneDrive/Documents/Rocky/Workshop2A/200mm/DataXY/ExtractedCellsData/CurveE_RR0.csv")
x = df.iloc[:, 0]
y = df.iloc[:, 1]
#plt.scatter(x, y)
#plt.show(block=True)
xmax = x.iloc[-1]
ymax = y.max()
xmin = x.iloc[0]
ymin = y.min()
tgbeta = 2*(ymax-ymin)/(xmax-xmin)
xl = x.to_list()
yl = y.to_list()
def refine_data(xn: list[float], yn: list[float], tangent: float) -> int:
    k = 0  # number of deleted points/Cells
    for i in range(len(yn)):      # loop
        if abs(xn[i])/yn[i] < 0.8/tangent:
            yn[i] = yn[k]
            xn[i] = xn[k]
            k += 1
        return k
    refine_data(xl, yl, tgbeta)
Larz60+ write Nov-04-2024, 10:17 AM:
Please post all code, output and errors (it it’s entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the “Preview Post” button to make sure the code is presented as you expect before hitting the “Post Reply/Thread” button.
Tags have been added tthis time. Please use BBCode tags on future posts.
english
  • 0 0 Answers
  • 1k Views
  • 0 Followers
  • 0
    • Report
  • Share
    Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Stats

  • Questions 86
  • Answers 3
  • Best Answers 0
  • Users 3
  • Popular
  • Answers
  • Questioner

    How do native speakers tell I’m foreign based on my ...

    • 3 Answers
  • Questioner

    Funbahis Giriş Güncel Giriş Linki 2024

    • 0 Answers
  • Questioner

    Trying to create a simple linear regression module but getting

    • 0 Answers
  • James Wane
    James Wane added an answer Because non-native speakers use English differently as compared to native… April 19, 2018 at 2:03 am
  • Barry Carter
    Barry Carter added an answer You probably have strange grammar. Pretty much every language has… April 19, 2018 at 2:03 am
  • John Peter
    John Peter added an answer It may be little things like not using native idioms,… April 19, 2018 at 2:03 am

Related Questions

  • Redwin Giriş Güncel Giriş Linki 2024

    • 0 Answers
  • Trying to create a simple linear regression module but getting

    • 0 Answers
  • Trying to create a simple linear regression module but getting

    • 0 Answers
  • update the colorbar visualsation from the previous to the new ...

    • 0 Answers
  • Betcup Giriş Güncel Giriş Linki 2024

    • 0 Answers

Top Members

Trending Tags

english

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • Buy Theme

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.