Don't wanna be here? Send us removal request.
Text
Data Management And Visualization - 3/5
I have faced a few problems with this dataset because the dataset that was provided to me, had many blank cells and when I was using the .csv files, I tried dataframe.dtypes() which told me that, all columns are in object form.
But, as we are aware that to have an analysis of this data, we need it in int64 or float form. So, I tried using .to_numerical and astype() funtions but none of them worked.
Because pd.to_numerical can't parse the string. To do that, I used astype("string").astype(int64) but that raised an error as "base 10: "----"' which was basically about all those blank spaces in the .csv file. Now, I was upset and called a few of my friends, Eeman told me that I could use the on_bad_line= function available inside the read_csv file. after using this and a few others, I got to know there are no bad values. Now, comes Rahul Bhaiya's chance, which made me observe that all those blank cells are "String".....
that's why pd.to_numerical and astype("string").astype(int64) weren't working. Hooooo !! So, what to do now?
Somehow, Pushpendra came with ._convert and it worked but how ? You can convert everything which incomprehensible or comprehensible to string, Float, Int, and all. Now, another research of mine is here, I searched about the ._convert, so it's better version is pandas.DataFrame.convert_objects, but it is deprecated and
pandas.to_datetime
.pandas.to_timedelta
.pandas.to_numeric
it has been broken into these three functions, Duh !! It was,t working.
So, I thought there has to be some other function, and well, when I was compiling my thoughts here, I got to know about
pandas.DataFrame.convert_dtypes
Definitely, go read about it, this function is a much better version of ._convert and can understand all those columns' data and change it to respective datatype
2 notes
·
View notes
Text
Data Management And Visualization - 2/5
Assignment 2: Research Questions Based on my Codebook
How Armed-Force-Rate is affecting life expectancy and suicide/person rate?
Is Alcohol-Consumption increasing with Income-Per-Person?
Is there any correlation between Oil-per-person and r-electric-per-person?
How Internet-usage is being affected by the polity-score of each Country?
Relation of urban-rate and CO2-Emmision?
1 note
·
View note
Text
Data Management And Visualization - 1/5
Assignment-1: About the Code-Book
Codebook
H1EE4—in some instances, this question was not answered in integers but with a “best” guess such as “7+” hours spent working for pay in a typical non-summer week. Any variable with this non-numeric data has been recorded by adding a “.1” to the answer. For the above example, the variable was recoded to “7.1” hours.
H1EE5—the valid response codes of “$996,” “$998,” and “$999” earned in a typical non-summer week are not distinguishable from the reserve codes of “996” (refused), “998” (don’t know), and “999” (not applicable), as the response categories have the same code. In some instances, this question was not answered in integers but, for example, in a “best” guess such as “$75+.” Any variable with this non-numeric data has been recorded by adding a “.1” to the answer. For the above example, the variable was recoded to “$75.1.”
H1EE7—the valid response codes of “$996,” “$998,” and “$999” earned in a typical summer week are not distinguishable from the reserve codes of “996” (refused), “998” (don’t know), and “999” (not applicable), as the response categories have the same code. In some instances, this question was not answered in integers but, for example, in a “best” guess such as “$75+.” Any variable with this non-numeric data has been recorded by adding a “.1” to the answer. For the above example, the variable was recoded to “$75.1.”
H1EE8—the valid response codes of “$996,” “$998,” and “$999” for the amount of allowance received per week are not distinguishable from the reserve codes of “996” (refused), “998” (don’t know), and “999” (not applicable), as the response categories have the same code.
here's the link to dataset Questions :
4 notes
·
View notes