Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Resampling and regrouping using pivot table
Post: RE: Resampling and regrouping using pivot table

(Apr-25-2020, 11:50 AM)buran Wrote: if I understand correctly import pandas as pd colss = {'Date_Time': ['2017-11-10','2017-11-11','2017-11-12','2017-11-13', '2017-11-14', '2017-11-15', '2017-11-16'...
karlito Data Science 4 3,370 Apr-25-2020, 04:03 PM
    Thread: Resampling and regrouping using pivot table
Post: RE: Resampling and regrouping using pivot table

(Apr-25-2020, 10:59 AM)buran Wrote: Please, don't post images of code and data. Copy/paste your code and data using BBcode tags. See BBcode help for more info. https://idownvotedbecau.se/imageofcode...
karlito Data Science 4 3,370 Apr-25-2020, 11:20 AM
    Thread: Resampling and regrouping using pivot table
Post: Resampling and regrouping using pivot table

code added Hi, I'm trying to group all the value of the dataframe essaie['night_cons'] by day (and by year) but the result just gives me NAN. please see the image below. colss = {'Date_Time': ['201...
karlito Data Science 4 3,370 Apr-25-2020, 10:58 AM
    Thread: prediction using linear regression (extrapolation?) in a loop
Post: prediction using linear regression (extrapolation?...

Hey! sorry but the title is not clear enough because I didn't know how to describe it with few words. As you can see in the image I have used interp1d to graphically "predict" the value of y when x=...
karlito Data Science 0 3,325 Feb-05-2020, 10:56 AM
    Thread: Linear Regression on Time Series
Post: RE: Linear Regression on Time Series

(Jan-27-2020, 03:00 PM)buran Wrote: maybe import pandas as pd import numpy as np df = pd.DataFrame([['2017-11-10', 4470.76], ['2017-11-11', 5465.72], ['2017-11-12', 15465.72]], columns=['Date_Time',...
karlito Data Science 5 4,012 Jan-28-2020, 09:20 AM
    Thread: Linear Regression on Time Series
Post: RE: Linear Regression on Time Series

(Jan-27-2020, 02:22 PM)buran Wrote: The error is clear - string '2017-11-10' could not be converted to float (obviously) Yes I can read :) but for regression purpose, I read that all dates should be...
karlito Data Science 5 4,012 Jan-27-2020, 02:34 PM
    Thread: Linear Regression on Time Series
Post: Linear Regression on Time Series

Hi, I'm trying this time to use a simple linear regression on my time series dataset to linearly predict data. But I got this error and I don't know how to handle it. Any ideas? # print df.head() ...
karlito Data Science 5 4,012 Jan-27-2020, 02:19 PM
    Thread: Concatenate/Join/Merge two Dataframes
Post: RE: Concatenate/Join/Merge two Dataframes

(Jan-21-2020, 11:04 AM)perfringo Wrote: Totally unclear for me what data you have and how you want to manipulate it. Want to add column to existing dataframe? >>> df = pd.DataFrame({'nums...
karlito Data Science 4 2,822 Jan-21-2020, 12:36 PM
    Thread: Concatenate/Join/Merge two Dataframes
Post: RE: Concatenate/Join/Merge two Dataframes

(Jan-20-2020, 04:26 PM)jefsummers Wrote: What are you wanting to do? One source dataframe has a date column, the other does not. What behavior are you expecting from the attempt at merge? Hi, the fi...
karlito Data Science 4 2,822 Jan-21-2020, 07:15 AM
    Thread: Concatenate/Join/Merge two Dataframes
Post: Concatenate/Join/Merge two Dataframes

Hi, I'm trying to concatenate two Dataframes with the same size but doesn't seem to work. any ideas? links to images - my Dataframes: https://www.imageupload.net/image/VbexE result = pd.concat([test...
karlito Data Science 4 2,822 Jan-20-2020, 01:05 PM
    Thread: Pandas merge csv files
Post: RE: Pandas merge csv files

(Dec-16-2019, 10:01 AM)Axel_Erfurt Wrote: Are the separators commas? Whatever. You could put them together as strings. file1 = "/path/file1.csv" file2 = "/path/file2.csv" outfile = "/path/all_toge...
karlito Data Science 2 3,241 Dec-16-2019, 10:59 AM
    Thread: Pandas merge csv files
Post: Pandas merge csv files

Hi, I was trying to merge two csv files and it worked BUT the first column of the beginning of the merged file starts with a "," (see image). Any ideas? Thanks code from os import chdir from glob ...
karlito Data Science 2 3,241 Dec-16-2019, 09:17 AM
    Thread: How to use bfill und groupby under conditions
Post: How to use bfill und groupby under conditions

Hi, I'm trying to backfill previous rows (which are filled with 0) with the mean of the last value before each serie of last 0. see picture for a better understanding. [Image: https://ibb.co/1ssVXsm...
karlito Data Science 1 1,902 Dec-13-2019, 03:50 PM
    Thread: huge and weird values after applying some calculations
Post: RE: huge and weird values after applying some calc...

(Dec-13-2019, 02:21 AM)sandeep_ganga Wrote: tested with round(2) for data['A'], data['B'] and also for after addition, data['A+B'], now the data looks good on output file. import pandas as pd # R...
karlito Data Science 2 2,223 Dec-13-2019, 08:32 AM
    Thread: weird number output
Post: RE: weird number output

(Dec-12-2019, 05:44 PM)perfringo Wrote: Yes, in Excel. What is cell format in Excel? It's on custom
karlito Data Science 12 4,766 Dec-13-2019, 08:06 AM
    Thread: weird number output
Post: RE: weird number output

(Dec-12-2019, 02:07 PM)perfringo Wrote: Isn’t it somehow cell formatting issue? 30.12 and 6.96? Other numbers seem to be too large for displaying as date. You mean in Excel?
karlito Data Science 12 4,766 Dec-12-2019, 04:12 PM
    Thread: weird number output
Post: RE: weird number output

(Dec-12-2019, 08:44 AM)sandeep_ganga Wrote: try if round helps here, source:trim_numbers.csv a -10949.600833 -21294.745833 -21679.851667 -100706.196667 -21648.102500 -149756.456667 -19041.302500 ...
karlito Data Science 12 4,766 Dec-12-2019, 12:46 PM
    Thread: weird number output
Post: RE: weird number output

(Dec-09-2019, 07:28 AM)DeaD_EyE Wrote: Without code, it's a guessing game.Hi, I've posted an edited Thread about this issue. please follow the link if you want to help.
karlito Data Science 12 4,766 Dec-12-2019, 07:36 AM
    Thread: huge and weird values after applying some calculations
Post: huge and weird values after applying some calculat...

OK guys, The values I got for some columns are just too huge other are in day/month format (see excel picture) and I was wondering why. Here is my code and the file is here here you can see the excel...
karlito Data Science 2 2,223 Dec-11-2019, 10:27 AM
    Thread: weird number output
Post: RE: weird number output

(Dec-09-2019, 02:00 PM)perfringo Wrote: (Dec-09-2019, 07:38 AM)karlito Wrote: I don't think code will be needed here (correct em if I'm wrong, cause there is a lot of steps) ... I read the file wi...
karlito Data Science 12 4,766 Dec-11-2019, 08:42 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020