Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: RandomForest --ValueError: setting an array element with a sequence
Post: RandomForest --ValueError: setting an array elemen...

I am completely new to RandomForest and Machine Learning. Some help will be appreciated! Thank you! Example of DataSet **ID |sentiment | review | source |** '5' |0 ...
JaneTan Data Science 0 134 Sep-08-2021, 02:12 AM
    Thread: How do I use bounding box to locate a table in a pdf file?
Post: How do I use bounding box to locate a table in a p...

I am completely new to bounding boxes. I only know bounding box can be used to locate objects. So I am wondering if BB box can be used to locate a table in a pdf file? Or is there other ways? Thank ...
JaneTan Data Science 1 152 Sep-01-2021, 08:49 AM
    Thread: How do I locate setup.py in my computer, or install the file?
Post: How do I locate setup.py in my computer, or instal...

Hi, I get error: File 'setup.py' not found when I used pip install to install new packages on Anaconda Prompt. I know there are similar questions on StackOVerFlow. But in my case, I can't even loc...
JaneTan General Coding Help 1 210 Aug-26-2021, 04:34 AM
    Thread: How do I open the Source code of a library?
Post: How do I open the Source code of a library?

I want to find all the methods available in a Python library. Eg for Win32com. Thank you
JaneTan General Coding Help 1 142 Aug-18-2021, 01:17 AM
    Thread: win32com — How to resolve “AttributeError: xlUp” for Excel files?
Post: win32com — How to resolve “AttributeError: xlUp” f...

Similar to Excel VBA, win32com has a 'xlUp' command. But do I use it? I tried the below code but get AttributeError: xlUp Or how do I find all the methods available in a Python library? Thanks in adv...
JaneTan General Coding Help 2 224 Aug-18-2021, 01:16 AM
    Thread: How does K-Means++ work in selecting initial centroids?
Post: How does K-Means++ work in selecting initial centr...

I read some online materials on how K-means++ works in selecting initial centroids in KMeans. But I still don't understand. Eg, if I specify 3 clusters, 1) K-Means++ will select the 1st centroid poi...
JaneTan Data Science 1 286 Jul-30-2021, 02:31 AM
    Thread: Python Pandas: How do I average ONLY the data >1000 from several columns?
Post: Python Pandas: How do I average ONLY the data >100...

I am new to pandas. I just want to average the revenue from Revenue1 to Revenue3 that are > 1000. The dataframe will have other numerical columns like Income. Thank you! Input: |Name | Revenue1| ...
JaneTan General Coding Help 0 310 Jul-17-2021, 01:34 PM
    Thread: Python Pandas: How do I extract all the >1000 data from a certain column?
Post: Python Pandas: How do I extract all the >1000 data...

Hi I am new to pandas. For Revenue, I just want to extract all Revenue !>1000, and sum all the extracted data. **Input:** ` |Name | Revenue| |Peter| 10000 | |Jane | 20000 | |Sally| 30000 | `...
JaneTan General Coding Help 0 289 Jul-17-2021, 09:09 AM
    Thread: Python Pandas: How do I sumproduct by rows with an if condition?
Post: Python Pandas: How do I sumproduct by rows with an...

I am new to Python Pandas. For each row, I want to do a sumproduct of certain columns only if column['2020'] !=0. I used the below code, but get error: IndexError: ('index 2018 is out of bounds for ...
JaneTan General Coding Help 2 485 Jul-13-2021, 01:38 AM
    Thread: Python “Formula” Package: How do I parse Excel formula with a range of cells?
Post: Python “Formula” Package: How do I parse Excel for...

Hi, I have read the documentation of the "Formula" package at https://formulas.readthedocs.io/en/stabl...ng-formula but it doesn't explain how to input the values for an Excel function that uses a ra...
JaneTan General Coding Help 1 366 Jul-12-2021, 06:02 AM
    Thread: How do I read in a Formula in Excel and convert it to do the computation in Python?
Post: How do I read in a Formula in Excel and convert it...

I have a table of time-series data downloaded from some system. Say it is the revenue data for different persons across time. Eg below Table 1 | | Jan 1999| Feb 1999|Dec 1999| |----- | --------| -...
JaneTan General Coding Help 2 287 Jul-07-2021, 07:36 AM
    Thread: gensim (TfidfModel): How much is the Tf-Idf computed?
Post: gensim (TfidfModel): How much is the Tf-Idf comput...

Hi For the below test text , test=['test test', 'test toy'], the tf-idf score is [['test', 1.0]] [['test', 0.35], ['toy', 0.94]] I am not sure how it is arrived at. Can someone show an example? ...
JaneTan Data Science 0 180 Jun-28-2021, 06:19 AM
    Thread: Matplotlib: How do I convert Dates from Excel to use in Matplotlib
Post: Matplotlib: How do I convert Dates from Excel to u...

A typical date in Excel is d/m/yyyy (eg '6/3/1990'). I want to import a timeseries from excel to plot in Matplotlib. I note for Python datetime module the date have to be in the format yyyy-mm-dd (e...
JaneTan General Coding Help 1 742 Mar-11-2021, 03:28 AM
    Thread: Python Matplotlib: How do I save (in pdf) all the graphs I create in a loop?
Post: Python Matplotlib: How do I save (in pdf) all the ...

Hi, Refer to the entire code appended at the end. Thanks 1) I meet with "Cannot assign to operator (pyflakes E)" when I try to assign a variable(j) to the name of another variable 'fig' + str(j), 'a...
JaneTan General Coding Help 1 1,841 Feb-28-2021, 12:07 PM
    Thread: Python Matplotlib: How do I plot lines with different end point in the same graph?
Post: Python Matplotlib: How do I plot lines with differ...

Hi Basically I have Revenue that ends at year 2000 and Profit that ends at year 1998. I want to plot both set of data on the same graph. I read in the data from Excel file. But for Profit, the missi...
JaneTan General Coding Help 0 430 Feb-28-2021, 11:56 AM
    Thread: Python Matplotlib: Create chart for every 4 columns in Excel file
Post: RE: Mathplotlib: Create chart for every 4 columns ...

Hi I want to use Mathplotlib for it. Basically, it should loop through every 4 columns in my Excel file and create a separate graph for every 4 column Every 4 columns will be the Revenue, Cost, Wag...
JaneTan General Coding Help 2 875 Feb-28-2021, 05:02 AM
    Thread: Python Matplotlib: Create chart for every 4 columns in Excel file
Post: Python Matplotlib: Create chart for every 4 column...

Hi I want to loop through every 4 columns in an Excel file and create line charts in a pdf file. There is no upload function for me to show my Excel file as sample. Basically create 4 lines in a si...
JaneTan General Coding Help 2 875 Feb-18-2021, 04:01 AM
    Thread: What is the value after JOINING an empty list?
Post: What is the value after JOINING an empty list?

Hi I want to set a if condition based on the value of test_final. Sometimes there is no value in test_final if no items are found. For such cases, I tried to set the if condition based on None or "...
JaneTan General Coding Help 2 642 Jan-04-2021, 12:06 PM
    Thread: How do I reduce the time to Invoke Macro via Python?
Post: How do I reduce the time to Invoke Macro via Pytho...

I noted that when I invoke a macro (via Python) to do some stuff in my Excel workbook it takes longer than if I write the code in Python to do it directly. The time difference is about 50% less. Is t...
JaneTan General Coding Help 1 643 Dec-28-2020, 03:47 AM
    Thread: Python Machine Learning: For Data Extraction
Post: Python Machine Learning: For Data Extraction

Hi I have many pdf files. Each file has many tables, and I want Python to be able to find the correct (eg Revenue) table and extract the correct data. The Revenue table may have slight variation in ...
JaneTan Data Science 0 464 Nov-24-2020, 06:45 AM

User Panel Messages

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