Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line
Post: RE: pandas.errors.ParserError: Error tokenizing da...

1. Try defining the particular character used in dataset to separate fields eg - X = pd.read_csv(r"D:\Clustering\text-cluster-master\text-cluster-master\Articles.csv", index_col='id',delimiter='|')2...
klllmmm General Coding Help 9 656 Jun-13-2021, 03:42 PM
    Thread: Unable to access the user input value given to daterangepicker
Post: Unable to access the user input value given to dat...

In an HTML web form, I want to access the user-selected date range (backend is in python django framework, I'm referring the daterange picker examples in this page http://www.daterangepicker.com/#exam...
klllmmm General Coding Help 1 481 May-26-2021, 06:48 PM
    Thread: Schedule a task and render/ use the result of the task in any given time
Post: RE: Schedule a task and render/ use the result of ...

(May-04-2021, 07:07 AM)menator01 Wrote: Not sure if this is what you want import schedule, time from datetime import datetime def my_task(): custom_time = datetime(2021, 5, 1, 17, 30, 29, 43171...
klllmmm General Coding Help 2 387 May-04-2021, 10:17 AM
    Thread: Schedule a task and render/ use the result of the task in any given time
Post: Schedule a task and render/ use the result of the ...

I want to schedule a task and use the result of the task while the schedule is being running. For example, once in every minute I want to get the current time and assigned it to a variable call "now4...
klllmmm General Coding Help 2 387 May-04-2021, 01:55 AM
    Thread: Split and organize my Pandas Dataframe
Post: RE: Split and organize my Pandas Dataframe

Date can not be determine certainty as date is not shown. Ex. below entries are belong to March month and it could be any Saturday within March month. TAM3595;A319;SDU;CGH;Sat 07:25AM -03;;; TAM8146...
klllmmm General Coding Help 4 605 Apr-18-2021, 02:56 AM
    Thread: Split and organize my Pandas Dataframe
Post: RE: Split and organize my Pandas Dataframe

Hope this helps import pandas as pd url_ini = 'https://flightaware.com/live/fleet/' url_fim = '/cancelled' ncia = ['SKU', 'TAM'] for i in range(len(ncia)): url = url_ini + str(ncia[i]) ...
klllmmm General Coding Help 4 605 Apr-17-2021, 05:38 PM
    Thread: How to save json data in a dataframe
Post: RE: How to save json data in a dataframe

data = json.loads(test) df = pd.json_normalize(data['geomagnetic-field-model-result'])
klllmmm General Coding Help 1 446 Apr-15-2021, 02:44 PM
    Thread: Creating column in python based on the other colums value count
Post: RE: Creating column in python based on the other c...

Hope this helps import pandas as pd import numpy as np df1 = pd.DataFrame(data = {'USERS_PK1':[550395,550395,550395,550395,550395,931192,931192,931192,931192,931192], '...
klllmmm General Coding Help 2 601 Apr-14-2021, 04:30 PM
    Thread: Find Common Elements in 2 list
Post: RE: Find Common Elements in 2 list

Hope this helps A = [(7.5,), (17.5,), (22.5,), (25.0,), (27.5,), (30.0,), (37.5,), (40.0,)] B = [(17.5,), (22.5,), (25.0,), (27.5,), (30.0,), (37.5,), (40.0,), (42.5,)] list(set(A).intersection(B))Ou...
klllmmm General Coding Help 4 618 Apr-14-2021, 03:29 PM
    Thread: Plot data from CSV
Post: RE: Plot data from CSV

Hi @allen04, It's worth if you can mention the exact error or problem you faced with your code. May be following snippets help you. import pandas as pd # Load the datasets df1 = pd.DataFrame(data...
klllmmm General Coding Help 2 537 Jan-03-2021, 08:26 AM
    Thread: How to apply a class method to an entire dataframe column
Post: RE: How to apply a class method to an entire dataf...

Hi @tirtha9, Good day! Hope the below answer helps df2['ISBearish'] = df2['Date'].apply(lambda x: (Scanner(df2, x).isbearish2())) print(df2)Output: Date Open High Low Close ISBearish 0 2020-01-31 7...
klllmmm General Coding Help 1 564 Jan-03-2021, 04:44 AM
    Thread: Matching multiple conditions and mapping multiple results, between two dataframes
Post: RE: Matching multiple conditions and mapping multi...

Hi deveyge33 Good day!. Hope the below answer helps. import pandas as pd import datetime as dt # Load the datasets & convert text into datatime format df1 = pd.DataFrame(data={"fruit":['apple',...
klllmmm Data Science 2 536 Jan-02-2021, 08:42 AM
    Thread: Assign a value if datetime is in between a particular time limit
Post: RE: Assign a value if datetime is in between a par...

(Jan-01-2021, 11:05 AM)Larz60+ Wrote: see: https://pymotw.com/3/datetime/ No relevant content found for my question.
klllmmm General Coding Help 2 597 Jan-02-2021, 07:00 AM
    Thread: Assign a value if datetime is in between a particular time limit
Post: Assign a value if datetime is in between a particu...

Hi there, I'm trying to assign a value to a dataframe if my DateTime column time value is belonging to a particular time frame. I tried to use; - pandas .between_time() method to identify whether t...
klllmmm General Coding Help 2 597 Jan-01-2021, 08:08 AM
    Thread: Error when Excelwriter saving a dataframe with datetime datatype with timezone
Post: RE: Error when Excelwriter saving a dataframe with...

Managed to solve this using strftime into text format excluding time zone details and then convert back to datetime format. import pandas as pd from pandas import ExcelWriter import pytz from dateti...
klllmmm General Coding Help 3 2,000 Dec-08-2020, 08:52 AM
    Thread: Error when Excelwriter saving a dataframe with datetime datatype with timezone
Post: Error when Excelwriter saving a dataframe with dat...

I'm trying to save pandas data-frame with timezone data into an excel workbook. However i get this error. import pandas as pd from pandas import ExcelWriter data = pd.DataFrame(data={"ID":[1,2], ...
klllmmm General Coding Help 3 2,000 Dec-03-2020, 02:19 PM
    Thread: merge dataframes
Post: RE: merge dataframes

Hope this helps; df1 = pd.DataFrame(data = {'pais':['Chile','Chile','Chile'], 'año':[2000,2001,2002], 'cantidad':[10,11,12],}) df2 = pd....
klllmmm General Coding Help 1 457 Oct-17-2020, 06:44 PM
    Thread: Pandas, Assign a value in a row, to another column based on a condition
Post: RE: Pandas, Assign a value in a row, to another co...

(Oct-15-2020, 08:08 PM)jefsummers Wrote: I think I got it. Used a 2 pass approach - first pass to pick up the codes and values to be set in a dictionary. Second pass to set the values. import panda...
klllmmm General Coding Help 6 1,519 Oct-16-2020, 04:43 PM
    Thread: Pandas, Assign a value in a row, to another column based on a condition
Post: RE: Pandas, Assign a value in a row, to another co...

(Oct-14-2020, 07:19 PM)jefsummers Wrote: Something like import pandas as pd import numpy as np df = pd.DataFrame(data = {'Code':[100,100,100,200,200],                           'Value':[np.nan,1000,...
klllmmm General Coding Help 6 1,519 Oct-15-2020, 12:58 PM
    Thread: Pandas, Assign a value in a row, to another column based on a condition
Post: RE: Pandas, Assign a value in a row, to another co...

(Oct-14-2020, 11:21 AM)jefsummers Wrote: Not quite sure what you are trying to do. In the for loop, are you trying to set Insu1 to the contents of the Value column if Code and ValueCount are both 1?...
klllmmm General Coding Help 6 1,519 Oct-14-2020, 05:40 PM

User Panel Messages

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