Python Forum
Trying to search and make new column from the keyword.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to search and make new column from the keyword.
#2
The error says that you have a float number in df1 which means you have a float number in qd1. From the screenshot this must be between rows 4 and 73511. The code below has the same problem, crashing when it tries to call (2.0).upper().
import pandas as pd

df1 = pd.DataFrame(["-", "+", "1", 2.0], columns=["CRTXT"])
for x in df1['CRTXT']:
    print(x, ', ', sep="", end="")
    print(x.upper())
Output:
-, - +, + 1, 1 2.0, Traceback (most recent call last): File "...", line 6, in <module> print(x.upper()) AttributeError: 'float' object has no attribute 'upper'
Reply


Messages In This Thread
RE: Trying to search and make new column from the keyword. - by deanhystad - Dec-20-2021, 08:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Find a specific keyword after another keyword and change the output sgtmcc 5 1,030 Oct-05-2023, 07:41 PM
Last Post: deanhystad
  How do I make a symmetric matrix from a column vector? leocsmith 3 3,875 Mar-30-2021, 10:17 AM
Last Post: leocsmith
  Openpyxl tkinter search a value in Excel column Heathcliff_1 0 3,384 Dec-02-2020, 04:35 PM
Last Post: Heathcliff_1
  how to make a keyword arg w/o a default value? Skaperen 10 3,842 Jun-30-2020, 01:55 AM
Last Post: Skaperen
  search binary file and list all founded keyword offset Pyguys 4 2,974 Mar-17-2020, 06:46 AM
Last Post: Pyguys
  how to make iterative search more efficient renergy 2 2,357 Jan-03-2020, 03:43 PM
Last Post: stullis
  Search Excel column values jonzee 1 2,721 Dec-21-2019, 02:38 AM
Last Post: Clunk_Head
  Trying to make column based file from text file scor1pion 7 3,687 Jul-16-2019, 02:43 PM
Last Post: scor1pion
  How can I make a faster search algorithm pianistseb 19 6,978 Apr-18-2019, 05:48 PM
Last Post: Larz60+
  SQLite Query multiple column search whacky7 6 8,713 Apr-01-2019, 09:29 PM
Last Post: whacky7

Forum Jump:

User Panel Messages

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