Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor II
41 Views

Chinese characters

Sometimes banging you head against the wall helps, because the pain stops when you stop and it feels good I think -- or as Joe Friday said -- Just the facts-ma'am. 

The Chinese data from the viral analysis is being uploaded to GIT hub, but when you download it -- many programs cannot understand the Chinese characters and reading them into Fortran is just so interesting. 

I worked out that Notepad++ actually gives one the correct Chinese characters, so I sent them to my former Chinese student to translate the data so I can do a English replace and use them in Fortran, but her IT people will not load Notepad++ and her home computer is a MAC.  Now I have to take pictures and send them to her. 

The Chinese professors are now on lock down so there is no response.  

Can I read Chinese characters in Fortran?  I installed the Chinese language pack and yet EXCEL does not recognize them.

Data attached -- 

PS -- the US data is still rising 

 

0 Kudos
4 Replies
Highlighted
Moderator
41 Views

Unfortunately Ifort's character KINDS supported are just 1 KIND - ASCII.  one byte, 8 bits.  No extended character support in CHARACTER types.  So you cannot read them into/out of CHARACTER data.  But ...

But if you read them as raw, what ?, 16bit INTEGER ?? ... you might be able to process them in raw form.

My mac didn't like the .csv files in the zip due to the character set no doubt.  

0 Kudos
Highlighted
Black Belt
41 Views

Generally, when there is usable numerical data combined with strings in an unfamiliar language within the same file, I look for a systematic pattern in the file, and try with help from an online translator to see if it is sufficient to read the numbers in the file and skip over the foreign language text.

Here is code that may read most of the CSV files that you provided. It will need to be modified if the month number requires two digits (Oct, Nov and Dec). I hope that the pandemic will not last that long.

program rdfil
! Read CSV files containing:
! a) one line of text
! b) lines with the following fields:
!    1. Single digit month number
!    2. Chinese character for "month", 月 (2 bytes)
!    3. Two digit Day of Month
!    4. Comma followed by number of cases for that day
character(50) :: iline
integer :: mo, dom, n
read(*,'(A)')iline  !first line
do
   read(*,'(A)',end=100)iline
   read(iline,'(i1,2x,i2,1x,i4)')mo,dom,n
   print 20, mo, dom, n
end do
100 stop
20 format(1x,i2,'/',i2,1x,i5)
end

 

0 Kudos
Highlighted
New Contributor II
41 Views

Thank you 

The beast is not going anywhere in the next year -- think of your favourite restaurant -- make a booking for May 2021 and you may just make it. 

PS Luckily I like McDonalds as my favourite restaurant so I am ok. 

mecej4 -- you are worth all of the money I told that guy in the UK 

0 Kudos
Highlighted
New Contributor II
41 Views

Just so you are all aware that the work is being appreciated  - Nino is a good as mecej4 in the stat world. 

---------------------------------------------------------------------------------------------------------------------------------------

Hi John,

Thanks very much for not throwing me overboard as yet and keeping me on this project.

About your concern P(I am dead) < 0.05 -you are correct, it is statistically unlikely!:)

Your graphs are very impressive - you have done a very good job.  Your references were very useful for me, thank you!

Actually I am still pursuing an idea applying a local-linear nonparametric model (regrettably, yes in Matlab)  and then using your approach for its residuals 

 

Forwarding you the GitHub link to the modelling done by guys from that ANZSTAT list.

 

 I agree with you when your link becomes available people will start contributing to it; you have put so much time into it, probably, your collaborators may were very unhappy about it but thanks to your analysis, the world has the proof now, China's death rates were improving a lot faster than they should have and many were suspicious about that, however, no one had any idea what was going on.

 

I'll get back to you on 2-4. Rising rates? We are helpless we need other measures to be put into the model- SEIR(?) see Brauer et al. - The Epidemiology Bible!

Nino

0 Kudos