Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged pandas

0 votes
416 views
1 answer
    I have a field for call length in my raw data which is listed as an object, such as: 00:10:30 meaning 10 minutes and 30 seconds. How can I convert this ... value I want to work with. (Timestamp * 24 * 60) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    I have a big dataset and when I try to run this code I get a memory error. user_by_movie = user_items.groupby(['user_id', 'movie_id'])['rating'].max() ... and it worked fine! how can I fix this error? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
454 views
1 answer
    I have a text file that contains data like this. It is is just a small example, but the real one is pretty similar. I am wondering how to display such data in an "Excel Table" like this using Python? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
426 views
1 answer
    Building off this answer, is there a way to filter a Pandas dataframe by a list of substrings? Say I want to find all rows where df['menu_item'] ... ) | (df['menu_item'].str.contains('spaghetti')] See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
495 views
1 answer
    Scenario: I am trying to read a excel file from a server folder and after that read each worksheet of that file into a dataframe and perform some ... Question: What is the proper way to achieve this? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
400 views
1 answer
    As an exercise, I'm reproducing a plot from The Economist with matplotlib So far, I can generate a random data and produce two plots independently. I'm ... 2009,2016),height=df2['usage']) plt.show() See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
430 views
1 answer
    Normally I anonymize my data by using hashlib and using the .apply(hash) function. Now im trying a new approach, imagine I have to following df called ' ... use that index for the number after 'person'. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
545 views
1 answer
    I am looking to build a function that creates a rolling total by code by day for the below DataFrames, where the In for each code on a date is subtracted from the ... /01/2019 A 9 16 16/01/2019 A 7 """ See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
431 views
1 answer
    I have some basic car engine size, horsepower and body type data (sample shown below) body-style engine-size horsepower 0 convertible 130 111.0 2 hatchback ... ') ax.set_ylabel("engine-size") ax.legend() See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
338 views
1 answer
    I have a data frame consists of column 1 i.e event and column 2 is Datetime: Sample data Event Time 0 2020-02-12 11:00:00 0 2020-02-12 11:30:00 2 ... 1 to got change to 0 or any other value or vice versa See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
459 views
1 answer
    I have the following data. ID1 ID2 Value 1 2 5.5 2 1 10 1 3 5 Expected output: ID1 ID2 Value 1 2 5.5 2 1 10 I only want to hold data, ... I want to delete this datarow. How can I do this with pandas? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
479 views
1 answer
    I have a pandas df which I am formatting using xlsx package currently I have the option to format an entire row or column using xlsx but not specific cells ... .set_row(7 , None , tot_fmt) writer.save() See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
398 views
1 answer
    I have a folder with about 100 CSVs (Downloads/challenges). Each CSV has the same 50+ columns. Each CSV is titled something like ... this work. Any help would be appreciated! See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
637 views
1 answer
    I have a dataframe like this (many rows): Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec a 34 24 47 30 11 57 47 44 22 33 16 39 b 50 53 42 ... I want. Any ideas on how I can do this in python? Thank you See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
389 views
1 answer
    I have two columns in a pandas DataFrame: authors and name. I want to create a third column: a cell's value is True if the corresponding row's ... anyone know how to create the third column in Python? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.9k views
1 answer
    Using this question: Pandas writing dataframe to CSV file as a model, I wrote the following code to make a csv file: df.to_csv('/Users/Lab/Desktop/ ... ') in the code, but got the same error. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
883 views
1 answer
    I have a data frame with head as: m_srcaddr total_fwd_size total_rev_size 0 10.19.139.141 2479.335 175.000 1 10.19.139.143 888.141 92.442 2 10. ... x-axis data but its failing as m_srcaddr not integer. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
368 views
1 answer
    I have a column in my data frame which has values like '3.456B' which actually stands for 3.456 Billion (and similar notation for Million). How to convert ... this column? Is there a better way to do it? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
488 views
1 answer
    I'm struggling with getting a simple correlation done. I've tried all that was suggested under similar questions. Here are the relevant parts of the ... 5328.67 Name: CCMP Index_close_px, dtype: object See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
275 views
1 answer
    I'm using the Kobe Bryant Dataset. I wish to predict the shot_made_flag with KnnRegressor. I've used game_date to extract year and month features: # ... avoid data leakage and cv for finding optimal k. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
476 views
1 answer
    I have: a week number a day of week a year I want to find the date from that. How to do it in Python? e.g. 2020 week1 Saturday Expected output 01/04/2020 See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
453 views
1 answer
    Am new to python programming. Can anyone pls check the below syntax for if condition- if df1[A]<= df2[B]): print("") else: print("") Getting this exception - ... bool(), a.item(), a.any() or a.all(). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
431 views
1 answer
    I'm trying to create a derived column based on two conditions being met for values in existing columns. One of the conditions that needs to be met ... attached with the sample_df, this logic is correct. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
369 views
1 answer
    I have two data frames : one with all my data (called 'data') and one with latitudes and longitudes of different stations where each observation starts ... that the resulting data would look like this : See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
488 views
1 answer
    Hello I want to add a leading zero in my current column with str and int but I do not know how. I only want to add leading zeros to the numbers ex: ... Convert into: Section 01 02 03 04 4SS 15 S1 A111 See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.7k views
1 answer
    I have the following code, and I am trying to write a data frame into an "existing" worksheet of an Excel file (referred here as test.xlsx). Sheet3 is ... for me and I can't comment on that post either. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
+1 vote
1.4k views
1 answer
    I am using Pandas to compute some financial risk analytics, including Value at Risk. In short, to compute Value at Risk (VaR), you take a time series of ... answer i am looking for is -77.4 Thanks, Ryan See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
296 views
1 answer
    I am attempting to remove some observations in a pandas DataFrame where the similarities are ALMOST 100% but not quite. See frame below: Notice how "John", ... such an issue? Any idea on a remedy? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
...