Python Forum
Problem with number of rows containing null values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with number of rows containing null values
#1
After cleaning all the rows that has null values, why do I still have a row count that is uneven ?

The data set and my code can be found here: https://drive.google.com/drive/folders/1...sp=sharing

Theses lines:

cursor.execute('SELECT * FROM VG_sale')

query = cursor.fetchall()

rows = pd.DataFrame(query, columns=(['RANK','NAME','PLATFORM','YEAR','GENRE','PUBLISHER','NA_SALES','EU_SALES','JP_SALES','OTHER_SALES','GLOBAL_SALES']))

print(rows.count())
Showed me that the columns: Year, NA_Sales, JP_Sales, EU_Sales don't have 16598 rows...
Reply
#2
How did you clean the rows that have null values?
Reply
#3
I replaced null values with the median. I also replaced "0" with "0.01":

median = df['Other_Sales'].median()
#print(median) 
df['Other_Sales'].fillna(median, inplace = True)
Reply
#4
'SELECT * FROM VG_sale' is a database query isn't it? This select will retrieve the same number of rows unless you 'DELETE' rows. (Or 'INSERT' rows, but you're not talking about that.) 'UPDATING' column values will not change the number of rows.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python keeps inserting NULL values into table card51shor 18 4,742 Jun-09-2020, 07:05 AM
Last Post: buran
  number problem jk91 20 7,288 May-30-2020, 09:46 AM
Last Post: jk91

Forum Jump:

User Panel Messages

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